|
@@ -26,7 +26,7 @@ use cdk::nuts::{
|
|
|
SecretKey, State, SwapRequest,
|
|
SecretKey, State, SwapRequest,
|
|
|
};
|
|
};
|
|
|
use cdk::wallet::types::TransactionDirection;
|
|
use cdk::wallet::types::TransactionDirection;
|
|
|
-use cdk::wallet::{HttpClient, MintConnector, Wallet};
|
|
|
|
|
|
|
+use cdk::wallet::{HttpClient, MintConnector, Wallet, WalletTrait};
|
|
|
use cdk::StreamExt;
|
|
use cdk::StreamExt;
|
|
|
use cdk_fake_wallet::{create_fake_invoice, FakeInvoiceDescription};
|
|
use cdk_fake_wallet::{create_fake_invoice, FakeInvoiceDescription};
|
|
|
use cdk_sqlite::wallet::memory;
|
|
use cdk_sqlite::wallet::memory;
|
|
@@ -45,10 +45,7 @@ async fn test_fake_tokens_pending() {
|
|
|
)
|
|
)
|
|
|
.expect("failed to create new wallet");
|
|
.expect("failed to create new wallet");
|
|
|
|
|
|
|
|
- let mint_quote = wallet
|
|
|
|
|
- .mint_quote(PaymentMethod::BOLT11, Some(100.into()), None, None)
|
|
|
|
|
- .await
|
|
|
|
|
- .unwrap();
|
|
|
|
|
|
|
+ let mint_quote = wallet.mint_quote(100.into(), None).await.unwrap();
|
|
|
|
|
|
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
|
|
|
|
|
@@ -104,10 +101,7 @@ async fn test_fake_melt_payment_fail() {
|
|
|
)
|
|
)
|
|
|
.expect("Failed to create new wallet");
|
|
.expect("Failed to create new wallet");
|
|
|
|
|
|
|
|
- let mint_quote = wallet
|
|
|
|
|
- .mint_quote(PaymentMethod::BOLT11, Some(100.into()), None, None)
|
|
|
|
|
- .await
|
|
|
|
|
- .unwrap();
|
|
|
|
|
|
|
+ let mint_quote = wallet.mint_quote(100.into(), None).await.unwrap();
|
|
|
|
|
|
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
|
|
|
|
|
@@ -182,10 +176,7 @@ async fn test_fake_melt_payment_fail_and_check() {
|
|
|
)
|
|
)
|
|
|
.expect("Failed to create new wallet");
|
|
.expect("Failed to create new wallet");
|
|
|
|
|
|
|
|
- let mint_quote = wallet
|
|
|
|
|
- .mint_quote(PaymentMethod::BOLT11, Some(100.into()), None, None)
|
|
|
|
|
- .await
|
|
|
|
|
- .unwrap();
|
|
|
|
|
|
|
+ let mint_quote = wallet.mint_quote(100.into(), None).await.unwrap();
|
|
|
|
|
|
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
|
|
|
|
|
@@ -240,10 +231,7 @@ async fn test_fake_melt_payment_return_fail_status() {
|
|
|
)
|
|
)
|
|
|
.expect("Failed to create new wallet");
|
|
.expect("Failed to create new wallet");
|
|
|
|
|
|
|
|
- let mint_quote = wallet
|
|
|
|
|
- .mint_quote(PaymentMethod::BOLT11, Some(100.into()), None, None)
|
|
|
|
|
- .await
|
|
|
|
|
- .unwrap();
|
|
|
|
|
|
|
+ let mint_quote = wallet.mint_quote(100.into(), None).await.unwrap();
|
|
|
|
|
|
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
|
|
|
|
|
@@ -334,10 +322,7 @@ async fn test_fake_melt_payment_error_unknown() {
|
|
|
)
|
|
)
|
|
|
.unwrap();
|
|
.unwrap();
|
|
|
|
|
|
|
|
- let mint_quote = wallet
|
|
|
|
|
- .mint_quote(PaymentMethod::BOLT11, Some(100.into()), None, None)
|
|
|
|
|
- .await
|
|
|
|
|
- .unwrap();
|
|
|
|
|
|
|
+ let mint_quote = wallet.mint_quote(100.into(), None).await.unwrap();
|
|
|
|
|
|
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
|
|
|
|
|
@@ -416,10 +401,7 @@ async fn test_fake_melt_payment_err_paid() {
|
|
|
)
|
|
)
|
|
|
.expect("Failed to create new wallet");
|
|
.expect("Failed to create new wallet");
|
|
|
|
|
|
|
|
- let mint_quote = wallet
|
|
|
|
|
- .mint_quote(PaymentMethod::BOLT11, Some(100.into()), None, None)
|
|
|
|
|
- .await
|
|
|
|
|
- .unwrap();
|
|
|
|
|
|
|
+ let mint_quote = wallet.mint_quote(100.into(), None).await.unwrap();
|
|
|
|
|
|
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
|
|
|
|
|
@@ -481,10 +463,7 @@ async fn test_fake_melt_change_in_quote() {
|
|
|
)
|
|
)
|
|
|
.expect("Failed to create new wallet");
|
|
.expect("Failed to create new wallet");
|
|
|
|
|
|
|
|
- let mint_quote = wallet
|
|
|
|
|
- .mint_quote(PaymentMethod::BOLT11, Some(100.into()), None, None)
|
|
|
|
|
- .await
|
|
|
|
|
- .unwrap();
|
|
|
|
|
|
|
+ let mint_quote = wallet.mint_quote(100.into(), None).await.unwrap();
|
|
|
|
|
|
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
|
|
|
|
|
@@ -564,10 +543,7 @@ async fn test_fake_mint_with_witness() {
|
|
|
None,
|
|
None,
|
|
|
)
|
|
)
|
|
|
.expect("failed to create new wallet");
|
|
.expect("failed to create new wallet");
|
|
|
- let mint_quote = wallet
|
|
|
|
|
- .mint_quote(PaymentMethod::BOLT11, Some(100.into()), None, None)
|
|
|
|
|
- .await
|
|
|
|
|
- .unwrap();
|
|
|
|
|
|
|
+ let mint_quote = wallet.mint_quote(100.into(), None).await.unwrap();
|
|
|
|
|
|
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
|
|
|
|
|
@@ -594,10 +570,7 @@ async fn test_fake_mint_without_witness() {
|
|
|
)
|
|
)
|
|
|
.expect("failed to create new wallet");
|
|
.expect("failed to create new wallet");
|
|
|
|
|
|
|
|
- let mint_quote = wallet
|
|
|
|
|
- .mint_quote(PaymentMethod::BOLT11, Some(100.into()), None, None)
|
|
|
|
|
- .await
|
|
|
|
|
- .unwrap();
|
|
|
|
|
|
|
+ let mint_quote = wallet.mint_quote(100.into(), None).await.unwrap();
|
|
|
|
|
|
|
|
let mut payment_streams = wallet.payment_stream(&mint_quote);
|
|
let mut payment_streams = wallet.payment_stream(&mint_quote);
|
|
|
|
|
|
|
@@ -649,10 +622,7 @@ async fn test_fake_mint_with_wrong_witness() {
|
|
|
)
|
|
)
|
|
|
.expect("failed to create new wallet");
|
|
.expect("failed to create new wallet");
|
|
|
|
|
|
|
|
- let mint_quote = wallet
|
|
|
|
|
- .mint_quote(PaymentMethod::BOLT11, Some(100.into()), None, None)
|
|
|
|
|
- .await
|
|
|
|
|
- .unwrap();
|
|
|
|
|
|
|
+ let mint_quote = wallet.mint_quote(100.into(), None).await.unwrap();
|
|
|
|
|
|
|
|
let mut payment_streams = wallet.payment_stream(&mint_quote);
|
|
let mut payment_streams = wallet.payment_stream(&mint_quote);
|
|
|
|
|
|
|
@@ -710,10 +680,7 @@ async fn test_fake_mint_inflated() {
|
|
|
)
|
|
)
|
|
|
.expect("failed to create new wallet");
|
|
.expect("failed to create new wallet");
|
|
|
|
|
|
|
|
- let mint_quote = wallet
|
|
|
|
|
- .mint_quote(PaymentMethod::BOLT11, Some(100.into()), None, None)
|
|
|
|
|
- .await
|
|
|
|
|
- .unwrap();
|
|
|
|
|
|
|
+ let mint_quote = wallet.mint_quote(100.into(), None).await.unwrap();
|
|
|
|
|
|
|
|
let mut payment_streams = wallet.payment_stream(&mint_quote);
|
|
let mut payment_streams = wallet.payment_stream(&mint_quote);
|
|
|
|
|
|
|
@@ -786,10 +753,7 @@ async fn test_fake_mint_multiple_units() {
|
|
|
)
|
|
)
|
|
|
.expect("failed to create new wallet");
|
|
.expect("failed to create new wallet");
|
|
|
|
|
|
|
|
- let mint_quote = wallet
|
|
|
|
|
- .mint_quote(PaymentMethod::BOLT11, Some(100.into()), None, None)
|
|
|
|
|
- .await
|
|
|
|
|
- .unwrap();
|
|
|
|
|
|
|
+ let mint_quote = wallet.mint_quote(100.into(), None).await.unwrap();
|
|
|
|
|
|
|
|
let mut payment_streams = wallet.payment_stream(&mint_quote);
|
|
let mut payment_streams = wallet.payment_stream(&mint_quote);
|
|
|
|
|
|
|
@@ -889,10 +853,7 @@ async fn test_fake_mint_multiple_unit_swap() {
|
|
|
|
|
|
|
|
wallet.refresh_keysets().await.unwrap();
|
|
wallet.refresh_keysets().await.unwrap();
|
|
|
|
|
|
|
|
- let mint_quote = wallet
|
|
|
|
|
- .mint_quote(PaymentMethod::BOLT11, Some(100.into()), None, None)
|
|
|
|
|
- .await
|
|
|
|
|
- .unwrap();
|
|
|
|
|
|
|
+ let mint_quote = wallet.mint_quote(100.into(), None).await.unwrap();
|
|
|
|
|
|
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
|
|
|
|
|
@@ -912,10 +873,7 @@ async fn test_fake_mint_multiple_unit_swap() {
|
|
|
.expect("failed to create usd wallet");
|
|
.expect("failed to create usd wallet");
|
|
|
wallet_usd.refresh_keysets().await.unwrap();
|
|
wallet_usd.refresh_keysets().await.unwrap();
|
|
|
|
|
|
|
|
- let mint_quote = wallet_usd
|
|
|
|
|
- .mint_quote(PaymentMethod::BOLT11, Some(100.into()), None, None)
|
|
|
|
|
- .await
|
|
|
|
|
- .unwrap();
|
|
|
|
|
|
|
+ let mint_quote = wallet_usd.mint_quote(100.into(), None).await.unwrap();
|
|
|
|
|
|
|
|
let mut proof_streams =
|
|
let mut proof_streams =
|
|
|
wallet_usd.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
wallet_usd.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
@@ -1020,10 +978,7 @@ async fn test_fake_mint_multiple_unit_melt() {
|
|
|
)
|
|
)
|
|
|
.expect("failed to create new wallet");
|
|
.expect("failed to create new wallet");
|
|
|
|
|
|
|
|
- let mint_quote = wallet
|
|
|
|
|
- .mint_quote(PaymentMethod::BOLT11, Some(100.into()), None, None)
|
|
|
|
|
- .await
|
|
|
|
|
- .unwrap();
|
|
|
|
|
|
|
+ let mint_quote = wallet.mint_quote(100.into(), None).await.unwrap();
|
|
|
|
|
|
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
|
|
|
|
|
@@ -1044,10 +999,7 @@ async fn test_fake_mint_multiple_unit_melt() {
|
|
|
)
|
|
)
|
|
|
.expect("failed to create new wallet");
|
|
.expect("failed to create new wallet");
|
|
|
|
|
|
|
|
- let mint_quote = wallet_usd
|
|
|
|
|
- .mint_quote(PaymentMethod::BOLT11, Some(100.into()), None, None)
|
|
|
|
|
- .await
|
|
|
|
|
- .unwrap();
|
|
|
|
|
|
|
+ let mint_quote = wallet_usd.mint_quote(100.into(), None).await.unwrap();
|
|
|
println!("Minted quote usd");
|
|
println!("Minted quote usd");
|
|
|
|
|
|
|
|
let mut proof_streams =
|
|
let mut proof_streams =
|
|
@@ -1169,10 +1121,7 @@ async fn test_fake_mint_input_output_mismatch() {
|
|
|
)
|
|
)
|
|
|
.expect("failed to create new wallet");
|
|
.expect("failed to create new wallet");
|
|
|
|
|
|
|
|
- let mint_quote = wallet
|
|
|
|
|
- .mint_quote(PaymentMethod::BOLT11, Some(100.into()), None, None)
|
|
|
|
|
- .await
|
|
|
|
|
- .unwrap();
|
|
|
|
|
|
|
+ let mint_quote = wallet.mint_quote(100.into(), None).await.unwrap();
|
|
|
|
|
|
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
|
|
|
|
|
@@ -1231,10 +1180,7 @@ async fn test_fake_mint_swap_inflated() {
|
|
|
)
|
|
)
|
|
|
.expect("failed to create new wallet");
|
|
.expect("failed to create new wallet");
|
|
|
|
|
|
|
|
- let mint_quote = wallet
|
|
|
|
|
- .mint_quote(PaymentMethod::BOLT11, Some(100.into()), None, None)
|
|
|
|
|
- .await
|
|
|
|
|
- .unwrap();
|
|
|
|
|
|
|
+ let mint_quote = wallet.mint_quote(100.into(), None).await.unwrap();
|
|
|
|
|
|
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
|
let fee_and_amounts = (0, ((0..32).map(|x| 2u64.pow(x)).collect::<Vec<_>>())).into();
|
|
let fee_and_amounts = (0, ((0..32).map(|x| 2u64.pow(x)).collect::<Vec<_>>())).into();
|
|
@@ -1284,10 +1230,7 @@ async fn test_fake_mint_swap_spend_after_fail() {
|
|
|
)
|
|
)
|
|
|
.expect("failed to create new wallet");
|
|
.expect("failed to create new wallet");
|
|
|
|
|
|
|
|
- let mint_quote = wallet
|
|
|
|
|
- .mint_quote(PaymentMethod::BOLT11, Some(100.into()), None, None)
|
|
|
|
|
- .await
|
|
|
|
|
- .unwrap();
|
|
|
|
|
|
|
+ let mint_quote = wallet.mint_quote(100.into(), None).await.unwrap();
|
|
|
|
|
|
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
|
|
|
|
|
@@ -1374,10 +1317,7 @@ async fn test_fake_mint_melt_spend_after_fail() {
|
|
|
)
|
|
)
|
|
|
.expect("failed to create new wallet");
|
|
.expect("failed to create new wallet");
|
|
|
|
|
|
|
|
- let mint_quote = wallet
|
|
|
|
|
- .mint_quote(PaymentMethod::BOLT11, Some(100.into()), None, None)
|
|
|
|
|
- .await
|
|
|
|
|
- .unwrap();
|
|
|
|
|
|
|
+ let mint_quote = wallet.mint_quote(100.into(), None).await.unwrap();
|
|
|
|
|
|
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
|
|
|
|
|
@@ -1468,10 +1408,7 @@ async fn test_fake_mint_duplicate_proofs_swap() {
|
|
|
)
|
|
)
|
|
|
.expect("failed to create new wallet");
|
|
.expect("failed to create new wallet");
|
|
|
|
|
|
|
|
- let mint_quote = wallet
|
|
|
|
|
- .mint_quote(PaymentMethod::BOLT11, Some(100.into()), None, None)
|
|
|
|
|
- .await
|
|
|
|
|
- .unwrap();
|
|
|
|
|
|
|
+ let mint_quote = wallet.mint_quote(100.into(), None).await.unwrap();
|
|
|
|
|
|
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
|
|
|
|
|
@@ -1552,10 +1489,7 @@ async fn test_fake_mint_duplicate_proofs_melt() {
|
|
|
)
|
|
)
|
|
|
.expect("failed to create new wallet");
|
|
.expect("failed to create new wallet");
|
|
|
|
|
|
|
|
- let mint_quote = wallet
|
|
|
|
|
- .mint_quote(PaymentMethod::BOLT11, Some(100.into()), None, None)
|
|
|
|
|
- .await
|
|
|
|
|
- .unwrap();
|
|
|
|
|
|
|
+ let mint_quote = wallet.mint_quote(100.into(), None).await.unwrap();
|
|
|
|
|
|
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
|
|
|
|
|
@@ -1611,10 +1545,7 @@ async fn test_wallet_proof_recovery_after_failed_melt() {
|
|
|
.expect("failed to create new wallet");
|
|
.expect("failed to create new wallet");
|
|
|
|
|
|
|
|
// Mint 100 sats
|
|
// Mint 100 sats
|
|
|
- let mint_quote = wallet
|
|
|
|
|
- .mint_quote(PaymentMethod::BOLT11, Some(100.into()), None, None)
|
|
|
|
|
- .await
|
|
|
|
|
- .unwrap();
|
|
|
|
|
|
|
+ let mint_quote = wallet.mint_quote(100.into(), None).await.unwrap();
|
|
|
let _roof_streams = wallet
|
|
let _roof_streams = wallet
|
|
|
.wait_and_mint_quote(
|
|
.wait_and_mint_quote(
|
|
|
mint_quote.clone(),
|
|
mint_quote.clone(),
|
|
@@ -1704,10 +1635,7 @@ async fn test_concurrent_melt_same_invoice() {
|
|
|
|
|
|
|
|
// Mint proofs for all wallets
|
|
// Mint proofs for all wallets
|
|
|
for (i, wallet) in wallets.iter().enumerate() {
|
|
for (i, wallet) in wallets.iter().enumerate() {
|
|
|
- let mint_quote = wallet
|
|
|
|
|
- .mint_quote(PaymentMethod::BOLT11, Some(100.into()), None, None)
|
|
|
|
|
- .await
|
|
|
|
|
- .unwrap();
|
|
|
|
|
|
|
+ let mint_quote = wallet.mint_quote(100.into(), None).await.unwrap();
|
|
|
let mut proof_streams =
|
|
let mut proof_streams =
|
|
|
wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
|
proof_streams
|
|
proof_streams
|
|
@@ -1804,10 +1732,7 @@ async fn test_wallet_proof_recovery_after_failed_swap() {
|
|
|
.expect("failed to create new wallet");
|
|
.expect("failed to create new wallet");
|
|
|
|
|
|
|
|
// Mint 100 sats
|
|
// Mint 100 sats
|
|
|
- let mint_quote = wallet
|
|
|
|
|
- .mint_quote(PaymentMethod::BOLT11, Some(100.into()), None, None)
|
|
|
|
|
- .await
|
|
|
|
|
- .unwrap();
|
|
|
|
|
|
|
+ let mint_quote = wallet.mint_quote(100.into(), None).await.unwrap();
|
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
|
let initial_proofs = proof_streams
|
|
let initial_proofs = proof_streams
|
|
|
.next()
|
|
.next()
|
|
@@ -1893,10 +1818,7 @@ async fn test_melt_proofs_external() {
|
|
|
)
|
|
)
|
|
|
.expect("failed to create sender wallet");
|
|
.expect("failed to create sender wallet");
|
|
|
|
|
|
|
|
- let mint_quote = wallet_sender
|
|
|
|
|
- .mint_quote(PaymentMethod::BOLT11, Some(100.into()), None, None)
|
|
|
|
|
- .await
|
|
|
|
|
- .unwrap();
|
|
|
|
|
|
|
+ let mint_quote = wallet_sender.mint_quote(100.into(), None).await.unwrap();
|
|
|
|
|
|
|
|
let mut proof_streams =
|
|
let mut proof_streams =
|
|
|
wallet_sender.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
wallet_sender.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
@@ -1991,10 +1913,7 @@ async fn test_melt_with_swap_for_exact_amount() {
|
|
|
.expect("failed to create new wallet");
|
|
.expect("failed to create new wallet");
|
|
|
|
|
|
|
|
// Mint 100 sats - this will give us proofs in standard denominations
|
|
// Mint 100 sats - this will give us proofs in standard denominations
|
|
|
- let mint_quote = wallet
|
|
|
|
|
- .mint_quote(PaymentMethod::BOLT11, Some(100.into()), None, None)
|
|
|
|
|
- .await
|
|
|
|
|
- .unwrap();
|
|
|
|
|
|
|
+ let mint_quote = wallet.mint_quote(100.into(), None).await.unwrap();
|
|
|
|
|
|
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
|
|
|
|
|
@@ -2077,10 +1996,7 @@ async fn test_melt_exact_proofs_no_swap_needed() {
|
|
|
.expect("failed to create new wallet");
|
|
.expect("failed to create new wallet");
|
|
|
|
|
|
|
|
// Mint a larger amount to have more denomination options
|
|
// Mint a larger amount to have more denomination options
|
|
|
- let mint_quote = wallet
|
|
|
|
|
- .mint_quote(PaymentMethod::BOLT11, Some(1000.into()), None, None)
|
|
|
|
|
- .await
|
|
|
|
|
- .unwrap();
|
|
|
|
|
|
|
+ let mint_quote = wallet.mint_quote(1000.into(), None).await.unwrap();
|
|
|
|
|
|
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
let mut proof_streams = wallet.proof_stream(mint_quote.clone(), SplitTarget::default(), None);
|
|
|
|
|
|
|
@@ -2136,10 +2052,7 @@ async fn test_check_all_mint_quotes_bolt11() {
|
|
|
.expect("failed to create new wallet");
|
|
.expect("failed to create new wallet");
|
|
|
|
|
|
|
|
// Create first mint quote and pay it (using proof_stream triggers fake wallet payment)
|
|
// Create first mint quote and pay it (using proof_stream triggers fake wallet payment)
|
|
|
- let mint_quote_1 = wallet
|
|
|
|
|
- .mint_quote(PaymentMethod::BOLT11, Some(100.into()), None, None)
|
|
|
|
|
- .await
|
|
|
|
|
- .unwrap();
|
|
|
|
|
|
|
+ let mint_quote_1 = wallet.mint_quote(100.into(), None).await.unwrap();
|
|
|
|
|
|
|
|
// Wait for the payment to be registered (fake wallet auto-pays)
|
|
// Wait for the payment to be registered (fake wallet auto-pays)
|
|
|
let mut payment_stream_1 = wallet.payment_stream(&mint_quote_1);
|
|
let mut payment_stream_1 = wallet.payment_stream(&mint_quote_1);
|
|
@@ -2150,10 +2063,7 @@ async fn test_check_all_mint_quotes_bolt11() {
|
|
|
.expect("no error");
|
|
.expect("no error");
|
|
|
|
|
|
|
|
// Create second mint quote and pay it
|
|
// Create second mint quote and pay it
|
|
|
- let mint_quote_2 = wallet
|
|
|
|
|
- .mint_quote(PaymentMethod::BOLT11, Some(50.into()), None, None)
|
|
|
|
|
- .await
|
|
|
|
|
- .unwrap();
|
|
|
|
|
|
|
+ let mint_quote_2 = wallet.mint_quote(50.into(), None).await.unwrap();
|
|
|
|
|
|
|
|
let mut payment_stream_2 = wallet.payment_stream(&mint_quote_2);
|
|
let mut payment_stream_2 = wallet.payment_stream(&mint_quote_2);
|
|
|
payment_stream_2
|
|
payment_stream_2
|
|
@@ -2198,16 +2108,10 @@ async fn test_get_unissued_mint_quotes_wallet() {
|
|
|
.expect("failed to create new wallet");
|
|
.expect("failed to create new wallet");
|
|
|
|
|
|
|
|
// Create a quote but don't pay it (stays unpaid)
|
|
// Create a quote but don't pay it (stays unpaid)
|
|
|
- let unpaid_quote = wallet
|
|
|
|
|
- .mint_quote(PaymentMethod::BOLT11, Some(100.into()), None, None)
|
|
|
|
|
- .await
|
|
|
|
|
- .unwrap();
|
|
|
|
|
|
|
+ let unpaid_quote = wallet.mint_quote(100.into(), None).await.unwrap();
|
|
|
|
|
|
|
|
// Create another quote and pay it but don't mint
|
|
// Create another quote and pay it but don't mint
|
|
|
- let paid_quote = wallet
|
|
|
|
|
- .mint_quote(PaymentMethod::BOLT11, Some(50.into()), None, None)
|
|
|
|
|
- .await
|
|
|
|
|
- .unwrap();
|
|
|
|
|
|
|
+ let paid_quote = wallet.mint_quote(50.into(), None).await.unwrap();
|
|
|
let mut payment_stream = wallet.payment_stream(&paid_quote);
|
|
let mut payment_stream = wallet.payment_stream(&paid_quote);
|
|
|
payment_stream
|
|
payment_stream
|
|
|
.next()
|
|
.next()
|
|
@@ -2216,10 +2120,7 @@ async fn test_get_unissued_mint_quotes_wallet() {
|
|
|
.expect("no error");
|
|
.expect("no error");
|
|
|
|
|
|
|
|
// Create a third quote and fully mint it
|
|
// Create a third quote and fully mint it
|
|
|
- let minted_quote = wallet
|
|
|
|
|
- .mint_quote(PaymentMethod::BOLT11, Some(25.into()), None, None)
|
|
|
|
|
- .await
|
|
|
|
|
- .unwrap();
|
|
|
|
|
|
|
+ let minted_quote = wallet.mint_quote(25.into(), None).await.unwrap();
|
|
|
let mut proof_stream = wallet.proof_stream(minted_quote.clone(), SplitTarget::default(), None);
|
|
let mut proof_stream = wallet.proof_stream(minted_quote.clone(), SplitTarget::default(), None);
|
|
|
proof_stream
|
|
proof_stream
|
|
|
.next()
|
|
.next()
|
|
@@ -2271,10 +2172,7 @@ async fn test_refresh_mint_quote_status_updates_after_minting() {
|
|
|
.expect("failed to create new wallet");
|
|
.expect("failed to create new wallet");
|
|
|
|
|
|
|
|
let mint_amount = Amount::from(100);
|
|
let mint_amount = Amount::from(100);
|
|
|
- let mint_quote = wallet
|
|
|
|
|
- .mint_quote(PaymentMethod::BOLT11, Some(mint_amount), None, None)
|
|
|
|
|
- .await
|
|
|
|
|
- .unwrap();
|
|
|
|
|
|
|
+ let mint_quote = wallet.mint_quote(mint_amount, None).await.unwrap();
|
|
|
|
|
|
|
|
// Get the quote from localstore before minting
|
|
// Get the quote from localstore before minting
|
|
|
let quote_before = wallet
|
|
let quote_before = wallet
|