-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from icon-project/bgkwon-BDT-829
Add SetFeeTable event log in bmc
- Loading branch information
Showing
5 changed files
with
90 additions
and
1 deletion.
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
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,43 @@ | ||
package foundation.icon.score.util; | ||
|
||
import score.ByteArrayObjectWriter; | ||
import score.Context; | ||
|
||
import java.math.BigInteger; | ||
|
||
public class Encode { | ||
public static byte[] encode(BigInteger[] arr) { | ||
ByteArrayObjectWriter w = Context.newByteArrayObjectWriter("RLPn"); | ||
w.beginList(arr.length); | ||
for (BigInteger v : arr) { | ||
w.write(v); | ||
} | ||
w.end(); | ||
return w.toByteArray(); | ||
} | ||
|
||
public static byte[] encode(BigInteger[][] twoDimArr) { | ||
ByteArrayObjectWriter w = Context.newByteArrayObjectWriter("RLPn"); | ||
w.beginList(twoDimArr.length); | ||
for (BigInteger[] arr : twoDimArr) { | ||
w.beginList(arr.length); | ||
for (BigInteger v : arr) { | ||
w.write(v); | ||
} | ||
w.end(); | ||
} | ||
w.end(); | ||
return w.toByteArray(); | ||
} | ||
|
||
public static byte[] encode(String[] arr) { | ||
ByteArrayObjectWriter w = Context.newByteArrayObjectWriter("RLPn"); | ||
w.beginList(arr.length); | ||
for (String v : arr) { | ||
w.write(v); | ||
} | ||
w.end(); | ||
return w.toByteArray(); | ||
} | ||
|
||
} |