-
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: move transaction creator test util to starknet api #661
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 #661 +/- ##
==========================================
+ Coverage 75.83% 75.89% +0.05%
==========================================
Files 352 88 -264
Lines 37423 10935 -26488
Branches 37423 10935 -26488
==========================================
- Hits 28381 8299 -20082
+ Misses 6726 2227 -4499
+ Partials 2316 409 -1907 ☔ View full report in Codecov by Sentry. |
c065019
to
ce2991d
Compare
eb8f791
to
e4ee8b9
Compare
ce2991d
to
aa4e955
Compare
e4ee8b9
to
c275fa8
Compare
aa4e955
to
3999ccf
Compare
c275fa8
to
4cc1b61
Compare
3999ccf
to
a605f67
Compare
4cc1b61
to
dc513ca
Compare
a605f67
to
d801238
Compare
dc513ca
to
e8fedb6
Compare
d801238
to
8d55175
Compare
e8fedb6
to
62b383e
Compare
8d55175
to
53ca21d
Compare
62b383e
to
2230b5b
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 7 of 24 files at r1, 17 of 17 files at r3, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @ArniStarkware and @dafnamatsry)
crates/blockifier/src/test_utils/declare.rs
line 23 at r3 (raw file):
#[derive(Clone)] pub struct DeclareTxArgs {
I assume no code changes.
You're only moving the code, right?
Code quote:
pub struct DeclareTxArgs {
crates/blockifier/src/test_utils/invoke.rs
line 11 at r3 (raw file):
let only_query = invoke_args.only_query; // TODO: Make TransactionVersion an enum and use match here. let invoke_tx = if invoke_args.version == TransactionVersion::ZERO {
Could you please explain why you kept this code here instead of moving it to sn-api
and simply calling the create
function from there?
crates/starknet_api/src/test_utils.rs
line 8 at r3 (raw file):
// TODO: Default testing bounds should probably be AllResourceBounds variant. pub fn default_testing_resource_bounds() -> ValidResourceBounds {
Maybe it can be in the same file of ValidResourceBound
struct.
Code quote:
default_testing_resource_bounds(
53ca21d
to
b725862
Compare
2230b5b
to
f186001
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: 15 of 25 files reviewed, 2 unresolved discussions (waiting on @dafnamatsry and @MohammadNassar1)
crates/blockifier/src/test_utils/declare.rs
line 23 at r3 (raw file):
Previously, MohammadNassar1 (mohammad-starkware) wrote…
I assume no code changes.
You're only moving the code, right?
Indeed.
crates/blockifier/src/test_utils/invoke.rs
line 11 at r3 (raw file):
Previously, MohammadNassar1 (mohammad-starkware) wrote…
Could you please explain why you kept this code here instead of moving it to
sn-api
and simply calling thecreate
function from there?
Explanation: The function selector_from_name
is from the blockifier
crate.
I did not look much into moving it into the shared test util.
(note - selector_from_name(EXECUTE_ENTRY_POINT_NAME)
is just a constant number).
On the other hand, v0 will be deleted anyway - so I did not want to work hard to support it.
crates/starknet_api/src/test_utils.rs
line 8 at r3 (raw file):
Previously, MohammadNassar1 (mohammad-starkware) wrote…
Maybe it can be in the same file of
ValidResourceBound
struct.
Done.
Benchmark movements: |
b725862
to
4da7b0c
Compare
f186001
to
24a0fc8
Compare
Benchmark movements: |
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 4 of 10 files at r4, 5 of 5 files at r5, all commit messages.
Reviewable status: 24 of 25 files reviewed, 1 unresolved discussion (waiting on @ArniStarkware and @dafnamatsry)
crates/starknet_api/src/test_utils.rs
line 3 at r5 (raw file):
pub mod declare; pub mod deploy_account; pub mod invoke;
Why you define the modules here, and not in lib file?
Code quote:
pub mod declare;
pub mod deploy_account;
pub mod invoke;
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: 24 of 25 files reviewed, 1 unresolved discussion (waiting on @dafnamatsry and @MohammadNassar1)
crates/starknet_api/src/test_utils.rs
line 3 at r5 (raw file):
Previously, MohammadNassar1 (mohammad-starkware) wrote…
Why you define the modules here, and not in lib file?
I copied the folder/file structure from blockifier's test utils.
It is nice that the lib file points to the public-facing test_utils.rs
, and here - it points to the inner workings of the util. also we don't have to decorate everything with: #[cfg(any(feature = "testing", test))]
- but only once.
123df51
to
77656be
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 10 files at r4, 1 of 1 files at r6, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @dafnamatsry)
Merge activity
|
77656be
to
6b965ef
Compare
This is a step towards addressing the issue in: #519.
This change is