-
Notifications
You must be signed in to change notification settings - Fork 65
starknet_os_flow_tests: migrate test_deprecated_tx_info #9525
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
starknet_os_flow_tests: migrate test_deprecated_tx_info #9525
Conversation
37bc0f5 to
ecd96d8
Compare
3439f71 to
f5f799d
Compare
ecd96d8 to
7c79c67
Compare
f5f799d to
0885c59
Compare
7c79c67 to
e550ab8
Compare
0885c59 to
cebdf7a
Compare
e550ab8 to
e8347e7
Compare
cebdf7a to
500ef05
Compare
e8347e7 to
18ced25
Compare
500ef05 to
16c98a3
Compare
18ced25 to
41b8174
Compare
16c98a3 to
fa08c78
Compare
41b8174 to
7931da2
Compare
4bcc172 to
23150bc
Compare
7f9f6b6 to
3802aa6
Compare
23150bc to
192867e
Compare
3802aa6 to
c657f60
Compare
192867e to
517c832
Compare
c657f60 to
eab25e1
Compare
eab25e1 to
12da053
Compare
517c832 to
a889042
Compare
12da053 to
07c78ec
Compare
a889042 to
8ab3dc7
Compare
rotem-starkware
left a comment
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.
@rotem-starkware reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @AvivYossef-starkware, @meship-starkware, and @Yoni-Starkware)
crates/starknet_os_flow_tests/src/tests.rs line 1624 at r1 (raw file):
let tx_info_writer = FeatureContract::TxInfoWriter; let class_hash = get_class_hash_of_feature_contract(tx_info_writer); // Initialize the test manager with the tx info writer already declared.
When it's declared?
crates/starknet_os_flow_tests/src/tests.rs line 1625 at r1 (raw file):
let class_hash = get_class_hash_of_feature_contract(tx_info_writer); // Initialize the test manager with the tx info writer already declared. // We can ignore the address of the dpeloyed instance.
// We can ignore the address of the deployed instance.
Code quote:
// We can ignore the address of the dpeloyed instance.crates/starknet_os_flow_tests/src/tests.rs line 1727 at r1 (raw file):
Transaction::Account(AccountTransaction::Declare(declare_tx)), Transaction::L1Handler(l1_handler_tx), ] {
IIUC in the python test we check also the first declare tx (of the contract) and the fund tx.
Is it not required?
crates/starknet_os_flow_tests/src/tests.rs line 1749 at r1 (raw file):
contract_storage_updates .insert(get_storage_var_address("version", tx_type), Felt::ZERO); }
I think the inverse condition is more readable:
if matches!(tx.tx_type(), TransactionType::L1Handler) {
contract_storage_updates
.insert(get_storage_var_address("version", tx_type), Felt::ZERO);
} else {
contract_storage_updates
.insert(get_storage_var_address("version", tx_type), tx.version().0);
}
Code quote:
if !matches!(tx.tx_type(), TransactionType::L1Handler) {
contract_storage_updates
.insert(get_storage_var_address("version", tx_type), tx.version().0);
} else {
contract_storage_updates
.insert(get_storage_var_address("version", tx_type), Felt::ZERO);
}crates/starknet_os_flow_tests/src/tests.rs line 1767 at r1 (raw file):
); test_output.assert_account_balance_change(tx_info_account_address); test_output.assert_account_balance_change(contract_address!(TEST_SEQUENCER_ADDRESS));
Do we need to check that the account balance of the funding account changed?
dorimedini-starkware
left a comment
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 1 files reviewed, 4 unresolved discussions (waiting on @AvivYossef-starkware, @meship-starkware, @rotem-starkware, and @Yoni-Starkware)
crates/starknet_os_flow_tests/src/tests.rs line 1624 at r1 (raw file):
Previously, rotem-starkware wrote…
When it's declared?
when calling new_with_default_initial_state, you can pass contracts you want to (declare and) deploy as part of the initial state. that's what I mean: I declare and deploy the tx info writer, but I ignore the deployed instance and deploy again as part ofthe OS flow test (the initial state does not get proven by the OS).
crates/starknet_os_flow_tests/src/tests.rs line 1625 at r1 (raw file):
Previously, rotem-starkware wrote…
// We can ignore the address of the deployed instance.
Done.
crates/starknet_os_flow_tests/src/tests.rs line 1727 at r1 (raw file):
Previously, rotem-starkware wrote…
IIUC in the python test we check also the first declare tx (of the contract) and the fund tx.
Is it not required?
the contract is not declared in this block.
if this contract was special (in the sense that it would be interesting to see that the OS can process it's declare tx), then I would say it's important to run it in the block, but it doesn't have any special syscalls or anything
crates/starknet_os_flow_tests/src/tests.rs line 1749 at r1 (raw file):
Previously, rotem-starkware wrote…
I think the inverse condition is more readable:
if matches!(tx.tx_type(), TransactionType::L1Handler) { contract_storage_updates .insert(get_storage_var_address("version", tx_type), Felt::ZERO); } else { contract_storage_updates .insert(get_storage_var_address("version", tx_type), tx.version().0); }
done (and removed some duplication while i'm there)
crates/starknet_os_flow_tests/src/tests.rs line 1767 at r1 (raw file):
Previously, rotem-starkware wrote…
Do we need to check that the account balance of the funding account changed?
Done.
8ab3dc7 to
b561061
Compare
rotem-starkware
left a comment
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.
@rotem-starkware reviewed 1 of 1 files at r2, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @AvivYossef-starkware, @meship-starkware, and @Yoni-Starkware)
b8947e1

No description provided.