From 7e00378748f6e1149e91a8caed93a0e965b0b9f9 Mon Sep 17 00:00:00 2001 From: Ethan Oroshiba Date: Fri, 6 Dec 2024 10:42:55 -0600 Subject: [PATCH] chore(core, sequencer): add names to all snapshot tests (#1690) ## Summary Added names to all snapshot tests which did not have them. ## Background If a certain test had multiple snapshot assertions, they would be named based on their ordering. Hence any reordering, removal, or addition of the snapshots would break the test, which should not be the case. This change aims to fix this problem as well as establish a best practice of naming snapshots moving forward. ## Changes - Added names to all snapshot tests and regenerated all snapshots not within Conductor (due to code freeze) ## Testing Passing all tests. ## Related Issues closes #1656 --- .../src/primitive/v1/asset/denom.rs | 8 +++--- ...nom__serde_impl__tests__ibc_prefixed.snap} | 0 ...erde_impl__tests__ibc_prefixed_denom.snap} | 0 ...m__serde_impl__tests__trace_prefixed.snap} | 0 ...de_impl__tests__trace_prefixed_denom.snap} | 0 crates/astria-core/src/primitive/v1/mod.rs | 4 +-- ...__tests__compat_bech32_non_m_address.snap} | 2 +- ...ive__v1__tests__main_bech32m_address.snap} | 2 +- ...l__genesis__v1__tests__genesis_state.snap} | 2 +- crates/astria-core/src/protocol/genesis/v1.rs | 2 +- ...__tests__ics20_transfer_deposit_memo.snap} | 3 +- ...s__ics20_withdrawal_from_rollup_memo.snap} | 3 +- crates/astria-core/src/protocol/memos/v1.rs | 4 +-- .../src/protocol/transaction/v1/mod.rs | 2 +- .../src/accounts/storage/keys.rs | 4 +-- ...s__storage__keys__tests__balance_key.snap} | 0 ...nts__storage__keys__tests__nonce_key.snap} | 0 .../src/address/storage/keys.rs | 4 +-- ...s__storage__keys__tests__base_prefix.snap} | 3 +- ...rage__keys__tests__ibc_compat_prefix.snap} | 3 +- ...reaking_changes__app_hash_at_genesis.snap} | 0 ...anges__app_hash_execute_every_action.snap} | 0 ...ing_changes__app_hash_finalize_block.snap} | 0 .../astria-sequencer/src/app/storage/keys.rs | 10 +++---- ...orage__keys__tests__block_height_key.snap} | 3 +- ...ge__keys__tests__block_timestamp_key.snap} | 3 +- ...__storage__keys__tests__chain_id_key.snap} | 3 +- ...ge__keys__tests__revision_number_key.snap} | 3 +- ...ge__keys__tests__storage_version_key.snap} | 1 - .../src/app/tests_breaking_changes.rs | 6 ++-- .../src/assets/storage/keys.rs | 4 +-- ...e__keys__tests__asset_key_test_asset.snap} | 1 - ...orage__keys__tests__native_asset_key.snap} | 3 +- .../src/authority/storage/keys.rs | 6 ++-- ...orage__keys__tests__sudo_address_key.snap} | 3 +- ...rage__keys__tests__validator_set_key.snap} | 3 +- ...__keys__tests__validator_updates_key.snap} | 1 - .../src/bridge/storage/keys.rs | 28 +++++++++++++------ ...__storage__keys__tests__asset_id_key.snap} | 0 ...keys__tests__bridge_sudo_address_key.snap} | 0 ...__tests__bridge_withdrawal_event_key.snap} | 0 ...tests__bridge_withdrawer_address_key.snap} | 0 ...e__storage__keys__tests__deposit_key.snap} | 0 ..._keys__tests__ephemeral_deposits_key.snap} | 0 ...ests__last_tx_id_for_bridge_acct_key.snap} | 0 ..._storage__keys__tests__rollup_id_key.snap} | 0 .../astria-sequencer/src/grpc/storage/keys.rs | 21 ++++++++++---- ...eys__tests__block_hash_by_height_key.snap} | 1 - ...tests__rollup_data_by_has_and_id_key.snap} | 1 - ..._keys__tests__rollup_ids_by_hash_key.snap} | 1 - ...eys__tests__rollup_ids_proof_by_hash.snap} | 1 - ...ollup_transactions_proof_by_hash_key.snap} | 1 - ...__sequencer_block_header_by_hash_key.snap} | 1 - .../astria-sequencer/src/ibc/storage/keys.rs | 9 ++++-- ...ge__keys__tests__channel_balance_key.snap} | 0 ...torage__keys__tests__ibc_relayer_key.snap} | 0 ...__storage__keys__tests__ibc_sudo_key.snap} | 3 +- 57 files changed, 83 insertions(+), 80 deletions(-) rename crates/astria-core/src/primitive/v1/asset/snapshots/{astria_core__primitive__v1__asset__denom__serde_impl__tests__snapshots.snap => astria_core__primitive__v1__asset__denom__serde_impl__tests__ibc_prefixed.snap} (100%) rename crates/astria-core/src/primitive/v1/asset/snapshots/{astria_core__primitive__v1__asset__denom__serde_impl__tests__snapshots-3.snap => astria_core__primitive__v1__asset__denom__serde_impl__tests__ibc_prefixed_denom.snap} (100%) rename crates/astria-core/src/primitive/v1/asset/snapshots/{astria_core__primitive__v1__asset__denom__serde_impl__tests__snapshots-2.snap => astria_core__primitive__v1__asset__denom__serde_impl__tests__trace_prefixed.snap} (100%) rename crates/astria-core/src/primitive/v1/asset/snapshots/{astria_core__primitive__v1__asset__denom__serde_impl__tests__snapshots-4.snap => astria_core__primitive__v1__asset__denom__serde_impl__tests__trace_prefixed_denom.snap} (100%) rename crates/astria-core/src/primitive/v1/snapshots/{astria_core__primitive__v1__tests__snapshots-2.snap => astria_core__primitive__v1__tests__compat_bech32_non_m_address.snap} (78%) rename crates/astria-core/src/primitive/v1/snapshots/{astria_core__primitive__v1__tests__snapshots.snap => astria_core__primitive__v1__tests__main_bech32m_address.snap} (77%) rename crates/astria-core/src/protocol/genesis/snapshots/{astria_core__protocol__genesis__v1__tests__genesis_state_is_unchanged.snap => astria_core__protocol__genesis__v1__tests__genesis_state.snap} (97%) rename crates/astria-core/src/protocol/memos/snapshots/{astria_core__protocol__memos__v1__tests__ics20_transfer_deposit_memo_snapshot.snap => astria_core__protocol__memos__v1__tests__ics20_transfer_deposit_memo.snap} (51%) rename crates/astria-core/src/protocol/memos/snapshots/{astria_core__protocol__memos__v1__tests__ics20_withdrawal_from_rollup_memo_snapshot.snap => astria_core__protocol__memos__v1__tests__ics20_withdrawal_from_rollup_memo.snap} (70%) rename crates/astria-sequencer/src/accounts/storage/snapshots/{astria_sequencer__accounts__storage__keys__tests__keys_should_not_change.snap => astria_sequencer__accounts__storage__keys__tests__balance_key.snap} (100%) rename crates/astria-sequencer/src/accounts/storage/snapshots/{astria_sequencer__accounts__storage__keys__tests__keys_should_not_change-2.snap => astria_sequencer__accounts__storage__keys__tests__nonce_key.snap} (100%) rename crates/astria-sequencer/src/address/storage/snapshots/{astria_sequencer__address__storage__keys__tests__keys_should_not_change.snap => astria_sequencer__address__storage__keys__tests__base_prefix.snap} (65%) rename crates/astria-sequencer/src/address/storage/snapshots/{astria_sequencer__address__storage__keys__tests__keys_should_not_change-2.snap => astria_sequencer__address__storage__keys__tests__ibc_compat_prefix.snap} (64%) rename crates/astria-sequencer/src/app/snapshots/{astria_sequencer__app__tests_breaking_changes__app_genesis_snapshot.snap => astria_sequencer__app__tests_breaking_changes__app_hash_at_genesis.snap} (100%) rename crates/astria-sequencer/src/app/snapshots/{astria_sequencer__app__tests_breaking_changes__app_execute_transaction_with_every_action_snapshot.snap => astria_sequencer__app__tests_breaking_changes__app_hash_execute_every_action.snap} (100%) rename crates/astria-sequencer/src/app/snapshots/{astria_sequencer__app__tests_breaking_changes__app_finalize_block_snapshot.snap => astria_sequencer__app__tests_breaking_changes__app_hash_finalize_block.snap} (100%) rename crates/astria-sequencer/src/app/storage/snapshots/{astria_sequencer__app__storage__keys__tests__keys_should_not_change-3.snap => astria_sequencer__app__storage__keys__tests__block_height_key.snap} (62%) rename crates/astria-sequencer/src/app/storage/snapshots/{astria_sequencer__app__storage__keys__tests__keys_should_not_change-4.snap => astria_sequencer__app__storage__keys__tests__block_timestamp_key.snap} (62%) rename crates/astria-sequencer/src/app/storage/snapshots/{astria_sequencer__app__storage__keys__tests__keys_should_not_change.snap => astria_sequencer__app__storage__keys__tests__chain_id_key.snap} (63%) rename crates/astria-sequencer/src/app/storage/snapshots/{astria_sequencer__app__storage__keys__tests__keys_should_not_change-2.snap => astria_sequencer__app__storage__keys__tests__revision_number_key.snap} (62%) rename crates/astria-sequencer/src/app/storage/snapshots/{astria_sequencer__app__storage__keys__tests__keys_should_not_change-5.snap => astria_sequencer__app__storage__keys__tests__storage_version_key.snap} (87%) rename crates/astria-sequencer/src/assets/storage/snapshots/{astria_sequencer__assets__storage__keys__tests__keys_should_not_change-2.snap => astria_sequencer__assets__storage__keys__tests__asset_key_test_asset.snap} (90%) rename crates/astria-sequencer/src/assets/storage/snapshots/{astria_sequencer__assets__storage__keys__tests__keys_should_not_change.snap => astria_sequencer__assets__storage__keys__tests__native_asset_key.snap} (64%) rename crates/astria-sequencer/src/authority/storage/snapshots/{astria_sequencer__authority__storage__keys__tests__keys_should_not_change.snap => astria_sequencer__authority__storage__keys__tests__sudo_address_key.snap} (63%) rename crates/astria-sequencer/src/authority/storage/snapshots/{astria_sequencer__authority__storage__keys__tests__keys_should_not_change-2.snap => astria_sequencer__authority__storage__keys__tests__validator_set_key.snap} (62%) rename crates/astria-sequencer/src/authority/storage/snapshots/{astria_sequencer__authority__storage__keys__tests__keys_should_not_change-3.snap => astria_sequencer__authority__storage__keys__tests__validator_updates_key.snap} (87%) rename crates/astria-sequencer/src/bridge/storage/snapshots/{astria_sequencer__bridge__storage__keys__tests__keys_should_not_change-3.snap => astria_sequencer__bridge__storage__keys__tests__asset_id_key.snap} (100%) rename crates/astria-sequencer/src/bridge/storage/snapshots/{astria_sequencer__bridge__storage__keys__tests__keys_should_not_change-4.snap => astria_sequencer__bridge__storage__keys__tests__bridge_sudo_address_key.snap} (100%) rename crates/astria-sequencer/src/bridge/storage/snapshots/{astria_sequencer__bridge__storage__keys__tests__keys_should_not_change-6.snap => astria_sequencer__bridge__storage__keys__tests__bridge_withdrawal_event_key.snap} (100%) rename crates/astria-sequencer/src/bridge/storage/snapshots/{astria_sequencer__bridge__storage__keys__tests__keys_should_not_change-5.snap => astria_sequencer__bridge__storage__keys__tests__bridge_withdrawer_address_key.snap} (100%) rename crates/astria-sequencer/src/bridge/storage/snapshots/{astria_sequencer__bridge__storage__keys__tests__keys_should_not_change-7.snap => astria_sequencer__bridge__storage__keys__tests__deposit_key.snap} (100%) rename crates/astria-sequencer/src/bridge/storage/snapshots/{astria_sequencer__bridge__storage__keys__tests__keys_should_not_change.snap => astria_sequencer__bridge__storage__keys__tests__ephemeral_deposits_key.snap} (100%) rename crates/astria-sequencer/src/bridge/storage/snapshots/{astria_sequencer__bridge__storage__keys__tests__keys_should_not_change-8.snap => astria_sequencer__bridge__storage__keys__tests__last_tx_id_for_bridge_acct_key.snap} (100%) rename crates/astria-sequencer/src/bridge/storage/snapshots/{astria_sequencer__bridge__storage__keys__tests__keys_should_not_change-2.snap => astria_sequencer__bridge__storage__keys__tests__rollup_id_key.snap} (100%) rename crates/astria-sequencer/src/grpc/storage/snapshots/{astria_sequencer__grpc__storage__keys__tests__keys_should_not_change.snap => astria_sequencer__grpc__storage__keys__tests__block_hash_by_height_key.snap} (86%) rename crates/astria-sequencer/src/grpc/storage/snapshots/{astria_sequencer__grpc__storage__keys__tests__keys_should_not_change-3.snap => astria_sequencer__grpc__storage__keys__tests__rollup_data_by_has_and_id_key.snap} (92%) rename crates/astria-sequencer/src/grpc/storage/snapshots/{astria_sequencer__grpc__storage__keys__tests__keys_should_not_change-4.snap => astria_sequencer__grpc__storage__keys__tests__rollup_ids_by_hash_key.snap} (89%) rename crates/astria-sequencer/src/grpc/storage/snapshots/{astria_sequencer__grpc__storage__keys__tests__keys_should_not_change-6.snap => astria_sequencer__grpc__storage__keys__tests__rollup_ids_proof_by_hash.snap} (90%) rename crates/astria-sequencer/src/grpc/storage/snapshots/{astria_sequencer__grpc__storage__keys__tests__keys_should_not_change-5.snap => astria_sequencer__grpc__storage__keys__tests__rollup_transactions_proof_by_hash_key.snap} (90%) rename crates/astria-sequencer/src/grpc/storage/snapshots/{astria_sequencer__grpc__storage__keys__tests__keys_should_not_change-2.snap => astria_sequencer__grpc__storage__keys__tests__sequencer_block_header_by_hash_key.snap} (90%) rename crates/astria-sequencer/src/ibc/storage/snapshots/{astria_sequencer__ibc__storage__keys__tests__keys_should_not_change-2.snap => astria_sequencer__ibc__storage__keys__tests__channel_balance_key.snap} (100%) rename crates/astria-sequencer/src/ibc/storage/snapshots/{astria_sequencer__ibc__storage__keys__tests__keys_should_not_change-3.snap => astria_sequencer__ibc__storage__keys__tests__ibc_relayer_key.snap} (100%) rename crates/astria-sequencer/src/ibc/storage/snapshots/{astria_sequencer__ibc__storage__keys__tests__keys_should_not_change.snap => astria_sequencer__ibc__storage__keys__tests__ibc_sudo_key.snap} (62%) diff --git a/crates/astria-core/src/primitive/v1/asset/denom.rs b/crates/astria-core/src/primitive/v1/asset/denom.rs index e28159fbc7..f85511bd54 100644 --- a/crates/astria-core/src/primitive/v1/asset/denom.rs +++ b/crates/astria-core/src/primitive/v1/asset/denom.rs @@ -792,10 +792,10 @@ mod serde_impl { } #[test] fn snapshots() { - insta::assert_json_snapshot!(ibc_prefixed()); - insta::assert_json_snapshot!(trace_prefixed()); - insta::assert_json_snapshot!(Denom::from(ibc_prefixed())); - insta::assert_json_snapshot!(Denom::from(trace_prefixed())); + insta::assert_json_snapshot!("ibc_prefixed", ibc_prefixed()); + insta::assert_json_snapshot!("trace_prefixed", trace_prefixed()); + insta::assert_json_snapshot!("ibc_prefixed_denom", Denom::from(ibc_prefixed())); + insta::assert_json_snapshot!("trace_prefixed_denom", Denom::from(trace_prefixed())); } } } diff --git a/crates/astria-core/src/primitive/v1/asset/snapshots/astria_core__primitive__v1__asset__denom__serde_impl__tests__snapshots.snap b/crates/astria-core/src/primitive/v1/asset/snapshots/astria_core__primitive__v1__asset__denom__serde_impl__tests__ibc_prefixed.snap similarity index 100% rename from crates/astria-core/src/primitive/v1/asset/snapshots/astria_core__primitive__v1__asset__denom__serde_impl__tests__snapshots.snap rename to crates/astria-core/src/primitive/v1/asset/snapshots/astria_core__primitive__v1__asset__denom__serde_impl__tests__ibc_prefixed.snap diff --git a/crates/astria-core/src/primitive/v1/asset/snapshots/astria_core__primitive__v1__asset__denom__serde_impl__tests__snapshots-3.snap b/crates/astria-core/src/primitive/v1/asset/snapshots/astria_core__primitive__v1__asset__denom__serde_impl__tests__ibc_prefixed_denom.snap similarity index 100% rename from crates/astria-core/src/primitive/v1/asset/snapshots/astria_core__primitive__v1__asset__denom__serde_impl__tests__snapshots-3.snap rename to crates/astria-core/src/primitive/v1/asset/snapshots/astria_core__primitive__v1__asset__denom__serde_impl__tests__ibc_prefixed_denom.snap diff --git a/crates/astria-core/src/primitive/v1/asset/snapshots/astria_core__primitive__v1__asset__denom__serde_impl__tests__snapshots-2.snap b/crates/astria-core/src/primitive/v1/asset/snapshots/astria_core__primitive__v1__asset__denom__serde_impl__tests__trace_prefixed.snap similarity index 100% rename from crates/astria-core/src/primitive/v1/asset/snapshots/astria_core__primitive__v1__asset__denom__serde_impl__tests__snapshots-2.snap rename to crates/astria-core/src/primitive/v1/asset/snapshots/astria_core__primitive__v1__asset__denom__serde_impl__tests__trace_prefixed.snap diff --git a/crates/astria-core/src/primitive/v1/asset/snapshots/astria_core__primitive__v1__asset__denom__serde_impl__tests__snapshots-4.snap b/crates/astria-core/src/primitive/v1/asset/snapshots/astria_core__primitive__v1__asset__denom__serde_impl__tests__trace_prefixed_denom.snap similarity index 100% rename from crates/astria-core/src/primitive/v1/asset/snapshots/astria_core__primitive__v1__asset__denom__serde_impl__tests__snapshots-4.snap rename to crates/astria-core/src/primitive/v1/asset/snapshots/astria_core__primitive__v1__asset__denom__serde_impl__tests__trace_prefixed_denom.snap diff --git a/crates/astria-core/src/primitive/v1/mod.rs b/crates/astria-core/src/primitive/v1/mod.rs index 7477eac667..fe2279960f 100644 --- a/crates/astria-core/src/primitive/v1/mod.rs +++ b/crates/astria-core/src/primitive/v1/mod.rs @@ -410,7 +410,7 @@ mod tests { .prefix(ASTRIA_ADDRESS_PREFIX) .try_build() .unwrap(); - insta::assert_json_snapshot!(&main_address.to_raw()); + insta::assert_json_snapshot!("main_bech32m_address", &main_address.to_raw()); let compat_address = main_address .to_prefix(ASTRIA_COMPAT_ADDRESS_PREFIX) @@ -418,7 +418,7 @@ mod tests { .to_format::(); // We don't allow serializing non bech32m addresses due to // its impl via the protobuf type. - insta::assert_snapshot!(&compat_address); + insta::assert_snapshot!("compat_bech32_non_m_address", &compat_address); } #[test] diff --git a/crates/astria-core/src/primitive/v1/snapshots/astria_core__primitive__v1__tests__snapshots-2.snap b/crates/astria-core/src/primitive/v1/snapshots/astria_core__primitive__v1__tests__compat_bech32_non_m_address.snap similarity index 78% rename from crates/astria-core/src/primitive/v1/snapshots/astria_core__primitive__v1__tests__snapshots-2.snap rename to crates/astria-core/src/primitive/v1/snapshots/astria_core__primitive__v1__tests__compat_bech32_non_m_address.snap index afa9f15103..f8a198c53d 100644 --- a/crates/astria-core/src/primitive/v1/snapshots/astria_core__primitive__v1__tests__snapshots-2.snap +++ b/crates/astria-core/src/primitive/v1/snapshots/astria_core__primitive__v1__tests__compat_bech32_non_m_address.snap @@ -1,5 +1,5 @@ --- source: crates/astria-core/src/primitive/v1/mod.rs -expression: "&bech32_address" +expression: "&compat_address" --- astriacompat19g4z52329g4z52329g4z52329g4z52322jspvr diff --git a/crates/astria-core/src/primitive/v1/snapshots/astria_core__primitive__v1__tests__snapshots.snap b/crates/astria-core/src/primitive/v1/snapshots/astria_core__primitive__v1__tests__main_bech32m_address.snap similarity index 77% rename from crates/astria-core/src/primitive/v1/snapshots/astria_core__primitive__v1__tests__snapshots.snap rename to crates/astria-core/src/primitive/v1/snapshots/astria_core__primitive__v1__tests__main_bech32m_address.snap index 7aca827420..7de615818f 100644 --- a/crates/astria-core/src/primitive/v1/snapshots/astria_core__primitive__v1__tests__snapshots.snap +++ b/crates/astria-core/src/primitive/v1/snapshots/astria_core__primitive__v1__tests__main_bech32m_address.snap @@ -1,6 +1,6 @@ --- source: crates/astria-core/src/primitive/v1/mod.rs -expression: address +expression: "&main_address.to_raw()" --- { "bech32m": "astria19g4z52329g4z52329g4z52329g4z5232ayenag" diff --git a/crates/astria-core/src/protocol/genesis/snapshots/astria_core__protocol__genesis__v1__tests__genesis_state_is_unchanged.snap b/crates/astria-core/src/protocol/genesis/snapshots/astria_core__protocol__genesis__v1__tests__genesis_state.snap similarity index 97% rename from crates/astria-core/src/protocol/genesis/snapshots/astria_core__protocol__genesis__v1__tests__genesis_state_is_unchanged.snap rename to crates/astria-core/src/protocol/genesis/snapshots/astria_core__protocol__genesis__v1__tests__genesis_state.snap index 1949b88854..05a657196e 100644 --- a/crates/astria-core/src/protocol/genesis/snapshots/astria_core__protocol__genesis__v1__tests__genesis_state_is_unchanged.snap +++ b/crates/astria-core/src/protocol/genesis/snapshots/astria_core__protocol__genesis__v1__tests__genesis_state.snap @@ -1,5 +1,5 @@ --- -source: crates/astria-core/src/protocol/genesis/v1alpha1.rs +source: crates/astria-core/src/protocol/genesis/v1.rs expression: genesis_state() --- { diff --git a/crates/astria-core/src/protocol/genesis/v1.rs b/crates/astria-core/src/protocol/genesis/v1.rs index 168998a521..de177b1cc9 100644 --- a/crates/astria-core/src/protocol/genesis/v1.rs +++ b/crates/astria-core/src/protocol/genesis/v1.rs @@ -1046,6 +1046,6 @@ mod tests { #[cfg(feature = "serde")] #[test] fn genesis_state_is_unchanged() { - insta::assert_json_snapshot!(genesis_state()); + insta::assert_json_snapshot!("genesis_state", genesis_state()); } } diff --git a/crates/astria-core/src/protocol/memos/snapshots/astria_core__protocol__memos__v1__tests__ics20_transfer_deposit_memo_snapshot.snap b/crates/astria-core/src/protocol/memos/snapshots/astria_core__protocol__memos__v1__tests__ics20_transfer_deposit_memo.snap similarity index 51% rename from crates/astria-core/src/protocol/memos/snapshots/astria_core__protocol__memos__v1__tests__ics20_transfer_deposit_memo_snapshot.snap rename to crates/astria-core/src/protocol/memos/snapshots/astria_core__protocol__memos__v1__tests__ics20_transfer_deposit_memo.snap index b31b2f864d..0238893328 100644 --- a/crates/astria-core/src/protocol/memos/snapshots/astria_core__protocol__memos__v1__tests__ics20_transfer_deposit_memo_snapshot.snap +++ b/crates/astria-core/src/protocol/memos/snapshots/astria_core__protocol__memos__v1__tests__ics20_transfer_deposit_memo.snap @@ -1,6 +1,5 @@ --- -source: crates/astria-core/src/protocol/memos/v1alpha1.rs -assertion_line: 28 +source: crates/astria-core/src/protocol/memos/v1.rs expression: memo --- { diff --git a/crates/astria-core/src/protocol/memos/snapshots/astria_core__protocol__memos__v1__tests__ics20_withdrawal_from_rollup_memo_snapshot.snap b/crates/astria-core/src/protocol/memos/snapshots/astria_core__protocol__memos__v1__tests__ics20_withdrawal_from_rollup_memo.snap similarity index 70% rename from crates/astria-core/src/protocol/memos/snapshots/astria_core__protocol__memos__v1__tests__ics20_withdrawal_from_rollup_memo_snapshot.snap rename to crates/astria-core/src/protocol/memos/snapshots/astria_core__protocol__memos__v1__tests__ics20_withdrawal_from_rollup_memo.snap index d3f43f6eb0..4cd0482db4 100644 --- a/crates/astria-core/src/protocol/memos/snapshots/astria_core__protocol__memos__v1__tests__ics20_withdrawal_from_rollup_memo_snapshot.snap +++ b/crates/astria-core/src/protocol/memos/snapshots/astria_core__protocol__memos__v1__tests__ics20_withdrawal_from_rollup_memo.snap @@ -1,6 +1,5 @@ --- -source: crates/astria-core/src/protocol/memos/v1alpha1.rs -assertion_line: 19 +source: crates/astria-core/src/protocol/memos/v1.rs expression: memo --- { diff --git a/crates/astria-core/src/protocol/memos/v1.rs b/crates/astria-core/src/protocol/memos/v1.rs index 9e9aa76cf2..0fb031b3c0 100644 --- a/crates/astria-core/src/protocol/memos/v1.rs +++ b/crates/astria-core/src/protocol/memos/v1.rs @@ -16,7 +16,7 @@ mod tests { memo: "hello".to_string(), }; - insta::assert_json_snapshot!(memo); + insta::assert_json_snapshot!("ics20_withdrawal_from_rollup_memo", memo); } #[test] @@ -25,6 +25,6 @@ mod tests { rollup_deposit_address: "an-address-on-the-rollup".to_string(), }; - insta::assert_json_snapshot!(memo); + insta::assert_json_snapshot!("ics20_transfer_deposit_memo", memo); } } diff --git a/crates/astria-core/src/protocol/transaction/v1/mod.rs b/crates/astria-core/src/protocol/transaction/v1/mod.rs index 59616514d8..0f26b69b65 100644 --- a/crates/astria-core/src/protocol/transaction/v1/mod.rs +++ b/crates/astria-core/src/protocol/transaction/v1/mod.rs @@ -621,7 +621,7 @@ mod tests { body_bytes: body.to_raw().encode_to_vec().into(), }; - insta::assert_json_snapshot!(tx.id().to_raw()); + insta::assert_json_snapshot!("transaction_id", tx.id().to_raw()); } #[test] diff --git a/crates/astria-sequencer/src/accounts/storage/keys.rs b/crates/astria-sequencer/src/accounts/storage/keys.rs index ceb9f9c191..17669eabff 100644 --- a/crates/astria-sequencer/src/accounts/storage/keys.rs +++ b/crates/astria-sequencer/src/accounts/storage/keys.rs @@ -85,8 +85,8 @@ mod tests { #[test] fn keys_should_not_change() { - insta::assert_snapshot!(balance(&address(), &asset())); - insta::assert_snapshot!(nonce(&address())); + insta::assert_snapshot!("balance_key", balance(&address(), &asset())); + insta::assert_snapshot!("nonce_key", nonce(&address())); } #[test] diff --git a/crates/astria-sequencer/src/accounts/storage/snapshots/astria_sequencer__accounts__storage__keys__tests__keys_should_not_change.snap b/crates/astria-sequencer/src/accounts/storage/snapshots/astria_sequencer__accounts__storage__keys__tests__balance_key.snap similarity index 100% rename from crates/astria-sequencer/src/accounts/storage/snapshots/astria_sequencer__accounts__storage__keys__tests__keys_should_not_change.snap rename to crates/astria-sequencer/src/accounts/storage/snapshots/astria_sequencer__accounts__storage__keys__tests__balance_key.snap diff --git a/crates/astria-sequencer/src/accounts/storage/snapshots/astria_sequencer__accounts__storage__keys__tests__keys_should_not_change-2.snap b/crates/astria-sequencer/src/accounts/storage/snapshots/astria_sequencer__accounts__storage__keys__tests__nonce_key.snap similarity index 100% rename from crates/astria-sequencer/src/accounts/storage/snapshots/astria_sequencer__accounts__storage__keys__tests__keys_should_not_change-2.snap rename to crates/astria-sequencer/src/accounts/storage/snapshots/astria_sequencer__accounts__storage__keys__tests__nonce_key.snap diff --git a/crates/astria-sequencer/src/address/storage/keys.rs b/crates/astria-sequencer/src/address/storage/keys.rs index af58a1d79f..5e123af6d7 100644 --- a/crates/astria-sequencer/src/address/storage/keys.rs +++ b/crates/astria-sequencer/src/address/storage/keys.rs @@ -9,8 +9,8 @@ mod tests { #[test] fn keys_should_not_change() { - insta::assert_snapshot!(BASE_PREFIX); - insta::assert_snapshot!(IBC_COMPAT_PREFIX); + insta::assert_snapshot!("base_prefix", BASE_PREFIX); + insta::assert_snapshot!("ibc_compat_prefix", IBC_COMPAT_PREFIX); } #[test] diff --git a/crates/astria-sequencer/src/address/storage/snapshots/astria_sequencer__address__storage__keys__tests__keys_should_not_change.snap b/crates/astria-sequencer/src/address/storage/snapshots/astria_sequencer__address__storage__keys__tests__base_prefix.snap similarity index 65% rename from crates/astria-sequencer/src/address/storage/snapshots/astria_sequencer__address__storage__keys__tests__keys_should_not_change.snap rename to crates/astria-sequencer/src/address/storage/snapshots/astria_sequencer__address__storage__keys__tests__base_prefix.snap index d0121e06ae..7a479c085a 100644 --- a/crates/astria-sequencer/src/address/storage/snapshots/astria_sequencer__address__storage__keys__tests__keys_should_not_change.snap +++ b/crates/astria-sequencer/src/address/storage/snapshots/astria_sequencer__address__storage__keys__tests__base_prefix.snap @@ -1,6 +1,5 @@ --- source: crates/astria-sequencer/src/address/storage/keys.rs -assertion_line: 10 -expression: BASE_PREFIX_KEY +expression: BASE_PREFIX --- address/prefixes/base diff --git a/crates/astria-sequencer/src/address/storage/snapshots/astria_sequencer__address__storage__keys__tests__keys_should_not_change-2.snap b/crates/astria-sequencer/src/address/storage/snapshots/astria_sequencer__address__storage__keys__tests__ibc_compat_prefix.snap similarity index 64% rename from crates/astria-sequencer/src/address/storage/snapshots/astria_sequencer__address__storage__keys__tests__keys_should_not_change-2.snap rename to crates/astria-sequencer/src/address/storage/snapshots/astria_sequencer__address__storage__keys__tests__ibc_compat_prefix.snap index 78e5051afb..c9fec6073a 100644 --- a/crates/astria-sequencer/src/address/storage/snapshots/astria_sequencer__address__storage__keys__tests__keys_should_not_change-2.snap +++ b/crates/astria-sequencer/src/address/storage/snapshots/astria_sequencer__address__storage__keys__tests__ibc_compat_prefix.snap @@ -1,6 +1,5 @@ --- source: crates/astria-sequencer/src/address/storage/keys.rs -assertion_line: 11 -expression: IBC_COMPAT_PREFIX_KEY +expression: IBC_COMPAT_PREFIX --- address/prefixes/ibc_compat diff --git a/crates/astria-sequencer/src/app/snapshots/astria_sequencer__app__tests_breaking_changes__app_genesis_snapshot.snap b/crates/astria-sequencer/src/app/snapshots/astria_sequencer__app__tests_breaking_changes__app_hash_at_genesis.snap similarity index 100% rename from crates/astria-sequencer/src/app/snapshots/astria_sequencer__app__tests_breaking_changes__app_genesis_snapshot.snap rename to crates/astria-sequencer/src/app/snapshots/astria_sequencer__app__tests_breaking_changes__app_hash_at_genesis.snap diff --git a/crates/astria-sequencer/src/app/snapshots/astria_sequencer__app__tests_breaking_changes__app_execute_transaction_with_every_action_snapshot.snap b/crates/astria-sequencer/src/app/snapshots/astria_sequencer__app__tests_breaking_changes__app_hash_execute_every_action.snap similarity index 100% rename from crates/astria-sequencer/src/app/snapshots/astria_sequencer__app__tests_breaking_changes__app_execute_transaction_with_every_action_snapshot.snap rename to crates/astria-sequencer/src/app/snapshots/astria_sequencer__app__tests_breaking_changes__app_hash_execute_every_action.snap diff --git a/crates/astria-sequencer/src/app/snapshots/astria_sequencer__app__tests_breaking_changes__app_finalize_block_snapshot.snap b/crates/astria-sequencer/src/app/snapshots/astria_sequencer__app__tests_breaking_changes__app_hash_finalize_block.snap similarity index 100% rename from crates/astria-sequencer/src/app/snapshots/astria_sequencer__app__tests_breaking_changes__app_finalize_block_snapshot.snap rename to crates/astria-sequencer/src/app/snapshots/astria_sequencer__app__tests_breaking_changes__app_hash_finalize_block.snap diff --git a/crates/astria-sequencer/src/app/storage/keys.rs b/crates/astria-sequencer/src/app/storage/keys.rs index 564fab2cdf..8a1c1e51c8 100644 --- a/crates/astria-sequencer/src/app/storage/keys.rs +++ b/crates/astria-sequencer/src/app/storage/keys.rs @@ -15,11 +15,11 @@ mod tests { #[test] fn keys_should_not_change() { - insta::assert_snapshot!(CHAIN_ID); - insta::assert_snapshot!(REVISION_NUMBER); - insta::assert_snapshot!(BLOCK_HEIGHT); - insta::assert_snapshot!(BLOCK_TIMESTAMP); - insta::assert_snapshot!(storage_version_by_height(42)); + insta::assert_snapshot!("chain_id_key", CHAIN_ID); + insta::assert_snapshot!("revision_number_key", REVISION_NUMBER); + insta::assert_snapshot!("block_height_key", BLOCK_HEIGHT); + insta::assert_snapshot!("block_timestamp_key", BLOCK_TIMESTAMP); + insta::assert_snapshot!("storage_version_key", storage_version_by_height(42)); } #[test] diff --git a/crates/astria-sequencer/src/app/storage/snapshots/astria_sequencer__app__storage__keys__tests__keys_should_not_change-3.snap b/crates/astria-sequencer/src/app/storage/snapshots/astria_sequencer__app__storage__keys__tests__block_height_key.snap similarity index 62% rename from crates/astria-sequencer/src/app/storage/snapshots/astria_sequencer__app__storage__keys__tests__keys_should_not_change-3.snap rename to crates/astria-sequencer/src/app/storage/snapshots/astria_sequencer__app__storage__keys__tests__block_height_key.snap index 4c70738ab6..62ab7280cb 100644 --- a/crates/astria-sequencer/src/app/storage/snapshots/astria_sequencer__app__storage__keys__tests__keys_should_not_change-3.snap +++ b/crates/astria-sequencer/src/app/storage/snapshots/astria_sequencer__app__storage__keys__tests__block_height_key.snap @@ -1,6 +1,5 @@ --- source: crates/astria-sequencer/src/app/storage/keys.rs -assertion_line: 22 -expression: BLOCK_HEIGHT_KEY +expression: BLOCK_HEIGHT --- app/block_height diff --git a/crates/astria-sequencer/src/app/storage/snapshots/astria_sequencer__app__storage__keys__tests__keys_should_not_change-4.snap b/crates/astria-sequencer/src/app/storage/snapshots/astria_sequencer__app__storage__keys__tests__block_timestamp_key.snap similarity index 62% rename from crates/astria-sequencer/src/app/storage/snapshots/astria_sequencer__app__storage__keys__tests__keys_should_not_change-4.snap rename to crates/astria-sequencer/src/app/storage/snapshots/astria_sequencer__app__storage__keys__tests__block_timestamp_key.snap index ac8904c633..7ba8209205 100644 --- a/crates/astria-sequencer/src/app/storage/snapshots/astria_sequencer__app__storage__keys__tests__keys_should_not_change-4.snap +++ b/crates/astria-sequencer/src/app/storage/snapshots/astria_sequencer__app__storage__keys__tests__block_timestamp_key.snap @@ -1,6 +1,5 @@ --- source: crates/astria-sequencer/src/app/storage/keys.rs -assertion_line: 23 -expression: BLOCK_TIMESTAMP_KEY +expression: BLOCK_TIMESTAMP --- app/block_timestamp diff --git a/crates/astria-sequencer/src/app/storage/snapshots/astria_sequencer__app__storage__keys__tests__keys_should_not_change.snap b/crates/astria-sequencer/src/app/storage/snapshots/astria_sequencer__app__storage__keys__tests__chain_id_key.snap similarity index 63% rename from crates/astria-sequencer/src/app/storage/snapshots/astria_sequencer__app__storage__keys__tests__keys_should_not_change.snap rename to crates/astria-sequencer/src/app/storage/snapshots/astria_sequencer__app__storage__keys__tests__chain_id_key.snap index d90a517589..bc8b080ca2 100644 --- a/crates/astria-sequencer/src/app/storage/snapshots/astria_sequencer__app__storage__keys__tests__keys_should_not_change.snap +++ b/crates/astria-sequencer/src/app/storage/snapshots/astria_sequencer__app__storage__keys__tests__chain_id_key.snap @@ -1,6 +1,5 @@ --- source: crates/astria-sequencer/src/app/storage/keys.rs -assertion_line: 18 -expression: CHAIN_ID_KEY +expression: CHAIN_ID --- app/chain_id diff --git a/crates/astria-sequencer/src/app/storage/snapshots/astria_sequencer__app__storage__keys__tests__keys_should_not_change-2.snap b/crates/astria-sequencer/src/app/storage/snapshots/astria_sequencer__app__storage__keys__tests__revision_number_key.snap similarity index 62% rename from crates/astria-sequencer/src/app/storage/snapshots/astria_sequencer__app__storage__keys__tests__keys_should_not_change-2.snap rename to crates/astria-sequencer/src/app/storage/snapshots/astria_sequencer__app__storage__keys__tests__revision_number_key.snap index 5ef5391478..f6ca73a0b0 100644 --- a/crates/astria-sequencer/src/app/storage/snapshots/astria_sequencer__app__storage__keys__tests__keys_should_not_change-2.snap +++ b/crates/astria-sequencer/src/app/storage/snapshots/astria_sequencer__app__storage__keys__tests__revision_number_key.snap @@ -1,6 +1,5 @@ --- source: crates/astria-sequencer/src/app/storage/keys.rs -assertion_line: 21 -expression: REVISION_NUMBER_KEY +expression: REVISION_NUMBER --- app/revision_number diff --git a/crates/astria-sequencer/src/app/storage/snapshots/astria_sequencer__app__storage__keys__tests__keys_should_not_change-5.snap b/crates/astria-sequencer/src/app/storage/snapshots/astria_sequencer__app__storage__keys__tests__storage_version_key.snap similarity index 87% rename from crates/astria-sequencer/src/app/storage/snapshots/astria_sequencer__app__storage__keys__tests__keys_should_not_change-5.snap rename to crates/astria-sequencer/src/app/storage/snapshots/astria_sequencer__app__storage__keys__tests__storage_version_key.snap index 2129ee5473..84896aa427 100644 --- a/crates/astria-sequencer/src/app/storage/snapshots/astria_sequencer__app__storage__keys__tests__keys_should_not_change-5.snap +++ b/crates/astria-sequencer/src/app/storage/snapshots/astria_sequencer__app__storage__keys__tests__storage_version_key.snap @@ -1,6 +1,5 @@ --- source: crates/astria-sequencer/src/app/storage/keys.rs -assertion_line: 22 expression: storage_version_by_height(42) --- app/storage_version/42 diff --git a/crates/astria-sequencer/src/app/tests_breaking_changes.rs b/crates/astria-sequencer/src/app/tests_breaking_changes.rs index dd1c14c4d4..2118d41d4d 100644 --- a/crates/astria-sequencer/src/app/tests_breaking_changes.rs +++ b/crates/astria-sequencer/src/app/tests_breaking_changes.rs @@ -81,7 +81,7 @@ use crate::{ #[tokio::test] async fn app_genesis_snapshot() { let app = initialize_app(None, vec![]).await; - insta::assert_json_snapshot!(app.app_hash.as_bytes()); + insta::assert_json_snapshot!("app_hash_at_genesis", app.app_hash.as_bytes()); } #[tokio::test] @@ -161,7 +161,7 @@ async fn app_finalize_block_snapshot() { .await .unwrap(); app.commit(storage.clone()).await; - insta::assert_json_snapshot!(app.app_hash.as_bytes()); + insta::assert_json_snapshot!("app_hash_finalize_block", app.app_hash.as_bytes()); } // Note: this tests every action except for `Ics20Withdrawal` and `IbcRelay`. @@ -368,5 +368,5 @@ async fn app_execute_transaction_with_every_action_snapshot() { app.prepare_commit(storage.clone()).await.unwrap(); app.commit(storage.clone()).await; - insta::assert_json_snapshot!(app.app_hash.as_bytes()); + insta::assert_json_snapshot!("app_hash_execute_every_action", app.app_hash.as_bytes()); } diff --git a/crates/astria-sequencer/src/assets/storage/keys.rs b/crates/astria-sequencer/src/assets/storage/keys.rs index 4cfb588aad..69565beed8 100644 --- a/crates/astria-sequencer/src/assets/storage/keys.rs +++ b/crates/astria-sequencer/src/assets/storage/keys.rs @@ -29,8 +29,8 @@ mod tests { #[test] fn keys_should_not_change() { - insta::assert_snapshot!(NATIVE_ASSET); - insta::assert_snapshot!(asset(&test_asset())); + insta::assert_snapshot!("native_asset_key", NATIVE_ASSET); + insta::assert_snapshot!("asset_key_test_asset", asset(&test_asset())); } #[test] diff --git a/crates/astria-sequencer/src/assets/storage/snapshots/astria_sequencer__assets__storage__keys__tests__keys_should_not_change-2.snap b/crates/astria-sequencer/src/assets/storage/snapshots/astria_sequencer__assets__storage__keys__tests__asset_key_test_asset.snap similarity index 90% rename from crates/astria-sequencer/src/assets/storage/snapshots/astria_sequencer__assets__storage__keys__tests__keys_should_not_change-2.snap rename to crates/astria-sequencer/src/assets/storage/snapshots/astria_sequencer__assets__storage__keys__tests__asset_key_test_asset.snap index f2b86e3f42..7598ba14eb 100644 --- a/crates/astria-sequencer/src/assets/storage/snapshots/astria_sequencer__assets__storage__keys__tests__keys_should_not_change-2.snap +++ b/crates/astria-sequencer/src/assets/storage/snapshots/astria_sequencer__assets__storage__keys__tests__asset_key_test_asset.snap @@ -1,6 +1,5 @@ --- source: crates/astria-sequencer/src/assets/storage/keys.rs -assertion_line: 87 expression: asset(&test_asset()) --- assets/ibc/be429a02d00837245167a2616674a979a2ac6f9806468b48a975b156ad711320 diff --git a/crates/astria-sequencer/src/assets/storage/snapshots/astria_sequencer__assets__storage__keys__tests__keys_should_not_change.snap b/crates/astria-sequencer/src/assets/storage/snapshots/astria_sequencer__assets__storage__keys__tests__native_asset_key.snap similarity index 64% rename from crates/astria-sequencer/src/assets/storage/snapshots/astria_sequencer__assets__storage__keys__tests__keys_should_not_change.snap rename to crates/astria-sequencer/src/assets/storage/snapshots/astria_sequencer__assets__storage__keys__tests__native_asset_key.snap index b7c28d8f3f..137bad2b26 100644 --- a/crates/astria-sequencer/src/assets/storage/snapshots/astria_sequencer__assets__storage__keys__tests__keys_should_not_change.snap +++ b/crates/astria-sequencer/src/assets/storage/snapshots/astria_sequencer__assets__storage__keys__tests__native_asset_key.snap @@ -1,6 +1,5 @@ --- source: crates/astria-sequencer/src/assets/storage/keys.rs -assertion_line: 84 -expression: NATIVE_ASSET_KEY +expression: NATIVE_ASSET --- assets/native_asset diff --git a/crates/astria-sequencer/src/authority/storage/keys.rs b/crates/astria-sequencer/src/authority/storage/keys.rs index 0120a0b425..169185b357 100644 --- a/crates/astria-sequencer/src/authority/storage/keys.rs +++ b/crates/astria-sequencer/src/authority/storage/keys.rs @@ -10,9 +10,9 @@ mod tests { #[test] fn keys_should_not_change() { - insta::assert_snapshot!(SUDO); - insta::assert_snapshot!(VALIDATOR_SET); - insta::assert_snapshot!(VALIDATOR_UPDATES); + insta::assert_snapshot!("sudo_address_key", SUDO); + insta::assert_snapshot!("validator_set_key", VALIDATOR_SET); + insta::assert_snapshot!("validator_updates_key", VALIDATOR_UPDATES); } #[test] diff --git a/crates/astria-sequencer/src/authority/storage/snapshots/astria_sequencer__authority__storage__keys__tests__keys_should_not_change.snap b/crates/astria-sequencer/src/authority/storage/snapshots/astria_sequencer__authority__storage__keys__tests__sudo_address_key.snap similarity index 63% rename from crates/astria-sequencer/src/authority/storage/snapshots/astria_sequencer__authority__storage__keys__tests__keys_should_not_change.snap rename to crates/astria-sequencer/src/authority/storage/snapshots/astria_sequencer__authority__storage__keys__tests__sudo_address_key.snap index a046006094..5847837e58 100644 --- a/crates/astria-sequencer/src/authority/storage/snapshots/astria_sequencer__authority__storage__keys__tests__keys_should_not_change.snap +++ b/crates/astria-sequencer/src/authority/storage/snapshots/astria_sequencer__authority__storage__keys__tests__sudo_address_key.snap @@ -1,6 +1,5 @@ --- source: crates/astria-sequencer/src/authority/storage/keys.rs -assertion_line: 15 -expression: SUDO_STORAGE_KEY +expression: SUDO --- authority/sudo diff --git a/crates/astria-sequencer/src/authority/storage/snapshots/astria_sequencer__authority__storage__keys__tests__keys_should_not_change-2.snap b/crates/astria-sequencer/src/authority/storage/snapshots/astria_sequencer__authority__storage__keys__tests__validator_set_key.snap similarity index 62% rename from crates/astria-sequencer/src/authority/storage/snapshots/astria_sequencer__authority__storage__keys__tests__keys_should_not_change-2.snap rename to crates/astria-sequencer/src/authority/storage/snapshots/astria_sequencer__authority__storage__keys__tests__validator_set_key.snap index 2bbd4fa8d0..f8678c4090 100644 --- a/crates/astria-sequencer/src/authority/storage/snapshots/astria_sequencer__authority__storage__keys__tests__keys_should_not_change-2.snap +++ b/crates/astria-sequencer/src/authority/storage/snapshots/astria_sequencer__authority__storage__keys__tests__validator_set_key.snap @@ -1,6 +1,5 @@ --- source: crates/astria-sequencer/src/authority/storage/keys.rs -assertion_line: 16 -expression: VALIDATOR_SET_STORAGE_KEY +expression: VALIDATOR_SET --- authority/validator_set diff --git a/crates/astria-sequencer/src/authority/storage/snapshots/astria_sequencer__authority__storage__keys__tests__keys_should_not_change-3.snap b/crates/astria-sequencer/src/authority/storage/snapshots/astria_sequencer__authority__storage__keys__tests__validator_updates_key.snap similarity index 87% rename from crates/astria-sequencer/src/authority/storage/snapshots/astria_sequencer__authority__storage__keys__tests__keys_should_not_change-3.snap rename to crates/astria-sequencer/src/authority/storage/snapshots/astria_sequencer__authority__storage__keys__tests__validator_updates_key.snap index 1a0f29c99f..eca60bfd40 100644 --- a/crates/astria-sequencer/src/authority/storage/snapshots/astria_sequencer__authority__storage__keys__tests__keys_should_not_change-3.snap +++ b/crates/astria-sequencer/src/authority/storage/snapshots/astria_sequencer__authority__storage__keys__tests__validator_updates_key.snap @@ -1,6 +1,5 @@ --- source: crates/astria-sequencer/src/authority/storage/keys.rs -assertion_line: 15 expression: VALIDATOR_UPDATES --- authority/validator_updates diff --git a/crates/astria-sequencer/src/bridge/storage/keys.rs b/crates/astria-sequencer/src/bridge/storage/keys.rs index a8618637b4..358127c92e 100644 --- a/crates/astria-sequencer/src/bridge/storage/keys.rs +++ b/crates/astria-sequencer/src/bridge/storage/keys.rs @@ -91,14 +91,26 @@ mod tests { #[test] fn keys_should_not_change() { - insta::assert_snapshot!(DEPOSITS_EPHEMERAL); - insta::assert_snapshot!(rollup_id(&address())); - insta::assert_snapshot!(asset_id(&address())); - insta::assert_snapshot!(bridge_account_sudo_address(&address())); - insta::assert_snapshot!(bridge_account_withdrawer_address(&address())); - insta::assert_snapshot!(bridge_account_withdrawal_event(&address(), "the-event")); - insta::assert_snapshot!(deposit(&[1; 32], &RollupId::new([2; 32]))); - insta::assert_snapshot!(last_transaction_id_for_bridge_account(&address())); + insta::assert_snapshot!("ephemeral_deposits_key", DEPOSITS_EPHEMERAL); + insta::assert_snapshot!("rollup_id_key", rollup_id(&address())); + insta::assert_snapshot!("asset_id_key", asset_id(&address())); + insta::assert_snapshot!( + "bridge_sudo_address_key", + bridge_account_sudo_address(&address()) + ); + insta::assert_snapshot!( + "bridge_withdrawer_address_key", + bridge_account_withdrawer_address(&address()) + ); + insta::assert_snapshot!( + "bridge_withdrawal_event_key", + bridge_account_withdrawal_event(&address(), "the-event") + ); + insta::assert_snapshot!("deposit_key", deposit(&[1; 32], &RollupId::new([2; 32]))); + insta::assert_snapshot!( + "last_tx_id_for_bridge_acct_key", + last_transaction_id_for_bridge_account(&address()) + ); } #[test] diff --git a/crates/astria-sequencer/src/bridge/storage/snapshots/astria_sequencer__bridge__storage__keys__tests__keys_should_not_change-3.snap b/crates/astria-sequencer/src/bridge/storage/snapshots/astria_sequencer__bridge__storage__keys__tests__asset_id_key.snap similarity index 100% rename from crates/astria-sequencer/src/bridge/storage/snapshots/astria_sequencer__bridge__storage__keys__tests__keys_should_not_change-3.snap rename to crates/astria-sequencer/src/bridge/storage/snapshots/astria_sequencer__bridge__storage__keys__tests__asset_id_key.snap diff --git a/crates/astria-sequencer/src/bridge/storage/snapshots/astria_sequencer__bridge__storage__keys__tests__keys_should_not_change-4.snap b/crates/astria-sequencer/src/bridge/storage/snapshots/astria_sequencer__bridge__storage__keys__tests__bridge_sudo_address_key.snap similarity index 100% rename from crates/astria-sequencer/src/bridge/storage/snapshots/astria_sequencer__bridge__storage__keys__tests__keys_should_not_change-4.snap rename to crates/astria-sequencer/src/bridge/storage/snapshots/astria_sequencer__bridge__storage__keys__tests__bridge_sudo_address_key.snap diff --git a/crates/astria-sequencer/src/bridge/storage/snapshots/astria_sequencer__bridge__storage__keys__tests__keys_should_not_change-6.snap b/crates/astria-sequencer/src/bridge/storage/snapshots/astria_sequencer__bridge__storage__keys__tests__bridge_withdrawal_event_key.snap similarity index 100% rename from crates/astria-sequencer/src/bridge/storage/snapshots/astria_sequencer__bridge__storage__keys__tests__keys_should_not_change-6.snap rename to crates/astria-sequencer/src/bridge/storage/snapshots/astria_sequencer__bridge__storage__keys__tests__bridge_withdrawal_event_key.snap diff --git a/crates/astria-sequencer/src/bridge/storage/snapshots/astria_sequencer__bridge__storage__keys__tests__keys_should_not_change-5.snap b/crates/astria-sequencer/src/bridge/storage/snapshots/astria_sequencer__bridge__storage__keys__tests__bridge_withdrawer_address_key.snap similarity index 100% rename from crates/astria-sequencer/src/bridge/storage/snapshots/astria_sequencer__bridge__storage__keys__tests__keys_should_not_change-5.snap rename to crates/astria-sequencer/src/bridge/storage/snapshots/astria_sequencer__bridge__storage__keys__tests__bridge_withdrawer_address_key.snap diff --git a/crates/astria-sequencer/src/bridge/storage/snapshots/astria_sequencer__bridge__storage__keys__tests__keys_should_not_change-7.snap b/crates/astria-sequencer/src/bridge/storage/snapshots/astria_sequencer__bridge__storage__keys__tests__deposit_key.snap similarity index 100% rename from crates/astria-sequencer/src/bridge/storage/snapshots/astria_sequencer__bridge__storage__keys__tests__keys_should_not_change-7.snap rename to crates/astria-sequencer/src/bridge/storage/snapshots/astria_sequencer__bridge__storage__keys__tests__deposit_key.snap diff --git a/crates/astria-sequencer/src/bridge/storage/snapshots/astria_sequencer__bridge__storage__keys__tests__keys_should_not_change.snap b/crates/astria-sequencer/src/bridge/storage/snapshots/astria_sequencer__bridge__storage__keys__tests__ephemeral_deposits_key.snap similarity index 100% rename from crates/astria-sequencer/src/bridge/storage/snapshots/astria_sequencer__bridge__storage__keys__tests__keys_should_not_change.snap rename to crates/astria-sequencer/src/bridge/storage/snapshots/astria_sequencer__bridge__storage__keys__tests__ephemeral_deposits_key.snap diff --git a/crates/astria-sequencer/src/bridge/storage/snapshots/astria_sequencer__bridge__storage__keys__tests__keys_should_not_change-8.snap b/crates/astria-sequencer/src/bridge/storage/snapshots/astria_sequencer__bridge__storage__keys__tests__last_tx_id_for_bridge_acct_key.snap similarity index 100% rename from crates/astria-sequencer/src/bridge/storage/snapshots/astria_sequencer__bridge__storage__keys__tests__keys_should_not_change-8.snap rename to crates/astria-sequencer/src/bridge/storage/snapshots/astria_sequencer__bridge__storage__keys__tests__last_tx_id_for_bridge_acct_key.snap diff --git a/crates/astria-sequencer/src/bridge/storage/snapshots/astria_sequencer__bridge__storage__keys__tests__keys_should_not_change-2.snap b/crates/astria-sequencer/src/bridge/storage/snapshots/astria_sequencer__bridge__storage__keys__tests__rollup_id_key.snap similarity index 100% rename from crates/astria-sequencer/src/bridge/storage/snapshots/astria_sequencer__bridge__storage__keys__tests__keys_should_not_change-2.snap rename to crates/astria-sequencer/src/bridge/storage/snapshots/astria_sequencer__bridge__storage__keys__tests__rollup_id_key.snap diff --git a/crates/astria-sequencer/src/grpc/storage/keys.rs b/crates/astria-sequencer/src/grpc/storage/keys.rs index 3c5280fe7f..1abb38ae18 100644 --- a/crates/astria-sequencer/src/grpc/storage/keys.rs +++ b/crates/astria-sequencer/src/grpc/storage/keys.rs @@ -50,12 +50,21 @@ mod tests { #[test] fn keys_should_not_change() { - insta::assert_snapshot!(block_hash_by_height(42)); - insta::assert_snapshot!(sequencer_block_header_by_hash(&HASH)); - insta::assert_snapshot!(rollup_data_by_hash_and_rollup_id(&HASH, &ROLLUP_ID)); - insta::assert_snapshot!(rollup_ids_by_hash(&HASH)); - insta::assert_snapshot!(rollup_transactions_proof_by_hash(&HASH)); - insta::assert_snapshot!(rollup_ids_proof_by_hash(&HASH)); + insta::assert_snapshot!("block_hash_by_height_key", block_hash_by_height(42)); + insta::assert_snapshot!( + "sequencer_block_header_by_hash_key", + sequencer_block_header_by_hash(&HASH) + ); + insta::assert_snapshot!( + "rollup_data_by_has_and_id_key", + rollup_data_by_hash_and_rollup_id(&HASH, &ROLLUP_ID) + ); + insta::assert_snapshot!("rollup_ids_by_hash_key", rollup_ids_by_hash(&HASH)); + insta::assert_snapshot!( + "rollup_transactions_proof_by_hash_key", + rollup_transactions_proof_by_hash(&HASH) + ); + insta::assert_snapshot!("rollup_ids_proof_by_hash", rollup_ids_proof_by_hash(&HASH)); } #[test] diff --git a/crates/astria-sequencer/src/grpc/storage/snapshots/astria_sequencer__grpc__storage__keys__tests__keys_should_not_change.snap b/crates/astria-sequencer/src/grpc/storage/snapshots/astria_sequencer__grpc__storage__keys__tests__block_hash_by_height_key.snap similarity index 86% rename from crates/astria-sequencer/src/grpc/storage/snapshots/astria_sequencer__grpc__storage__keys__tests__keys_should_not_change.snap rename to crates/astria-sequencer/src/grpc/storage/snapshots/astria_sequencer__grpc__storage__keys__tests__block_hash_by_height_key.snap index 95b4e91a7d..618abb7347 100644 --- a/crates/astria-sequencer/src/grpc/storage/snapshots/astria_sequencer__grpc__storage__keys__tests__keys_should_not_change.snap +++ b/crates/astria-sequencer/src/grpc/storage/snapshots/astria_sequencer__grpc__storage__keys__tests__block_hash_by_height_key.snap @@ -1,6 +1,5 @@ --- source: crates/astria-sequencer/src/grpc/storage/keys.rs -assertion_line: 44 expression: block_hash_by_height(42) --- grpc/block_hash/42 diff --git a/crates/astria-sequencer/src/grpc/storage/snapshots/astria_sequencer__grpc__storage__keys__tests__keys_should_not_change-3.snap b/crates/astria-sequencer/src/grpc/storage/snapshots/astria_sequencer__grpc__storage__keys__tests__rollup_data_by_has_and_id_key.snap similarity index 92% rename from crates/astria-sequencer/src/grpc/storage/snapshots/astria_sequencer__grpc__storage__keys__tests__keys_should_not_change-3.snap rename to crates/astria-sequencer/src/grpc/storage/snapshots/astria_sequencer__grpc__storage__keys__tests__rollup_data_by_has_and_id_key.snap index bef72d21bd..54d98329fd 100644 --- a/crates/astria-sequencer/src/grpc/storage/snapshots/astria_sequencer__grpc__storage__keys__tests__keys_should_not_change-3.snap +++ b/crates/astria-sequencer/src/grpc/storage/snapshots/astria_sequencer__grpc__storage__keys__tests__rollup_data_by_has_and_id_key.snap @@ -1,6 +1,5 @@ --- source: crates/astria-sequencer/src/grpc/storage/keys.rs -assertion_line: 46 expression: "rollup_data_by_hash_and_rollup_id(&HASH, &ROLLUP_ID)" --- grpc/rollup_data/AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE=/AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI= diff --git a/crates/astria-sequencer/src/grpc/storage/snapshots/astria_sequencer__grpc__storage__keys__tests__keys_should_not_change-4.snap b/crates/astria-sequencer/src/grpc/storage/snapshots/astria_sequencer__grpc__storage__keys__tests__rollup_ids_by_hash_key.snap similarity index 89% rename from crates/astria-sequencer/src/grpc/storage/snapshots/astria_sequencer__grpc__storage__keys__tests__keys_should_not_change-4.snap rename to crates/astria-sequencer/src/grpc/storage/snapshots/astria_sequencer__grpc__storage__keys__tests__rollup_ids_by_hash_key.snap index 5ee0401df5..61da04ba37 100644 --- a/crates/astria-sequencer/src/grpc/storage/snapshots/astria_sequencer__grpc__storage__keys__tests__keys_should_not_change-4.snap +++ b/crates/astria-sequencer/src/grpc/storage/snapshots/astria_sequencer__grpc__storage__keys__tests__rollup_ids_by_hash_key.snap @@ -1,6 +1,5 @@ --- source: crates/astria-sequencer/src/grpc/storage/keys.rs -assertion_line: 49 expression: rollup_ids_by_hash(&HASH) --- grpc/rollup_ids/AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE= diff --git a/crates/astria-sequencer/src/grpc/storage/snapshots/astria_sequencer__grpc__storage__keys__tests__keys_should_not_change-6.snap b/crates/astria-sequencer/src/grpc/storage/snapshots/astria_sequencer__grpc__storage__keys__tests__rollup_ids_proof_by_hash.snap similarity index 90% rename from crates/astria-sequencer/src/grpc/storage/snapshots/astria_sequencer__grpc__storage__keys__tests__keys_should_not_change-6.snap rename to crates/astria-sequencer/src/grpc/storage/snapshots/astria_sequencer__grpc__storage__keys__tests__rollup_ids_proof_by_hash.snap index cc164f9882..c573f4cea8 100644 --- a/crates/astria-sequencer/src/grpc/storage/snapshots/astria_sequencer__grpc__storage__keys__tests__keys_should_not_change-6.snap +++ b/crates/astria-sequencer/src/grpc/storage/snapshots/astria_sequencer__grpc__storage__keys__tests__rollup_ids_proof_by_hash.snap @@ -1,6 +1,5 @@ --- source: crates/astria-sequencer/src/grpc/storage/keys.rs -assertion_line: 51 expression: rollup_ids_proof_by_hash(&HASH) --- grpc/rollup_ids_proof/AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE= diff --git a/crates/astria-sequencer/src/grpc/storage/snapshots/astria_sequencer__grpc__storage__keys__tests__keys_should_not_change-5.snap b/crates/astria-sequencer/src/grpc/storage/snapshots/astria_sequencer__grpc__storage__keys__tests__rollup_transactions_proof_by_hash_key.snap similarity index 90% rename from crates/astria-sequencer/src/grpc/storage/snapshots/astria_sequencer__grpc__storage__keys__tests__keys_should_not_change-5.snap rename to crates/astria-sequencer/src/grpc/storage/snapshots/astria_sequencer__grpc__storage__keys__tests__rollup_transactions_proof_by_hash_key.snap index e221b2d469..45f3dc60cc 100644 --- a/crates/astria-sequencer/src/grpc/storage/snapshots/astria_sequencer__grpc__storage__keys__tests__keys_should_not_change-5.snap +++ b/crates/astria-sequencer/src/grpc/storage/snapshots/astria_sequencer__grpc__storage__keys__tests__rollup_transactions_proof_by_hash_key.snap @@ -1,6 +1,5 @@ --- source: crates/astria-sequencer/src/grpc/storage/keys.rs -assertion_line: 50 expression: rollup_transactions_proof_by_hash(&HASH) --- grpc/rollup_txs_proof/AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE= diff --git a/crates/astria-sequencer/src/grpc/storage/snapshots/astria_sequencer__grpc__storage__keys__tests__keys_should_not_change-2.snap b/crates/astria-sequencer/src/grpc/storage/snapshots/astria_sequencer__grpc__storage__keys__tests__sequencer_block_header_by_hash_key.snap similarity index 90% rename from crates/astria-sequencer/src/grpc/storage/snapshots/astria_sequencer__grpc__storage__keys__tests__keys_should_not_change-2.snap rename to crates/astria-sequencer/src/grpc/storage/snapshots/astria_sequencer__grpc__storage__keys__tests__sequencer_block_header_by_hash_key.snap index 018d0b55f2..4448a02ad2 100644 --- a/crates/astria-sequencer/src/grpc/storage/snapshots/astria_sequencer__grpc__storage__keys__tests__keys_should_not_change-2.snap +++ b/crates/astria-sequencer/src/grpc/storage/snapshots/astria_sequencer__grpc__storage__keys__tests__sequencer_block_header_by_hash_key.snap @@ -1,6 +1,5 @@ --- source: crates/astria-sequencer/src/grpc/storage/keys.rs -assertion_line: 45 expression: sequencer_block_header_by_hash(&HASH) --- grpc/block_header/AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE= diff --git a/crates/astria-sequencer/src/ibc/storage/keys.rs b/crates/astria-sequencer/src/ibc/storage/keys.rs index 00cc0b5fd8..b1f2ab2f81 100644 --- a/crates/astria-sequencer/src/ibc/storage/keys.rs +++ b/crates/astria-sequencer/src/ibc/storage/keys.rs @@ -56,9 +56,12 @@ mod tests { #[test] fn keys_should_not_change() { - insta::assert_snapshot!(IBC_SUDO); - insta::assert_snapshot!(channel_balance(&channel_id(), &asset())); - insta::assert_snapshot!(ibc_relayer(&address())); + insta::assert_snapshot!("ibc_sudo_key", IBC_SUDO); + insta::assert_snapshot!( + "channel_balance_key", + channel_balance(&channel_id(), &asset()) + ); + insta::assert_snapshot!("ibc_relayer_key", ibc_relayer(&address())); } #[test] diff --git a/crates/astria-sequencer/src/ibc/storage/snapshots/astria_sequencer__ibc__storage__keys__tests__keys_should_not_change-2.snap b/crates/astria-sequencer/src/ibc/storage/snapshots/astria_sequencer__ibc__storage__keys__tests__channel_balance_key.snap similarity index 100% rename from crates/astria-sequencer/src/ibc/storage/snapshots/astria_sequencer__ibc__storage__keys__tests__keys_should_not_change-2.snap rename to crates/astria-sequencer/src/ibc/storage/snapshots/astria_sequencer__ibc__storage__keys__tests__channel_balance_key.snap diff --git a/crates/astria-sequencer/src/ibc/storage/snapshots/astria_sequencer__ibc__storage__keys__tests__keys_should_not_change-3.snap b/crates/astria-sequencer/src/ibc/storage/snapshots/astria_sequencer__ibc__storage__keys__tests__ibc_relayer_key.snap similarity index 100% rename from crates/astria-sequencer/src/ibc/storage/snapshots/astria_sequencer__ibc__storage__keys__tests__keys_should_not_change-3.snap rename to crates/astria-sequencer/src/ibc/storage/snapshots/astria_sequencer__ibc__storage__keys__tests__ibc_relayer_key.snap diff --git a/crates/astria-sequencer/src/ibc/storage/snapshots/astria_sequencer__ibc__storage__keys__tests__keys_should_not_change.snap b/crates/astria-sequencer/src/ibc/storage/snapshots/astria_sequencer__ibc__storage__keys__tests__ibc_sudo_key.snap similarity index 62% rename from crates/astria-sequencer/src/ibc/storage/snapshots/astria_sequencer__ibc__storage__keys__tests__keys_should_not_change.snap rename to crates/astria-sequencer/src/ibc/storage/snapshots/astria_sequencer__ibc__storage__keys__tests__ibc_sudo_key.snap index c8f53e7af2..b00a3ab756 100644 --- a/crates/astria-sequencer/src/ibc/storage/snapshots/astria_sequencer__ibc__storage__keys__tests__keys_should_not_change.snap +++ b/crates/astria-sequencer/src/ibc/storage/snapshots/astria_sequencer__ibc__storage__keys__tests__ibc_sudo_key.snap @@ -1,6 +1,5 @@ --- source: crates/astria-sequencer/src/ibc/storage/keys.rs -assertion_line: 63 -expression: IBC_SUDO_KEY +expression: IBC_SUDO --- ibc/sudo