Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Add ability to specify one or more local abi files for cleos for serialzation/deserialization offline 📦 #10821

Merged
merged 2 commits into from
Oct 21, 2021

Conversation

taokayan
Copy link
Contributor

@taokayan taokayan commented Oct 19, 2021

Change Description

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: In form of <contract name>:<abi file path>, use 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

…on & deserialization without the need of nodeos
@taokayan taokayan requested a review from heifner October 19, 2021 09:13
Copy link
Contributor

@heifner heifner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also create a PR to develop.

@heifner
Copy link
Contributor

heifner commented Oct 19, 2021

Discussing with @arhag it would be nice if an abi per account could be specified for transactions that interact with multiple accounts.

@taokayan taokayan requested a review from arhag October 20, 2021 03:16
@taokayan
Copy link
Contributor Author

hey @heifner @arhag please review again. now it supports multiple abi files, each for a different contract.

@taokayan taokayan changed the title Add ability to specify a local abi file for cleos for serialzation/deserialization offline Add ability to specify one or more local abi files for cleos for serialzation/deserialization offline Oct 20, 2021
@taokayan taokayan merged commit 646d55c into develop-boxed Oct 21, 2021
@heifner heifner changed the title Add ability to specify one or more local abi files for cleos for serialzation/deserialization offline Add ability to specify one or more local abi files for cleos for serialzation/deserialization offline 📦 Oct 21, 2021
@revl revl deleted the kayan_cleos_local_abi_file branch October 21, 2021 13:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants