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

Test Boxes field in application calls static array #181

Merged
merged 17 commits into from
Jun 7, 2022
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .up-env
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ export TYPE="channel"
export CHANNEL="nightly"

# Used when TYPE=source
export ALGOD_URL="https://github.com/algorand/go-algorand"
export ALGOD_BRANCH="master"
export ALGOD_URL="https://github.com/jannotti/go-algorand"
export ALGOD_BRANCH="avm-box"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently points to the fork, but should revert this back before merging to master.

4 changes: 2 additions & 2 deletions features/integration/abi.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Feature: ABI Interaction
And suggested transaction parameters from the algod v2 client
And I create a new transient account and fund it with 100000000 microalgos.
And I make a transaction signer for the transient account.
And I build an application transaction with the transient account, the current application, suggested params, operation "create", approval-program "programs/abi_method_call.teal.tok", clear-program "programs/one.teal.tok", global-bytes 0, global-ints 0, local-bytes 1, local-ints 0, app-args "", foreign-apps "", foreign-assets "", app-accounts "", extra-pages 0
And I build an application transaction with the transient account, the current application, suggested params, operation "create", approval-program "programs/abi_method_call.teal.tok", clear-program "programs/one.teal.tok", global-bytes 0, global-ints 0, local-bytes 1, local-ints 0, app-args "", foreign-apps "", foreign-assets "", app-accounts "", extra-pages 0, boxes ""
And I sign and submit the transaction, saving the txid. If there is an error it is "".
And I wait for the transaction to be confirmed.
And I remember the new application ID.
Expand Down Expand Up @@ -100,7 +100,7 @@ Feature: ABI Interaction
Scenario: Method call delete execution
Given I create a new transient account and fund it with 100000000 microalgos.
And I make a transaction signer for the transient account.
And I build an application transaction with the transient account, the current application, suggested params, operation "create", approval-program "programs/abi_method_call.teal.tok", clear-program "programs/one.teal.tok", global-bytes 0, global-ints 0, local-bytes 1, local-ints 0, app-args "", foreign-apps "", foreign-assets "", app-accounts "", extra-pages 0
And I build an application transaction with the transient account, the current application, suggested params, operation "create", approval-program "programs/abi_method_call.teal.tok", clear-program "programs/one.teal.tok", global-bytes 0, global-ints 0, local-bytes 1, local-ints 0, app-args "", foreign-apps "", foreign-assets "", app-accounts "", extra-pages 0, boxes ""
And I sign and submit the transaction, saving the txid. If there is an error it is "".
And I wait for the transaction to be confirmed.
And I remember the new application ID.
Expand Down
30 changes: 15 additions & 15 deletions features/integration/applications.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,70 +11,70 @@ Feature: Applications
# This should create a new, random account and save the public/private key for future steps to use.
Given I create a new transient account and fund it with 100000000 microalgos.
# Application create with extra pages should succeed with expected message.
And I build an application transaction with the transient account, the current application, suggested params, operation "create", approval-program "programs/big_app_program.teal.tok", clear-program "programs/big_app_program.teal.tok", global-bytes <global-bytes>, global-ints 0, local-bytes <local-bytes>, local-ints 0, app-args "", foreign-apps "", foreign-assets "", app-accounts "", extra-pages 3
And I build an application transaction with the transient account, the current application, suggested params, operation "create", approval-program "programs/big_app_program.teal.tok", clear-program "programs/big_app_program.teal.tok", global-bytes <global-bytes>, global-ints 0, local-bytes <local-bytes>, local-ints 0, app-args "", foreign-apps "", foreign-assets "", app-accounts "", extra-pages 3, boxes ""
And I sign and submit the transaction, saving the txid. If there is an error it is "logic eval error: pc=704 dynamic cost budget exceeded, executing intc_1: local program cost was 700. Details: pc=704, opcodes=intc_1 // 1".

