-
Notifications
You must be signed in to change notification settings - Fork 66
starknet_os_flow_tests: add control for expected reverting txs #9480
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
base: 09-30-starknet_os_flow_tests_migrate_test_reverted_l1_handler_tx
Are you sure you want to change the base?
Conversation
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 @amosStarkware and @TzahiTaub)
crates/starknet_os_flow_tests/src/tests.rs
line 273 at r1 (raw file):
sender_address: *FUNDED_ACCOUNT_ADDRESS, nonce: nonce_manager.next(*FUNDED_ACCOUNT_ADDRESS), calldata: create_calldata(test_contract_address, "write_and_revert", &[Felt::ONE, Felt::TWO]),
was previously reverted, but for the wrong reason (missing params)
Code quote:
&[Felt::ONE, Felt::TWO]
0a931fa
to
923885c
Compare
fc8c397
to
8611c44
Compare
923885c
to
57fc21d
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.
@TzahiTaub reviewed 1 of 1 files at r2, 2 of 2 files at r3, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @amosStarkware)
crates/starknet_os_flow_tests/src/test_manager.rs
line 94 at r3 (raw file):
tx: BlockifierTransaction, revert_reason: Option<String>, }
Just to ask, do you think the optional field is better than having an enum for the entire tx? With something like this pseudo?
Suggestion:
pub(crate) enum FlowTestTx {
succesful/accepted({tx: BlockifierTransaction})
reverted({
tx: BlockifierTransaction,
revert_reason: String}
}
crates/starknet_os_flow_tests/src/test_manager.rs
line 445 at r3 (raw file):
fn verify_execution_outputs( revert_reasons: &[Option<String>], execution_outputs: &[(TransactionExecutionInfo, StateMaps)],
Please verify that both slices are of the same length
Code quote:
revert_reasons: &[Option<String>],
execution_outputs: &[(TransactionExecutionInfo, StateMaps)],
crates/starknet_os_flow_tests/src/test_manager.rs
line 529 at r3 (raw file):
.into_iter() .map(|flow_test_tx| (flow_test_tx.tx, flow_test_tx.revert_reason)) .unzip();
Suggestion:
let (block_txs, revert_reasons): (Vec<_>, Vec<_>) = block_txs_with_reason
.into_iter()
.map(|flow_test_tx| (flow_test_tx.tx, flow_test_tx.revert_reason))
.unzip();
// Clone the block info for later use.
8611c44
to
4991eb5
Compare
57fc21d
to
1178d98
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: 1 of 3 files reviewed, 2 unresolved discussions (waiting on @amosStarkware and @TzahiTaub)
crates/starknet_os_flow_tests/src/test_manager.rs
line 94 at r3 (raw file):
Previously, TzahiTaub (Tzahi) wrote…
Just to ask, do you think the optional field is better than having an enum for the entire tx? With something like this pseudo?
PTAL - refactored at the top of this stack.
not sure it is better, LMK what you think?
crates/starknet_os_flow_tests/src/test_manager.rs
line 445 at r3 (raw file):
Previously, TzahiTaub (Tzahi) wrote…
Please verify that both slices are of the same length
Done.
crates/starknet_os_flow_tests/src/test_manager.rs
line 529 at r3 (raw file):
.into_iter() .map(|flow_test_tx| (flow_test_tx.tx, flow_test_tx.revert_reason)) .unzip();
Done.
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.
@TzahiTaub reviewed 2 of 2 files at r4, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @amosStarkware)
crates/starknet_os_flow_tests/src/test_manager.rs
line 94 at r3 (raw file):
Previously, dorimedini-starkware wrote…
PTAL - refactored at the top of this stack.
not sure it is better, LMK what you think?
Well, in the PR it just adds more code and doesn't seem to simplify things, so I guess leaving it as is is better.
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.
@AvivYossef-starkware reviewed 1 of 2 files at r3.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @amosStarkware)
crates/starknet_os_flow_tests/src/test_manager.rs
line 93 at r3 (raw file):
pub(crate) struct FlowTestTx { tx: BlockifierTransaction, revert_reason: Option<String>,
Suggestion:
expected_revert_reason: Option<String>
crates/starknet_os_flow_tests/src/test_manager.rs
line 333 at r3 (raw file):
&mut self, tx: DeclareTransaction, compiled_class_hash: CompiledClassHash,
Unrelated q:
What is this compiled_class_hash?
Cairo O contracts shouldn't have it.
Code quote:
compiled_class_hash: CompiledClassHash
No description provided.