-
Notifications
You must be signed in to change notification settings - Fork 7
Refactor transaction sender to match TS implementation #260
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
Merged
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
b04b1cc
wip
PatrickDinh 956fa34
add missing methods
PatrickDinh ac6f0b7
comments
PatrickDinh 9f4240c
wip - fixing other integrations
PatrickDinh 903d662
fix app deployer
PatrickDinh 0ed9d3c
wip - fixing tests
PatrickDinh d6d9a2e
make abi return optional
PatrickDinh 742bcf5
remove todo, it will do deal with later
PatrickDinh 32bcd62
clippy
PatrickDinh 137ea9d
comments
PatrickDinh 0df767f
refactor transform_transaction_error logic
PatrickDinh cd27b9b
Merge branch 'main' into refactor/sender
PatrickDinh 244bb91
wip - refactoring app factory
PatrickDinh 2184f1c
done, not review
PatrickDinh 4eb4496
more refactoring
PatrickDinh 350ac88
wip
PatrickDinh 0789bf7
wip - updated app deployer
PatrickDinh 96c41b1
wip - almost there
PatrickDinh 4f96f61
wip
PatrickDinh 7d0a44a
better
PatrickDinh 3c610e9
handle error + test compile issues
PatrickDinh 07a41d2
fix resolve compilation params
PatrickDinh 5552ff2
tests ok
PatrickDinh 461de7b
wip - clippy
PatrickDinh dcd49e5
wip - add test for the app deploy bug
PatrickDinh 759f619
fix the test
PatrickDinh c032264
fmt and clippy
PatrickDinh 151c743
PR review
PatrickDinh 0f4a036
clippy
PatrickDinh 67fa400
convert AlgorandClient to Rc
PatrickDinh 88ec254
convert Rc<AlgorandClient> back to Arc
PatrickDinh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
151 changes: 151 additions & 0 deletions
151
crates/algokit_test_artifacts/contracts/abi-create-and-delete/application.arc56.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,151 @@ | ||
| { | ||
| "name": "application", | ||
| "structs": {}, | ||
| "methods": [ | ||
| { | ||
| "name": "create", | ||
| "args": [ | ||
| { | ||
| "type": "pay", | ||
| "name": "pay_txn" | ||
| } | ||
| ], | ||
| "returns": { | ||
| "type": "string" | ||
| }, | ||
| "actions": { | ||
| "create": [ | ||
| "NoOp" | ||
| ], | ||
| "call": [] | ||
| }, | ||
| "readonly": false, | ||
| "desc": "Create the application", | ||
| "events": [], | ||
| "recommendations": {} | ||
| }, | ||
| { | ||
| "name": "delete", | ||
| "args": [ | ||
| { | ||
| "type": "pay", | ||
| "name": "pay_txn" | ||
| } | ||
| ], | ||
| "returns": { | ||
| "type": "string" | ||
| }, | ||
| "actions": { | ||
| "create": [], | ||
| "call": [ | ||
| "DeleteApplication" | ||
| ] | ||
| }, | ||
| "readonly": false, | ||
| "desc": "Delete the application", | ||
| "events": [], | ||
| "recommendations": {} | ||
| } | ||
| ], | ||
| "arcs": [ | ||
| 22, | ||
| 28 | ||
| ], | ||
| "networks": {}, | ||
| "state": { | ||
| "schema": { | ||
| "global": { | ||
| "ints": 0, | ||
| "bytes": 0 | ||
| }, | ||
| "local": { | ||
| "ints": 0, | ||
| "bytes": 0 | ||
| } | ||
| }, | ||
| "keys": { | ||
| "global": {}, | ||
| "local": {}, | ||
| "box": {} | ||
| }, | ||
| "maps": { | ||
| "global": {}, | ||
| "local": {}, | ||
| "box": {} | ||
| } | ||
| }, | ||
| "bareActions": { | ||
| "create": [], | ||
| "call": [ | ||
| "UpdateApplication" | ||
| ] | ||
| }, | ||
| "sourceInfo": { | ||
| "approval": { | ||
| "sourceInfo": [ | ||
| { | ||
| "pc": [ | ||
| 34 | ||
| ], | ||
| "errorMessage": "OnCompletion is not DeleteApplication" | ||
| }, | ||
| { | ||
| "pc": [ | ||
| 73 | ||
| ], | ||
| "errorMessage": "OnCompletion is not NoOp" | ||
| }, | ||
| { | ||
| "pc": [ | ||
| 77 | ||
| ], | ||
| "errorMessage": "can only call when creating" | ||
| }, | ||
| { | ||
| "pc": [ | ||
| 37, | ||
| 118 | ||
| ], | ||
| "errorMessage": "can only call when not creating" | ||
| }, | ||
| { | ||
| "pc": [ | ||
| 47, | ||
| 86 | ||
| ], | ||
| "errorMessage": "transaction type is pay" | ||
| } | ||
| ], | ||
| "pcOffsetMethod": "cblocks" | ||
| }, | ||
| "clear": { | ||
| "sourceInfo": [], | ||
| "pcOffsetMethod": "none" | ||
| } | ||
| }, | ||
| "source": { | ||
| "approval": "I3ByYWdtYSB2ZXJzaW9uIDEwCiNwcmFnbWEgdHlwZXRyYWNrIGZhbHNlCgovLyBhbGdvcHkuYXJjNC5BUkM0Q29udHJhY3QuYXBwcm92YWxfcHJvZ3JhbSgpIC0+IHVpbnQ2NDoKbWFpbjoKICAgIGludGNibG9jayAxIFRNUExfVVBEQVRBQkxFIFRNUExfREVMRVRBQkxFCiAgICAvLyBjb250cmFjdC5weTo0CiAgICAvLyBjbGFzcyBhcHBsaWNhdGlvbihBUkM0Q29udHJhY3QpOgogICAgdHhuIE51bUFwcEFyZ3MKICAgIGJ6IG1haW5fYmFyZV9yb3V0aW5nQDcKICAgIHB1c2hieXRlc3MgMHhjNjY5NWYzOSAweDg4ZDZjZTlkIC8vIG1ldGhvZCAiY3JlYXRlKHBheSlzdHJpbmciLCBtZXRob2QgImRlbGV0ZShwYXkpc3RyaW5nIgogICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMAogICAgbWF0Y2ggbWFpbl9jcmVhdGVfcm91dGVAMyBtYWluX2RlbGV0ZV9yb3V0ZUA0CgptYWluX2FmdGVyX2lmX2Vsc2VAMTE6CiAgICAvLyBjb250cmFjdC5weTo0CiAgICAvLyBjbGFzcyBhcHBsaWNhdGlvbihBUkM0Q29udHJhY3QpOgogICAgcHVzaGludCAwIC8vIDAKIC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EFEkQxGEQxFiIJSTgQIhJEiABMSRUWVwYCTFCABBUffHVMULAiQzEZFEQxGBREMRYiCTgQIhJEgA0VH3x1AAdjcmVhdGVksCJDgQQxGY4BAANC/6YxGESIAAIiQyNEiYoBASREgAdkZWxldGVkiQ==", | ||
| "clear": "CoEBQw==" | ||
| }, | ||
| "compilerInfo": { | ||
| "compiler": "puya", | ||
| "compilerVersion": { | ||
| "major": 4, | ||
| "minor": 10, | ||
| "patch": 0 | ||
| } | ||
| }, | ||
| "events": [], | ||
| "templateVariables": { | ||
| "UPDATABLE": { | ||
| "type": "AVMUint64" | ||
| }, | ||
| "DELETABLE": { | ||
| "type": "AVMUint64" | ||
| } | ||
| } | ||
| } |
18 changes: 18 additions & 0 deletions
18
crates/algokit_test_artifacts/contracts/abi-create-and-delete/contract.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| from algopy import ARC4Contract, arc4, gtxn, TemplateVar, UInt64, String | ||
|
|
||
|
|
||
| class application(ARC4Contract): | ||
| @arc4.abimethod(create="require") | ||
| def create(self, pay_txn: gtxn.PaymentTransaction) -> String: | ||
| """Create the application""" | ||
| return String("created") | ||
|
|
||
| @arc4.baremethod(allow_actions=["UpdateApplication"]) | ||
| def update(self) -> None: | ||
| assert TemplateVar[bool]("UPDATABLE") | ||
|
|
||
| @arc4.abimethod(allow_actions=["DeleteApplication"]) | ||
| def delete(self, pay_txn: gtxn.PaymentTransaction) -> String: | ||
| """Delete the application""" | ||
| assert TemplateVar[UInt64]("DELETABLE") | ||
| return String("deleted") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 method was moved from
utils.rsto here. I also refactor it a bit so thatextract_logic_error_datadoesn't need to be called twice.