Skip to content

Commit

Permalink
skip wallet worker for Namada
Browse files Browse the repository at this point in the history
  • Loading branch information
yito88 committed Aug 7, 2023
1 parent 6c6bdfe commit 1ca5ed8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/relayer/src/chain/namada.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ impl ChainEndpoint for NamadaChain {
let denom = denom.unwrap_or(tx::FEE_TOKEN);
let token = match self.wallet.find_address(denom) {
Some(addr) => addr.clone(),
None => Address::decode(&denom)
None => Address::decode(denom)
.map_err(|_| Error::namada_address_not_found(denom.to_string()))?,
};

Expand Down Expand Up @@ -421,7 +421,7 @@ impl ChainEndpoint for NamadaChain {
if key_owner == owner {
let amount =
token::Amount::try_from_slice(&value[..]).map_err(Error::borsh_decode)?;
let denom_key = token::denom_key(&token);
let denom_key = token::denom_key(token);
let (value, _) =
self.query(denom_key, QueryHeight::Latest, IncludeProof::No)?;
let denominated_amount = if value.is_empty() {
Expand Down
9 changes: 9 additions & 0 deletions crates/relayer/src/supervisor/spawn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,15 @@ impl<'a, Chain: ChainHandle> SpawnContext<'a, Chain> {
}

pub fn spawn_wallet_worker(&mut self, chain: Chain) {
match chain.config() {
Ok(config) if config.r#type == ChainType::Namada => {
// skip spawning a Wallet worker for Namada
// because Namada uses its own wallet
return;
}
_ => {}
}

let wallet_object = Object::Wallet(Wallet {
chain_id: chain.id(),
});
Expand Down

0 comments on commit 1ca5ed8

Please sign in to comment.