Skip to content

Commit

Permalink
fix tests by adding codespace field to tx_sync response, using bytes …
Browse files Browse the repository at this point in the history
…accessors for abci events
  • Loading branch information
SuperFluffy committed Feb 28, 2025
1 parent faa604f commit bfebff2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions crates/astria-sequencer-client/src/tests/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ async fn submit_tx_sync() {
data: vec![].into(),
log: String::new(),
hash: Hash::Sha256([0; 32]),
codespace: String::new(),
};
let _guard = register_broadcast_tx_sync_response(&server, server_response.clone()).await;
let signed_tx = create_signed_transaction();
Expand Down
12 changes: 6 additions & 6 deletions crates/astria-sequencer/src/app/tests_execute_transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1249,10 +1249,10 @@ async fn transaction_execution_records_fee_event() {

let event = events.first().unwrap();
assert_eq!(event.kind, "tx.fees");
assert_eq!(event.attributes[0].key, "actionName");
assert_eq!(event.attributes[1].key, "asset");
assert_eq!(event.attributes[2].key, "feeAmount");
assert_eq!(event.attributes[3].key, "positionInTransaction");
assert_eq!(event.attributes[0].key_bytes(), b"actionName");
assert_eq!(event.attributes[1].key_bytes(), b"asset");
assert_eq!(event.attributes[2].key_bytes(), b"feeAmount");
assert_eq!(event.attributes[3].key_bytes(), b"positionInTransaction");
}

#[tokio::test]
Expand Down Expand Up @@ -1299,9 +1299,9 @@ async fn ensure_all_event_attributes_are_indexed() {
.flat_map(|event| &event.attributes)
.for_each(|attribute| {
assert!(
attribute.index,
attribute.index(),
"attribute {} is not indexed",
attribute.key,
String::from_utf8_lossy(attribute.key_bytes()),
);
});
}

0 comments on commit bfebff2

Please sign in to comment.