-
Notifications
You must be signed in to change notification settings - Fork 21
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
chore: split the inner tx creator in blockifier test utils #660
chore: split the inner tx creator in blockifier test utils #660
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @ArniStarkware and the rest of your teammates on Graphite |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #660 +/- ##
==========================================
- Coverage 75.83% 71.05% -4.79%
==========================================
Files 352 85 -267
Lines 37423 10944 -26479
Branches 37423 10944 -26479
==========================================
- Hits 28381 7776 -20605
+ Misses 6726 2780 -3946
+ Partials 2316 388 -1928 ☔ View full report in Codecov by Sentry. |
ce2991d
to
aa4e955
Compare
aa4e955
to
3999ccf
Compare
a605f67
to
d801238
Compare
d801238
to
8d55175
Compare
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.
Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ArniStarkware)
crates/blockifier/src/test_utils/declare.rs
line 78 at r1 (raw file):
} fn inner_declare_tx(
Please change the order of the functions.
First, public methods, then private functions.
Also relevant for the below files.
Code quote:
fn inner_declare_tx(
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.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ArniStarkware)
crates/blockifier/src/test_utils/declare.rs
line 78 at r1 (raw file):
Previously, MohammadNassar1 (mohammad-starkware) wrote…
Please change the order of the functions.
First, public methods, then private functions.Also relevant for the below files.
If you plan to move this function to the sn-api crate, there is no need to reorder them in this PR.
8d55175
to
53ca21d
Compare
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.
Reviewable status: 0 of 3 files reviewed, all discussions resolved (waiting on @MohammadNassar1)
crates/blockifier/src/test_utils/declare.rs
line 78 at r1 (raw file):
Previously, MohammadNassar1 (mohammad-starkware) wrote…
If you plan to move this function to the sn-api crate, there is no need to reorder them in this PR.
already done :) but TY!
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.
Reviewed 3 of 3 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ArniStarkware)
crates/blockifier/src/test_utils/invoke.rs
line 83 at r2 (raw file):
let default_tx_hash = TransactionHash::default(); match only_query {
No need for additional variable.
Suggestion:
let invoke_tx = inner_invoke_tx(invoke_args);
let default_tx_hash = TransactionHash::default();
match invoke_args.only_query {
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.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @ArniStarkware)
crates/blockifier/src/test_utils/deploy_account.rs
line 88 at r2 (raw file):
let tx = inner_deploy_account_tx(deploy_tx_args, nonce_manager.next(contract_address)); DeployAccountTransaction::new(tx, TransactionHash::default(), contract_address)
Do you know why the invoke
and deploy account
do not have a tx hash field, while declare
does?
Code quote:
TransactionHash::default()
53ca21d
to
b725862
Compare
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.
Reviewable status: 0 of 3 files reviewed, all discussions resolved (waiting on @MohammadNassar1)
crates/blockifier/src/test_utils/deploy_account.rs
line 88 at r2 (raw file):
Previously, MohammadNassar1 (mohammad-starkware) wrote…
Do you know why the
invoke
anddeploy account
do not have a tx hash field, whiledeclare
does?
I don't know. Let us keep the option available and streamline the util across tx types.
I did not find why this util is used in declare - I see no instance of it's use (I deleted it and the blockifier's tests passed).
crates/blockifier/src/test_utils/invoke.rs
line 83 at r2 (raw file):
Previously, MohammadNassar1 (mohammad-starkware) wrote…
No need for additional variable.
Your suggestion yields this error.
error[E0382]: use of moved value: `invoke_args`
--> crates/blockifier/src/test_utils/invoke.rs:82:5
|
78 | pub fn invoke_tx(invoke_args: InvokeTxArgs) -> InvokeTransaction {
| ----------- move occurs because `invoke_args` has type `test_utils::invoke::InvokeTxArgs`, which does not implement the `Copy` trait
79 | let invoke_tx = inner_invoke_tx(invoke_args);
| ----------- value moved here
...
82 | match invoke_args.only_query {
#rust_things #blessed.
b725862
to
4da7b0c
Compare
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.
Reviewed 1 of 3 files at r3, 2 of 2 files at r4, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @ArniStarkware)
crates/blockifier/src/test_utils/invoke.rs
line 83 at r2 (raw file):
Previously, ArniStarkware (Arnon Hod) wrote…
Your suggestion yields this error.
error[E0382]: use of moved value: `invoke_args` --> crates/blockifier/src/test_utils/invoke.rs:82:5 | 78 | pub fn invoke_tx(invoke_args: InvokeTxArgs) -> InvokeTransaction { | ----------- move occurs because `invoke_args` has type `test_utils::invoke::InvokeTxArgs`, which does not implement the `Copy` trait 79 | let invoke_tx = inner_invoke_tx(invoke_args); | ----------- value moved here ... 82 | match invoke_args.only_query {
#rust_things #blessed.
OMG
Merge activity
|
This change is