-
Notifications
You must be signed in to change notification settings - Fork 26
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(starknet_api): move transaction constants to snapi #2104
Conversation
Artifacts upload triggered. View details here |
Artifacts upload triggered. View details here |
d4c55e7
to
8fa9411
Compare
Artifacts upload triggered. View details here |
8fa9411
to
fa4cc11
Compare
Artifacts upload triggered. View details here |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2104 +/- ##
===========================================
+ Coverage 40.10% 77.34% +37.23%
===========================================
Files 26 105 +79
Lines 1895 13818 +11923
Branches 1895 13818 +11923
===========================================
+ Hits 760 10687 +9927
- Misses 1100 2672 +1572
- Partials 35 459 +424 ☔ View full report in Codecov by Sentry. |
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 15 files reviewed, all discussions resolved (waiting on @ayeletstarkware and @MohammadNassar1)
crates/starknet_api/src/transaction/constants.rs
line 8 at r1 (raw file):
pub const DEPLOY_CONTRACT_FUNCTION_ENTRY_POINT_NAME: &str = "deploy_contract"; pub const TRANSFER_EVENT_NAME: &str = "Transfer";
We need at least EXECUTE_ENTRY_POINT_NAME
in #2106, but all of these entry-point names sound just as useful.
Code quote:
pub const EXECUTE_ENTRY_POINT_NAME: &str = "__execute__";
pub const TRANSFER_ENTRY_POINT_NAME: &str = "transfer";
pub const VALIDATE_ENTRY_POINT_NAME: &str = "__validate__";
pub const VALIDATE_DECLARE_ENTRY_POINT_NAME: &str = "__validate_declare__";
pub const VALIDATE_DEPLOY_ENTRY_POINT_NAME: &str = "__validate_deploy__";
pub const DEPLOY_CONTRACT_FUNCTION_ENTRY_POINT_NAME: &str = "deploy_contract";
pub const TRANSFER_EVENT_NAME: &str = "Transfer";
crates/starknet_api/src/transaction/constants.rs
line 12 at r1 (raw file):
// Cairo constants. pub const FELT_FALSE: u64 = 0; pub const FELT_TRUE: u64 = 1;
These are only used in tests for now. Seems generally useful (Maybe we should even make it a property of Felt?)
Code quote:
// Cairo constants.
pub const FELT_FALSE: u64 = 0;
pub const FELT_TRUE: u64 = 1;
crates/starknet_api/src/transaction/constants.rs
line 15 at r1 (raw file):
// Expected return value of a `validate` entry point: `VALID`. pub const VALIDATE_RETDATA: &str = "0x56414c4944";
Seems generally useful.
Code quote:
// Expected return value of a `validate` entry point: `VALID`.
pub const VALIDATE_RETDATA: &str = "0x56414c4944";
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.
Are these constants going to be used outside of blockifier?
Reviewed 15 of 15 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ArniStarkware and @MohammadNassar1)
crates/blockifier/src/abi/abi_utils_test.rs
line 6 at r1 (raw file):
use crate::abi::abi_utils::selector_from_name; use crate::abi::constants as abi_constants;
Is this going to be used outside of blockifier? perhaps this should be moved as well
Code quote:
abi_constants
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.
Yes, at least the first constant in #2106.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @MohammadNassar1)
crates/blockifier/src/abi/abi_utils_test.rs
line 6 at r1 (raw file):
Previously, ayeletstarkware (Ayelet Zilber) wrote…
Is this going to be used outside of blockifier? perhaps this should be moved as well
Yes! This is what #2105 is all about.
crates/starknet_api/src/transaction/constants.rs
line 8 at r1 (raw file):
Previously, ArniStarkware (Arnon Hod) wrote…
We need at least
EXECUTE_ENTRY_POINT_NAME
in #2106, but all of these entry-point names sound just as useful.
@ayeletstarkware, you asked if these constants would be used outside of the blockifier crate.
Yes, at least the first constant in #2106.
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 all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @ArniStarkware)
In this PR we move the file
transaction/constants.rs
fromblockifier
tostarknet_api
(and only that).