Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Lilyjjo committed Oct 22, 2024
1 parent 038ffac commit 47982cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,7 @@ mod tests {
let snapshot = storage.latest_snapshot();
let mut state = StateDelta::new(snapshot);

state.put_transaction_context(TransactionContext {
address_bytes: [1; 20],
transaction_id: TransactionId::new([0; 32]),
source_action_index: 0,
});
state.put_base_prefix(ASTRIA_PREFIX.to_string()).unwrap();
let signer = astria_address(&[1; 20]);

let asset = test_asset();
state.put_allowed_fee_asset(&asset).unwrap();
Expand All @@ -143,7 +138,7 @@ mod tests {

assert!(
action
.check_authorization(&state, &sudo_address)
.check_authorization(&state, &signer)
.await
.unwrap_err()
.to_string()
Expand Down
15 changes: 4 additions & 11 deletions crates/astria-sequencer/src/bridge/bridge_unlock_action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,10 @@ mod tests {
let snapshot = storage.latest_snapshot();
let mut state = StateDelta::new(snapshot);

state.put_base_prefix(ASTRIA_PREFIX.to_string()).unwrap();

let asset = test_asset();
let transfer_amount = 100;

let signer = astria_address(&[1; 20]);
let to_address = astria_address(&[2; 20]);
let bridge_address = astria_address(&[3; 20]);
state
Expand All @@ -174,7 +173,7 @@ mod tests {
// invalid sender, doesn't match action's `from`, should fail
assert_eyre_error(
&bridge_unlock
.check_authorization(&state, &[1; 20])
.check_authorization(&state, &signer)
.await
.unwrap_err(),
"bridge account does not have an associated withdrawer address",
Expand All @@ -187,13 +186,7 @@ mod tests {
let snapshot = storage.latest_snapshot();
let mut state = StateDelta::new(snapshot);

state.put_transaction_context(TransactionContext {
address_bytes: [1; 20],
transaction_id: TransactionId::new([0; 32]),
source_action_index: 0,
});
state.put_base_prefix(ASTRIA_PREFIX.to_string()).unwrap();

let signer = astria_address(&[1; 20]);
let asset = test_asset();
let transfer_amount = 100;

Expand All @@ -220,7 +213,7 @@ mod tests {
// invalid sender, doesn't match action's bridge account's withdrawer, should fail
assert_eyre_error(
&bridge_unlock
.check_authorization(&state, &withdrawer_address)
.check_authorization(&state, &signer)
.await
.unwrap_err(),
"unauthorized to unlock bridge account",
Expand Down

0 comments on commit 47982cc

Please sign in to comment.