Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make get_token_id public #144

Merged
merged 1 commit into from
Nov 26, 2024
Merged
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
20 changes: 10 additions & 10 deletions near/omni-bridge/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,16 @@ impl Contract {
self.token_id_to_address.get(&(chain_kind, token))
}

pub fn get_token_id(&self, address: &OmniAddress) -> AccountId {
if let OmniAddress::Near(token_account_id) = address {
token_account_id.clone()
} else {
self.token_address_to_id
.get(address)
.sdk_expect("ERR_TOKEN_NOT_REGISTERED")
}
}

pub fn get_transfer_message(&self, transfer_id: TransferId) -> TransferMessage {
self.pending_transfers
.get(&transfer_id)
Expand Down Expand Up @@ -1015,16 +1025,6 @@ impl Contract {
env::log_str(&OmniBridgeEvent::FinTransferEvent { transfer_message }.to_log_string());
}

fn get_token_id(&self, address: &OmniAddress) -> AccountId {
if let OmniAddress::Near(token_account_id) = address {
token_account_id.clone()
} else {
self.token_address_to_id
.get(address)
.sdk_expect("ERR_TOKEN_NOT_REGISTERED")
}
}

fn get_native_token_id(&self, origin_chain: ChainKind) -> AccountId {
let native_token_address =
OmniAddress::new_zero(origin_chain).sdk_expect("ERR_FAILED_TO_GET_ZERO_ADDRESS");
Expand Down
Loading