-
Notifications
You must be signed in to change notification settings - Fork 35
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
ABI Interaction integration tests with app calls #148
Conversation
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 appears to test AtomicTransactionComposer
in a more indirect way than what I was expecting. I was imagining we would have new steps for each action of the composer and mix these in with some of the existing transaction construction steps. Something like:
Given a new atomic transaction composer
And suggested transaction parameters fee <fee>, flat-fee "<flat-fee>", first-valid <first-valid>, last-valid <last-valid>, genesis-hash "<genesis-hash>", genesis-id "<genesis-id>"
When I build a transaction ...
And I make a transaction signer for account mnemonic "<mnemonic>"
And I add the transaction and signer to the composer
And I gather signatures with the composer
Then the signatures should equal "<expected>"
Though admittedly we only have general txn construction steps for app and keyreg txns at the moment. If needed I can help flesh these out for the other txn types.
I may have lead you astray by suggesting we reuse steps as much as possible. In general we should do that, but it doesn't appear to apply to this test very much.
I only added a |
…for ABI method calls
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.
Split up the tests so the unit tests check for the signed transaction goldens and the integration tests check for the app return values.
One tricky thing is how we build up transaction and app arguments for the method calls, and I've just chosen to hard-code it on the Cucumber side rather than the SDK side. It would be nicer if the transactions can be "parameterized" better, but I'm not sure if there is a better way right now.
I updated the tests and tested them against the Python SDK. This commit contains the relevant diff for implementing the test steps in the Python SDK: algorand/py-algorand-sdk@e96b740 |
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.
Looks good!
This PR introduces some Cucumber integration tests for interacting with ARC-0004 compliant apps using the
AtomicTransactionComposer
in the SDKs.PyTeal contract: gist
This change is composed of:
Closes #146
Todo:
return
)