-
Notifications
You must be signed in to change notification settings - Fork 143
ABI Interaction Support for Python SDK #247
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
Conversation
jasonpaulos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the spec doesn't say anything about this currently, but could you add methods to re-encode the Method, Interface, and Contract objects to JSON? For symmetry this would be good to have.
…o it can pass these tests
| ) | ||
| def append_app_args_to_method_args(context, method_args): | ||
| # Returns a list of ABI method arguments | ||
| app_args = split_and_process_abi_args(context.abi_method, method_args) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works for now so it doesn't need to be changed in this PR, but I'd like this step to not assume that method_args match the arguments from context.abi_method.
Meaning it should be possible to call this step many times to append arguments, and then only in the I add a method call... step should the arguments be decoded. This will give us more flexibility to mix transaction args and normal args, like (uint64,pay,uint64,axfer,uint64).
This is how I did in the JS SDK: https://github.com/algorand/js-algorand-sdk/blob/6cb22886b089544349448bc1097164dc70a085b8/tests/cucumber/steps/steps.js#L4750-L4791
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point, we should make the step as general as possible.
tzaffi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left various suggestions. All basically minor improvements or ignoreable.
|
Looks like you shouldn't follow my |
tzaffi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* Start ABI JSON interaction * Add static annoation * Fix Method argument parsing * Add ABI Typing to Method arguments * [WIP] Add AtomicTransactionComposer build functions * [WIP] Sign and send atomic transaction groups * Add unit tests for object parsing * Clean up method calls * Address PR comments on JSON objects * Refactor ABI Type to ABIType so it can be exposed to outside world * Add cucumber steps for ABI tests and update existing implementation so it can pass these tests * Refactor TransactionSigner to Abstract class and merge signatures when signing * Update testing to reflect json unit tests and composer tests * Formatting and docstring fixes * Clean up imports * Fix unit test for appId * Refactor some names and add txn as an arg type * Partially address PR comments * Add some additional checks for safety * Fix a step so we check for empty string instead of None * MInclude returns tests and check for a valid returns from a ABI call * Addressing PR comments about type hints and returning self * Ensure group ids are zero when adding transactions
This PR enables developers to invoke on-chain contract methods using off-chain applications, as defined by ARC-0004.
methoddescription and expose the signature and selectorinterfacedescriptioncontractdescriptionAtomicTransactionComposerTransactionSignersMakefileCloses #242