# Create application
# depends on the transient account, and also the application id.
# Use suggested params
And I build an application transaction with the transient account, the current application, suggested params, operation "create", approval-program "programs/one.teal.tok", clear-program "programs/one.teal.tok", global-bytes <global-bytes>, global-ints 0, local-bytes <local-bytes>, local-ints 0, app-args "", foreign-apps "", foreign-assets "", app-accounts "", extra-pages 0
And I build an application transaction with the transient account, the current application, suggested params, operation "create", approval-program "programs/one.teal.tok", clear-program "programs/one.teal.tok", global-bytes <global-bytes>, global-ints 0, local-bytes <local-bytes>, local-ints 0, app-args "", foreign-apps "", foreign-assets "", app-accounts "", extra-pages 0, boxes ""
# If error is an empty string, there should be no error.
And I sign and submit the transaction, saving the txid. If there is an error it is "".
And I wait for the transaction to be confirmed.
And I remember the new application ID.
Then I get the account address for the current application and see that it matches the app id's hash
# Update approval program to 'loccheck'
Given I build an application transaction with the transient account, the current application, suggested params, operation "update", approval-program "<program>", clear-program "programs/one.teal.tok", global-bytes 0, global-ints 0, local-bytes 0, local-ints 0, app-args "", foreign-apps "", foreign-assets "", app-accounts "", extra-pages 0
Given I build an application transaction with the transient account, the current application, suggested params, operation "update", approval-program "<program>", clear-program "programs/one.teal.tok", global-bytes 0, global-ints 0, local-bytes 0, local-ints 0, app-args "", foreign-apps "", foreign-assets "", app-accounts "", extra-pages 0, boxes ""
And I sign and submit the transaction, saving the txid. If there is an error it is "".
And I wait for the transaction to be confirmed.
# OptIn - with error (missing argument)
And I build an application transaction with the transient account, the current application, suggested params, operation "optin", approval-program "", clear-program "", global-bytes 0, global-ints 0, local-bytes 0, local-ints 0, app-args "", foreign-apps "", foreign-assets "", app-accounts "", extra-pages 0
And I build an application transaction with the transient account, the current application, suggested params, operation "optin", approval-program "", clear-program "", global-bytes 0, global-ints 0, local-bytes 0, local-ints 0, app-args "", foreign-apps "", foreign-assets "", app-accounts "", extra-pages 0, boxes ""
And I sign and submit the transaction, saving the txid. If there is an error it is "invalid ApplicationArgs index 0".
# OptIn - with error - wrong argument (program requires 'str:hello')
And I build an application transaction with the transient account, the current application, suggested params, operation "optin", approval-program "", clear-program "", global-bytes 0, global-ints 0, local-bytes 0, local-ints 0, app-args "str:goodbye", foreign-apps "", foreign-assets "", app-accounts "", extra-pages 0
And I build an application transaction with the transient account, the current application, suggested params, operation "optin", approval-program "", clear-program "", global-bytes 0, global-ints 0, local-bytes 0, local-ints 0, app-args "str:goodbye", foreign-apps "", foreign-assets "", app-accounts "", extra-pages 0, boxes ""
And I sign and submit the transaction, saving the txid. If there is an error it is "stack len is 3 instead of 1".
# OptIn - success
And I build an application transaction with the transient account, the current application, suggested params, operation "optin", approval-program "", clear-program "", global-bytes 0, global-ints 0, local-bytes 0, local-ints 0, app-args "str:hello", foreign-apps "", foreign-assets "", app-accounts "", extra-pages 0
And I build an application transaction with the transient account, the current application, suggested params, operation "optin", approval-program "", clear-program "", global-bytes 0, global-ints 0, local-bytes 0, local-ints 0, app-args "str:hello", foreign-apps "", foreign-assets "", app-accounts "", extra-pages 0, boxes ""
And I sign and submit the transaction, saving the txid. If there is an error it is "".
And I wait for the transaction to be confirmed.
# App should be listed in created apps list with schema settings, with no local/global state.
Then The transient account should have the created app "true" and total schema byte-slices 1 and uints 0, the application "<state-location>" state contains key "" with value ""
# Call with args 'str:write' to put the application in write mode
And I build an application transaction with the transient account, the current application, suggested params, operation "call", approval-program "", clear-program "", global-bytes 0, global-ints 0, local-bytes 0, local-ints 0, app-args "str:write", foreign-apps "", foreign-assets "", app-accounts "", extra-pages 0
And I build an application transaction with the transient account, the current application, suggested params, operation "call", approval-program "", clear-program "", global-bytes 0, global-ints 0, local-bytes 0, local-ints 0, app-args "str:write", foreign-apps "", foreign-assets "", app-accounts "", extra-pages 0, boxes ""
And I sign and submit the transaction, saving the txid. If there is an error it is "".
And I wait for the transaction to be confirmed.
# Call with args 'str:check,str:write' - REJECTED, program expects 'str:check,str:bar'
And I build an application transaction with the transient account, the current application, suggested params, operation "call", approval-program "", clear-program "", global-bytes 0, global-ints 0, local-bytes 0, local-ints 0, app-args "str:check,str:write", foreign-apps "", foreign-assets "", app-accounts "", extra-pages 0
And I build an application transaction with the transient account, the current application, suggested params, operation "call", approval-program "", clear-program "", global-bytes 0, global-ints 0, local-bytes 0, local-ints 0, app-args "str:check,str:write", foreign-apps "", foreign-assets "", app-accounts "", extra-pages 0, boxes ""
And I sign and submit the transaction, saving the txid. If there is an error it is "transaction rejected by ApprovalProgram".
# Call with args 'str:check,str:bar' write something to the local account
And I build an application transaction with the transient account, the current application, suggested params, operation "call", approval-program "", clear-program "", global-bytes 0, global-ints 0, local-bytes 0, local-ints 0, app-args "str:check,str:bar", foreign-apps "", foreign-assets "", app-accounts "", extra-pages 0
And I build an application transaction with the transient account, the current application, suggested params, operation "call", approval-program "", clear-program "", global-bytes 0, global-ints 0, local-bytes 0, local-ints 0, app-args "str:check,str:bar", foreign-apps "", foreign-assets "", app-accounts "", extra-pages 0, boxes ""
And I sign and submit the transaction, saving the txid. If there is an error it is "".
And I wait for the transaction to be confirmed.
# Local state should now include foo bar
Then The transient account should have the created app "true" and total schema byte-slices 1 and uints 0, the application "<state-location>" state contains key "Zm9v" with value "YmFy"
# Closeout with args 'str:hello' for approval program
And I build an application transaction with the transient account, the current application, suggested params, operation "closeout", approval-program "", clear-program "", global-bytes 0, global-ints 0, local-bytes 0, local-ints 0, app-args "str:hello", foreign-apps "", foreign-assets "", app-accounts "", extra-pages 0
And I build an application transaction with the transient account, the current application, suggested params, operation "closeout", approval-program "", clear-program "", global-bytes 0, global-ints 0, local-bytes 0, local-ints 0, app-args "str:hello", foreign-apps "", foreign-assets "", app-accounts "", extra-pages 0, boxes ""
And I sign and submit the transaction, saving the txid. If there is an error it is "".
And I wait for the transaction to be confirmed.
# OptIn with args 'str:write' to make sure this works too?
And I build an application transaction with the transient account, the current application, suggested params, operation "optin", approval-program "", clear-program "", global-bytes 0, global-ints 0, local-bytes 0, local-ints 0, app-args "str:write", foreign-apps "", foreign-assets "", app-accounts "", extra-pages 0
And I build an application transaction with the transient account, the current application, suggested params, operation "optin", approval-program "", clear-program "", global-bytes 0, global-ints 0, local-bytes 0, local-ints 0, app-args "str:write", foreign-apps "", foreign-assets "", app-accounts "", extra-pages 0, boxes ""
And I sign and submit the transaction, saving the txid. If there is an error it is "".
And I wait for the transaction to be confirmed.
# The key/value should still be there.
Then The transient account should have the created app "true" and total schema byte-slices 1 and uints 0, the application "<state-location>" state contains key "Zm9v" with value "YmFy"
# Call with args 'str:check,str:bar', another test to do something with the application
And I build an application transaction with the transient account, the current application, suggested params, operation "call", approval-program "", clear-program "", global-bytes 0, global-ints 0, local-bytes 0, local-ints 0, app-args "str:check,str:bar", foreign-apps "", foreign-assets "", app-accounts "", extra-pages 0
And I build an application transaction with the transient account, the current application, suggested params, operation "call", approval-program "", clear-program "", global-bytes 0, global-ints 0, local-bytes 0, local-ints 0, app-args "str:check,str:bar", foreign-apps "", foreign-assets "", app-accounts "", extra-pages 0, boxes ""
And I sign and submit the transaction, saving the txid. If there is an error it is "".
And I wait for the transaction to be confirmed.
# Delete application with args 'str:hello' for approval
And I build an application transaction with the transient account, the current application, suggested params, operation "delete", approval-program "", clear-program "", global-bytes 0, global-ints 0, local-bytes 0, local-ints 0, app-args "str:hello", foreign-apps "", foreign-assets "", app-accounts "", extra-pages 0
And I build an application transaction with the transient account, the current application, suggested params, operation "delete", approval-program "", clear-program "", global-bytes 0, global-ints 0, local-bytes 0, local-ints 0, app-args "str:hello", foreign-apps "", foreign-assets "", app-accounts "", extra-pages 0, boxes ""
And I sign and submit the transaction, saving the txid. If there is an error it is "".
And I wait for the transaction to be confirmed.
# Call with args 'str:hello', this should fail with error 'only clearing out is supported' since the application was deleted.
And I build an application transaction with the transient account, the current application, suggested params, operation "call", approval-program "", clear-program "", global-bytes 0, global-ints 0, local-bytes 0, local-ints 0, app-args "str:hello", foreign-apps "", foreign-assets "", app-accounts "", extra-pages 0
And I build an application transaction with the transient account, the current application, suggested params, operation "call", approval-program "", clear-program "", global-bytes 0, global-ints 0, local-bytes 0, local-ints 0, app-args "str:hello", foreign-apps "", foreign-assets "", app-accounts "", extra-pages 0, boxes ""
And I sign and submit the transaction, saving the txid. If there is an error it is "only clearing out is supported".
# Clear with no args should succeed.
And I build an application transaction with the transient account, the current application, suggested params, operation "clear", approval-program "", clear-program "", global-bytes 0, global-ints 0, local-bytes 0, local-ints 0, app-args "", foreign-apps "", foreign-assets "", app-accounts "", extra-pages 0
And I build an application transaction with the transient account, the current application, suggested params, operation "clear", approval-program "", clear-program "", global-bytes 0, global-ints 0, local-bytes 0, local-ints 0, app-args "", foreign-apps "", foreign-assets "", app-accounts "", extra-pages 0, boxes ""
And I sign and submit the transaction, saving the txid. If there is an error it is "".
And I wait for the transaction to be confirmed.
# Verify that the data has been removed from the total schema and the app list.
Expand Down
Loading