-
Notifications
You must be signed in to change notification settings - Fork 28
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
test(starknet_api): use const for l1 handler tx version #2763
test(starknet_api): use const for l1 handler tx version #2763
Conversation
Artifacts upload workflows: |
8fbc491
to
3437855
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 7 files reviewed, 1 unresolved discussion (waiting on @ArniStarkware)
crates/starknet_api/src/transaction.rs
line 692 at r2 (raw file):
/// purposes. pub const VERSION: TransactionVersion = TransactionVersion::ZERO; }
WDYT?
This will
a) make its api consistent with the rest of the tx types which all use a getter
b) make it impossible to instantiate an l1 tx with an incorrect field (and communicate that fact better maybe)
Suggestion:
#[derive(Debug, Clone, Default, Eq, PartialEq, Hash, Deserialize, Serialize, PartialOrd, Ord)]
pub struct L1HandlerTransaction {
pub nonce: Nonce,
pub contract_address: ContractAddress,
pub entry_point_selector: EntryPointSelector,
pub calldata: Calldata,
}
impl L1HandlerTransaction {
/// The transaction version is considered 0 for L1-Handler transaction for hash calculation
/// purposes.
pub const VERSION: TransactionVersion = TransactionVersion::ZERO;
pub fn version(&self) -> TransactionVersion {
Self::VERSION
}
}
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 7 files reviewed, all discussions resolved (waiting on @giladchase)
crates/starknet_api/src/transaction.rs
line 692 at r2 (raw file):
Previously, giladchase wrote…
WDYT?
This will
a) make its api consistent with the rest of the tx types which all use a getter
b) make it impossible to instantiate an l1 tx with an incorrect field (and communicate that fact better maybe)
On a later PR.
I tried something similar. There is an issue with the serialization, etc.
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 7 files at r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @ArniStarkware)
crates/starknet_api/src/transaction.rs
line 692 at r2 (raw file):
Previously, ArniStarkware (Arnon Hod) wrote…
On a later PR.
I tried something similar. There is an issue with the serialization, etc.
🫠
No description provided.