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.
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
feat(sozo): support multicall for execute command #2897
feat(sozo): support multicall for execute command #2897
Changes from 1 commit
ad1ce8b
09b00d1
01aad32
6101109
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
May be more natural to have the calldata separated from the two first arguments.
Starkli is doing that: https://github.com/xJonathanLEI/starkli/blob/4c92ac0ee3c8a50289b09760ec535cf27dd64b2c/src/subcommands/invoke.rs#L62
Wondering what could be best to have something easy to use, wdyt on that?
Check warning on line 80 in bin/sozo/src/commands/execute.rs
Codecov / codecov/patch
bin/sozo/src/commands/execute.rs#L80
Check warning on line 126 in bin/sozo/src/commands/execute.rs
Codecov / codecov/patch
bin/sozo/src/commands/execute.rs#L119-L126
Check warning on line 133 in bin/sozo/src/commands/execute.rs
Codecov / codecov/patch
bin/sozo/src/commands/execute.rs#L133
Check warning on line 137 in bin/sozo/src/commands/execute.rs
Codecov / codecov/patch
bin/sozo/src/commands/execute.rs#L135-L137
Check warning on line 141 in bin/sozo/src/commands/execute.rs
Codecov / codecov/patch
bin/sozo/src/commands/execute.rs#L139-L141
Check warning on line 143 in bin/sozo/src/commands/execute.rs
Codecov / codecov/patch
bin/sozo/src/commands/execute.rs#L143
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.
🛠️ Refactor suggestion
Ohayo, sensei! Handle
ResourceDescriptor::Name
variant to prevent runtime panicsUsing
unimplemented!()
in the match arm forResourceDescriptor::Name(_)
will cause a runtime panic if this case is encountered. Consider implementing proper error handling for this variant to prevent unexpected panics.Apply this diff to handle the
Name
variant gracefully:Check warning on line 156 in bin/sozo/src/commands/execute.rs
Codecov / codecov/patch
bin/sozo/src/commands/execute.rs#L147-L156
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.
Ohayo, sensei! Fix the error message condition to display the suggestion correctly
Currently, the error message suggests running the command again with
--diff
whenself.diff
istrue
. However, ifself.diff
is alreadytrue
, the suggestion is redundant. The condition should be inverted to check whenself.diff
isfalse
.Apply this diff to fix the condition:
📝 Committable suggestion
Check warning on line 158 in bin/sozo/src/commands/execute.rs
Codecov / codecov/patch
bin/sozo/src/commands/execute.rs#L158
Check warning on line 162 in bin/sozo/src/commands/execute.rs
Codecov / codecov/patch
bin/sozo/src/commands/execute.rs#L162
Check warning on line 168 in bin/sozo/src/commands/execute.rs
Codecov / codecov/patch
bin/sozo/src/commands/execute.rs#L165-L168
Check warning on line 172 in bin/sozo/src/commands/execute.rs
Codecov / codecov/patch
bin/sozo/src/commands/execute.rs#L172
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.
🛠️ Refactor suggestion
Ohayo, sensei! Add transaction size validation
Before executing the multicall, validate the total transaction size.