-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: extenting policy and added more features
- Loading branch information
1 parent
fe91a00
commit 02ed072
Showing
6 changed files
with
434 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,17 @@ | ||
package applet; | ||
|
||
public class PolicyInstruction { | ||
public static final byte minTotalOutput = 0; | ||
public static final byte maxTotalOutput = 1; | ||
public static final byte minOutputToTargetAddress = 2; | ||
public static final byte maxOutputToTargetAddress = 3; | ||
public static final byte minAmountofInputs = 4; | ||
public static final byte maxAmountofInputs = 5; | ||
public static final byte minAmountofOutputs = 6; | ||
public static final byte maxAmountofOutputs = 7; | ||
public static final byte naiveTimeLapsed = 8; | ||
public static final byte signedTmeLapse = 9; | ||
public static final byte checkSecret = 10; | ||
public static final byte policyAnd = 11; | ||
public static final byte transactionVersion = 12; | ||
public static final byte policyAnd = 13; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package communication; | ||
|
||
public class Tools { | ||
public static byte[] fromHex(String hex){ | ||
// ukradeno | ||
byte[] res = new byte[hex.length() / 2]; | ||
|
||
for (int i = 0; i < res.length; i++) { | ||
int index = i * 2; | ||
int j = Integer.parseInt(hex.substring(index, index + 2), 16); | ||
res[i] = (byte) j; | ||
} | ||
|
||
return res; | ||
} | ||
|
||
public static String bytesToHex(byte[] bytes) { | ||
StringBuilder res = new StringBuilder(); | ||
int cb; | ||
|
||
for (byte aByte : bytes) { | ||
cb = aByte & 0xFF; | ||
res.append(Integer.toHexString(cb / 16)); | ||
res.append(Integer.toHexString(cb % 16)); | ||
} | ||
return res.toString(); | ||
} | ||
} |
Oops, something went wrong.