Skip to content

Commit

Permalink
feat: .events() helper on TransactionReceipt
Browse files Browse the repository at this point in the history
  • Loading branch information
xJonathanLEI committed Dec 1, 2024
1 parent 5c676a6 commit a8201e6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions starknet-core/src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,17 @@ impl TransactionReceipt {
Self::DeployAccount(receipt) => &receipt.execution_result,
}
}

/// Gets a reference to the transaction's emitted events.
pub fn events(&self) -> &[Event] {
match self {
Self::Invoke(receipt) => &receipt.events,
Self::L1Handler(receipt) => &receipt.events,
Self::Declare(receipt) => &receipt.events,
Self::Deploy(receipt) => &receipt.events,
Self::DeployAccount(receipt) => &receipt.events,
}
}
}

impl L1HandlerTransaction {
Expand Down

0 comments on commit a8201e6

Please sign in to comment.