Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lua api not found at javac #12

Open
Molocher opened this issue Feb 25, 2022 · 1 comment
Open

lua api not found at javac #12

Molocher opened this issue Feb 25, 2022 · 1 comment

Comments

@Molocher
Copy link

The following APIs are in lua, but not found in gjavac:
1.Use the global function get_transaction_id(): string to get the transaction id of this transaction

2.wait_for_future_random: (int) => int according to the block height of the parameter to obtain the pseudo-random number obtained from the data of this block, if the block height has not been reached, it returns 0

3.hex_to_bytes: (string) => table convert hexadecimal string into byte array

4.bytes_to_hex: (table) => string convert byte array to hexadecimal string

5.sha1_hex: (string) => string Perform sha1 operation on the byte array obtained by converting the hexadecimal string of the parameter, and then convert it into a hexadecimal string and return

6.sha3_hex: (string) => string Perform sha3-256 operation on the byte array obtained by converting the hexadecimal string of the parameter, and then convert it into a hexadecimal string and return

7.sha256_hex: (string) => string Perform sha256 operation on the byte array obtained by converting the hexadecimal string of the parameter, and then convert it into a hexadecimal string and return

8.ripemd160_hex: (string) => string Performs the ripemd160 operation on the byte array obtained by converting the hexadecimal string of the parameter, and then converts it into a hexadecimal string and returns

9.cbor_encode: (object) => string Serialize the parameters into a binary byte array according to cbor serialization and return it as a hexadecimal string

10.cbor_decode: (string) => object De-serialize the binary byte array corresponding to the hexadecimal string according to the cbor serialization method into a gula object

11.signature_recover: (string, string) => string The signature from the first parameter (compressed signature format, 65 bytes, expressed as a hexadecimal string) and the original digest of the second parameter (32 bytes, entered in 16) String representation)

@tobiasholt
Copy link
Contributor

It appears that all these functions are built-in function of UVM, so there is no need to consider the implementation. An empty body of the functions should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants