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

Backport cleos local abi file #704

Merged
merged 21 commits into from
Aug 8, 2022
Merged

Conversation

jgiszczak
Copy link
Contributor

@jgiszczak jgiszczak commented Jul 20, 2022

cleos: Add ability to specify one or more local abi files for cleos for serialzation/deserialization offline, which doesn't require nodeos RPC endpoint

new parameter:
--abi-file <contract name>:<abi file path>

Uses a local abi file for serialization and deserialization instead of getting the abi data from the blockchain; repeat this option to pass multiple abi files for different contracts

example:

action binary data => json data

./cleos --abi-file eosio.token:../eosio.contracts/build/contracts/eosio.token/eosio.token.abi convert unpack_action_data eosio.token transfer 0000000000ea30554008218410420831a086010000000000045359530000000000
{
  "from": "eosio",
  "to": "a44444444444",
  "quantity": "10.0000 SYS",
  "memo": ""
}

json data => binary:

./cleos --abi-file eosio.token:../eosio.contracts/build/contracts/eosio.token/eosio.token.abi convert pack_action_data eosio.token transfer '{"from":"aaa","to":"bbb","quantity":"10.0000 SYS","memo":"hello"}'
0000000000008c31000000000000ce39a08601000000000004535953000000000568656c6c6f

Resolves #451 and resolves #457.

[no-ccache]

tests/cli_test.py Outdated Show resolved Hide resolved
tests/cli_test.py Outdated Show resolved Hide resolved
tests/cli_test.py Outdated Show resolved Hide resolved
tests/cli_test.py Outdated Show resolved Hide resolved
tests/cli_test.py Outdated Show resolved Hide resolved
.github/workflows/ubuntu-2004.yml Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants