Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions crates/relayer/src/chain/cosmos/query/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,11 @@ pub async fn query_txs(
response.txs.len() <= 1,
"packet_from_tx_search_response: unexpected number of txs"
);

let tx = response.txs.remove(0);
let tx = response
.txs
.into_iter()
.next()
.expect("tx_search was constrained to a single result");
let event = update_client_from_tx_search_response(chain_id, &request, tx)?;

Ok(event.into_iter().collect())
Expand All @@ -95,7 +98,11 @@ pub async fn query_txs(
if response.txs.is_empty() {
Ok(vec![])
} else {
let tx = response.txs.remove(0);
let tx = response
.txs
.into_iter()
.next()
.expect("tx_search was constrained to a single result");
Ok(all_ibc_events_from_tx_search_response(chain_id, tx))
}
}
Expand Down Expand Up @@ -165,7 +172,10 @@ pub async fn query_packets_from_txs(
}

// In either case, use the first (latest) event found for this sequence
let (first_event, _, _) = tx_events.remove(0);
let (first_event, _, _) = tx_events
.into_iter()
.next()
.expect("tx_events is known to contain at least one entry");
result.push(first_event);
}

Expand Down