Skip to content

Commit

Permalink
refactor sign_raw_tx error return
Browse files Browse the repository at this point in the history
  • Loading branch information
dimxy committed Aug 24, 2023
1 parent 69bb529 commit d678aba
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 18 deletions.
6 changes: 3 additions & 3 deletions mm2src/coins/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1907,12 +1907,12 @@ impl MarketCoinOps for EthCoin {
)
}

/// Stub for sign utxo tx
#[inline(always)]
async fn sign_raw_tx(&self, _args: &SignRawTransactionRequest) -> SignRawTransactionResult {
Err(RawTransactionError::NotImplemented {
MmError::err(RawTransactionError::NotImplemented {
coin: self.ticker().to_string(),
}
.into())
})
}

fn wait_for_confirmations(&self, input: ConfirmPaymentInput) -> Box<dyn Future<Item = (), Error = String> + Send> {
Expand Down
5 changes: 2 additions & 3 deletions mm2src/coins/lightning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1098,10 +1098,9 @@ impl MarketCoinOps for LightningCoin {

#[inline(always)]
async fn sign_raw_tx(&self, _args: &SignRawTransactionRequest) -> SignRawTransactionResult {
Err(RawTransactionError::NotImplemented {
MmError::err(RawTransactionError::NotImplemented {
coin: self.ticker().to_string(),
}
.into())
})
}

// Todo: Add waiting for confirmations logic for the case of if the channel is closed and the htlc can be claimed on-chain
Expand Down
5 changes: 2 additions & 3 deletions mm2src/coins/solana.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,10 +442,9 @@ impl MarketCoinOps for SolanaCoin {

#[inline(always)]
async fn sign_raw_tx(&self, _args: &SignRawTransactionRequest) -> SignRawTransactionResult {
Err(RawTransactionError::NotImplemented {
MmError::err(RawTransactionError::NotImplemented {
coin: self.ticker().to_string(),
}
.into())
})
}

fn wait_for_confirmations(&self, _input: ConfirmPaymentInput) -> Box<dyn Future<Item = (), Error = String> + Send> {
Expand Down
5 changes: 2 additions & 3 deletions mm2src/coins/solana/spl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,9 @@ impl MarketCoinOps for SplToken {

#[inline(always)]
async fn sign_raw_tx(&self, _args: &SignRawTransactionRequest) -> SignRawTransactionResult {
Err(RawTransactionError::NotImplemented {
MmError::err(RawTransactionError::NotImplemented {
coin: self.ticker().to_string(),
}
.into())
})
}

fn wait_for_confirmations(&self, _input: ConfirmPaymentInput) -> Box<dyn Future<Item = (), Error = String> + Send> {
Expand Down
5 changes: 2 additions & 3 deletions mm2src/coins/tendermint/tendermint_coin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2188,10 +2188,9 @@ impl MarketCoinOps for TendermintCoin {

#[inline(always)]
async fn sign_raw_tx(&self, _args: &SignRawTransactionRequest) -> SignRawTransactionResult {
Err(RawTransactionError::NotImplemented {
MmError::err(RawTransactionError::NotImplemented {
coin: self.ticker().to_string(),
}
.into())
})
}

fn wait_for_confirmations(&self, input: ConfirmPaymentInput) -> Box<dyn Future<Item = (), Error = String> + Send> {
Expand Down
5 changes: 2 additions & 3 deletions mm2src/coins/tendermint/tendermint_token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -541,10 +541,9 @@ impl MarketCoinOps for TendermintToken {

#[inline(always)]
async fn sign_raw_tx(&self, _args: &SignRawTransactionRequest) -> SignRawTransactionResult {
Err(RawTransactionError::NotImplemented {
MmError::err(RawTransactionError::NotImplemented {
coin: self.ticker().to_string(),
}
.into())
})
}

fn wait_for_confirmations(&self, input: ConfirmPaymentInput) -> Box<dyn Future<Item = (), Error = String> + Send> {
Expand Down

0 comments on commit d678aba

Please sign in to comment.