Skip to content

Commit

Permalink
Merge pull request #246 from ngutech21/feat-wallet-tx-handling
Browse files Browse the repository at this point in the history
Feat wallet tx handling
  • Loading branch information
ngutech21 authored Feb 26, 2024
2 parents d9072cc + ad92219 commit 7496b81
Show file tree
Hide file tree
Showing 9 changed files with 233 additions and 322 deletions.
61 changes: 32 additions & 29 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions moksha-mint/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ pub enum MokshaMintError {
#[error("Currency not supported {0}")]
CurrencyNotSupported(CurrencyUnit),

#[error("Not Enough tokens: {0}")]
NotEnoughTokens(String),
#[error("Not Enough tokens. Required amount {0}")]
NotEnoughTokens(u64),

#[error("Lnd error: {0}")]
Lnd(#[from] Status),
Expand Down
5 changes: 1 addition & 4 deletions moksha-mint/src/mint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,7 @@ impl Mint {
let proofs_amount = proofs.total_amount();

if proofs_amount < quote.amount {
return Err(MokshaMintError::NotEnoughTokens(format!(
"Required amount: {}",
quote.amount
)));
return Err(MokshaMintError::NotEnoughTokens(quote.amount));
}

self.check_used_proofs(proofs).await?;
Expand Down
2 changes: 1 addition & 1 deletion moksha-wallet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ tokio = { version = "1.35.1", features = ["rt", "sync"] }
[target.'cfg(not(target_family="wasm"))'.dependencies]
reqwest = { version = "0.11.23", features = ["serde_json", "json", "rustls-tls"], default-features = false }
tokio = { version = "1.35.1", features = ["rt", "rt-multi-thread", "macros"] }
sqlx = { version = "0.7.3", default-features = false, features = ["sqlite", "runtime-tokio", "tls-native-tls", "migrate", "macros"] }
sqlx = { version = "0.7.3", default-features = false, features = ["sqlite", "runtime-tokio", "tls-rustls", "migrate", "macros"] }

[dev-dependencies]
tempfile = "3.9.0"
Expand Down
Loading

0 comments on commit 7496b81

Please sign in to comment.