Skip to content

Commit

Permalink
feat: add specific LibWallet error code for “Fee is greater than amou…
Browse files Browse the repository at this point in the history
…nt” (#3793)

Description
---
Surfacing a specific error code for the “Fee is greater than amount” Transaction Build error in the LibWalletError for the FFI interface.
  • Loading branch information
philipr-za committed Feb 3, 2022
1 parent beb299e commit 5aa2a66
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions base_layer/wallet_ffi/src/error.rs
Expand Up @@ -213,6 +213,12 @@ impl From<WalletError> for LibWalletError {
code: 204,
message: format!("{:?}", w),
},
WalletError::TransactionServiceError(TransactionServiceError::OutputManagerError(
OutputManagerError::BuildError(ref s),
)) if s == &"Fee is greater than amount".to_string() => Self {
code: 212,
message: format!("{:?}", w),
},
WalletError::TransactionServiceError(TransactionServiceError::OutputManagerError(_)) => Self {
code: 206,
message: format!("{:?}", w),
Expand All @@ -229,6 +235,7 @@ impl From<WalletError> for LibWalletError {
code: 211,
message: format!("{:?}", w),
},

// Comms Stack errors
WalletError::MultiaddrError(_) => Self {
code: 301,
Expand Down

0 comments on commit 5aa2a66

Please sign in to comment.