Skip to content

Commit 11c0a89

Browse files
committed
implement MmCoin::wallet_only for tendermint
Signed-off-by: onur-ozkan <[email protected]>
1 parent 00059b3 commit 11c0a89

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

mm2src/coins/tendermint/tendermint_coin.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ pub struct TendermintCoinImpl {
351351
client: TendermintRpcClient,
352352
pub(crate) chain_registry_name: Option<String>,
353353
pub(crate) ctx: MmWeak,
354-
is_keplr_from_ledger: bool,
354+
pub(crate) is_keplr_from_ledger: bool,
355355
}
356356

357357
#[derive(Clone)]
@@ -2121,6 +2121,13 @@ pub async fn get_ibc_chain_list() -> IBCChainRegistriesResult {
21212121
impl MmCoin for TendermintCoin {
21222122
fn is_asset_chain(&self) -> bool { false }
21232123

2124+
fn wallet_only(&self, ctx: &MmArc) -> bool {
2125+
let coin_conf = crate::coin_conf(ctx, self.ticker());
2126+
let wallet_only_conf = coin_conf["wallet_only"].as_bool().unwrap_or(false);
2127+
2128+
wallet_only_conf || self.is_keplr_from_ledger
2129+
}
2130+
21242131
fn spawner(&self) -> CoinFutSpawner { CoinFutSpawner::new(&self.abortable_system) }
21252132

21262133
fn withdraw(&self, req: WithdrawRequest) -> WithdrawFut {

mm2src/coins/tendermint/tendermint_token.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,13 @@ impl MarketCoinOps for TendermintToken {
475475
impl MmCoin for TendermintToken {
476476
fn is_asset_chain(&self) -> bool { false }
477477

478+
fn wallet_only(&self, ctx: &MmArc) -> bool {
479+
let coin_conf = crate::coin_conf(ctx, self.ticker());
480+
let wallet_only_conf = coin_conf["wallet_only"].as_bool().unwrap_or(false);
481+
482+
wallet_only_conf || self.platform_coin.is_keplr_from_ledger
483+
}
484+
478485
fn spawner(&self) -> CoinFutSpawner { CoinFutSpawner::new(&self.abortable_system) }
479486

480487
fn withdraw(&self, req: WithdrawRequest) -> WithdrawFut {

0 commit comments

Comments
 (0)