Skip to content

Commit

Permalink
Add token address constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
DOBEN committed Dec 23, 2024
1 parent 98501a7 commit 4c51ffd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions rust-src/concordium_base/src/cis2_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,15 @@ pub enum ParseTokenAddressError {
InvalidTokenId,
}

impl TokenAddress {
pub fn new(contract: ContractAddress, id: TokenId) -> Self {
Self {
contract,
id,
}
}
}

impl TryFrom<&str> for TokenAddress {
type Error = ParseTokenAddressError;

Expand Down

0 comments on commit 4c51ffd

Please sign in to comment.