From 2da5b5ee8519ed894ea5271536e968a12772670e Mon Sep 17 00:00:00 2001 From: elizabeth Date: Fri, 13 Dec 2024 14:48:13 -0500 Subject: [PATCH] fix tests --- ...breaking_changes__app_hash_at_genesis.snap | 60 +++++++++---------- ...hanges__app_hash_execute_every_action.snap | 60 +++++++++---------- ...king_changes__app_hash_finalize_block.snap | 60 +++++++++---------- .../src/app/tests_breaking_changes.rs | 34 +++++++++++ .../src/app/tests_execute_transaction.rs | 1 + 5 files changed, 125 insertions(+), 90 deletions(-) diff --git a/crates/astria-sequencer/src/app/snapshots/astria_sequencer__app__tests_breaking_changes__app_hash_at_genesis.snap b/crates/astria-sequencer/src/app/snapshots/astria_sequencer__app__tests_breaking_changes__app_hash_at_genesis.snap index 902b74b9a..94ae75bee 100644 --- a/crates/astria-sequencer/src/app/snapshots/astria_sequencer__app__tests_breaking_changes__app_hash_at_genesis.snap +++ b/crates/astria-sequencer/src/app/snapshots/astria_sequencer__app__tests_breaking_changes__app_hash_at_genesis.snap @@ -3,36 +3,36 @@ source: crates/astria-sequencer/src/app/tests_breaking_changes.rs expression: app.app_hash.as_bytes() --- [ - 157, - 13, - 132, - 3, - 217, - 162, - 227, - 248, - 73, - 118, - 68, - 236, - 34, - 159, - 87, - 5, - 85, - 41, - 161, - 204, - 145, + 131, + 167, + 88, + 101, + 218, + 254, + 19, + 102, + 147, + 63, + 205, + 234, + 31, + 196, + 47, + 222, + 20, + 84, + 53, + 174, + 172, + 189, + 174, 154, - 238, - 97, 139, - 220, - 41, - 164, - 135, - 194, - 179, - 87 + 244, + 239, + 59, + 70, + 251, + 95, + 70 ] diff --git a/crates/astria-sequencer/src/app/snapshots/astria_sequencer__app__tests_breaking_changes__app_hash_execute_every_action.snap b/crates/astria-sequencer/src/app/snapshots/astria_sequencer__app__tests_breaking_changes__app_hash_execute_every_action.snap index ef11b6990..57bc28686 100644 --- a/crates/astria-sequencer/src/app/snapshots/astria_sequencer__app__tests_breaking_changes__app_hash_execute_every_action.snap +++ b/crates/astria-sequencer/src/app/snapshots/astria_sequencer__app__tests_breaking_changes__app_hash_execute_every_action.snap @@ -3,36 +3,36 @@ source: crates/astria-sequencer/src/app/tests_breaking_changes.rs expression: app.app_hash.as_bytes() --- [ - 65, - 196, - 122, - 216, - 249, - 102, - 27, - 156, - 222, - 203, - 66, + 255, + 11, 178, - 168, - 59, + 217, + 172, + 122, + 116, + 231, 1, - 214, - 143, - 185, - 29, - 138, - 161, - 109, - 71, - 78, - 249, - 62, - 16, - 107, - 192, - 151, - 124, - 20 + 74, + 167, + 201, + 134, + 26, + 35, + 157, + 44, + 206, + 101, + 210, + 2, + 96, + 162, + 213, + 165, + 49, + 82, + 19, + 134, + 82, + 247, + 72 ] diff --git a/crates/astria-sequencer/src/app/snapshots/astria_sequencer__app__tests_breaking_changes__app_hash_finalize_block.snap b/crates/astria-sequencer/src/app/snapshots/astria_sequencer__app__tests_breaking_changes__app_hash_finalize_block.snap index f3bff6835..24b0fb555 100644 --- a/crates/astria-sequencer/src/app/snapshots/astria_sequencer__app__tests_breaking_changes__app_hash_finalize_block.snap +++ b/crates/astria-sequencer/src/app/snapshots/astria_sequencer__app__tests_breaking_changes__app_hash_finalize_block.snap @@ -3,36 +3,36 @@ source: crates/astria-sequencer/src/app/tests_breaking_changes.rs expression: app.app_hash.as_bytes() --- [ - 150, - 81, - 50, - 231, - 107, - 236, - 27, - 6, - 41, - 178, - 107, - 36, - 215, + 247, + 161, + 143, + 121, + 170, + 69, + 5, + 151, 193, - 86, - 129, - 159, - 216, - 205, - 186, - 209, - 114, + 59, + 28, + 146, + 221, 210, - 24, - 78, - 74, - 36, - 151, - 35, - 133, - 176, - 209 + 102, + 243, + 221, + 51, + 5, + 90, + 88, + 208, + 47, + 18, + 92, + 248, + 211, + 103, + 156, + 26, + 127, + 58 ] diff --git a/crates/astria-sequencer/src/app/tests_breaking_changes.rs b/crates/astria-sequencer/src/app/tests_breaking_changes.rs index 1e2b18671..709bcfc43 100644 --- a/crates/astria-sequencer/src/app/tests_breaking_changes.rs +++ b/crates/astria-sequencer/src/app/tests_breaking_changes.rs @@ -11,10 +11,12 @@ use std::{ collections::HashMap, + str::FromStr as _, sync::Arc, }; use astria_core::{ + connect::types::v2::CurrencyPair, primitive::v1::{ Address, RollupId, @@ -23,11 +25,13 @@ use astria_core::{ genesis::v1::Account, transaction::v1::{ action::{ + AddCurrencyPairs, BridgeLock, BridgeSudoChange, BridgeUnlock, IbcRelayerChange, IbcSudoChange, + RemoveCurrencyPairs, RollupDataSubmission, Transfer, ValidatorUpdate, @@ -361,6 +365,36 @@ async fn app_execute_transaction_with_every_action_snapshot() { let signed_tx = Arc::new(tx_bridge.sign(&bridge)); app.execute_transaction(signed_tx).await.unwrap(); + let currency_pair_tia = CurrencyPair::from_str("TIA/USD").unwrap(); + let currency_pair_eth = CurrencyPair::from_str("ETH/USD").unwrap(); + let tx = TransactionBody::builder() + .actions(vec![ + AddCurrencyPairs { + pairs: vec![currency_pair_tia.clone(), currency_pair_eth.clone()], + } + .into(), + ]) + .chain_id("test") + .nonce(4) + .try_build() + .unwrap(); + let signed_tx = Arc::new(tx.sign(&alice)); + app.execute_transaction(signed_tx).await.unwrap(); + + let tx = TransactionBody::builder() + .actions(vec![ + RemoveCurrencyPairs { + pairs: vec![currency_pair_tia.clone()], + } + .into(), + ]) + .chain_id("test") + .nonce(5) + .try_build() + .unwrap(); + let signed_tx = Arc::new(tx.sign(&alice)); + app.execute_transaction(signed_tx).await.unwrap(); + let sudo_address = app.state.get_sudo_address().await.unwrap(); app.end_block(1, &sudo_address).await.unwrap(); diff --git a/crates/astria-sequencer/src/app/tests_execute_transaction.rs b/crates/astria-sequencer/src/app/tests_execute_transaction.rs index 90de4e887..c4790b130 100644 --- a/crates/astria-sequencer/src/app/tests_execute_transaction.rs +++ b/crates/astria-sequencer/src/app/tests_execute_transaction.rs @@ -1374,6 +1374,7 @@ async fn test_app_execute_transaction_add_and_remove_currency_pairs() { .into(), ]) .chain_id("test") + .nonce(1) .try_build() .unwrap();