Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

Commit

Permalink
add getter function for contract_id (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
Salka1988 authored Oct 14, 2022
1 parent ae3e5e4 commit a7b5496
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/receipt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,13 @@ impl Receipt {
}
}

pub const fn contract_id(&self) -> Option<&ContractId> {
match self {
Self::Panic { contract_id, .. } => contract_id.as_ref(),
_ => None,
}
}

fn variant_len_without_data(variant: ReceiptRepr) -> usize {
ContractId::LEN // id
+ WORD_SIZE // pc
Expand Down

0 comments on commit a7b5496

Please sign in to comment.