mirror of
https://github.com/aljazceru/cdk.git
synced 2025-12-22 23:25:22 +01:00
fix: config overwrite on start up (#1081)
* fix: config overwrite on start up
This commit is contained in:
@@ -266,6 +266,7 @@ fn create_ldk_settings(
|
||||
) -> cdk_mintd::config::Settings {
|
||||
cdk_mintd::config::Settings {
|
||||
info: cdk_mintd::config::Info {
|
||||
quote_ttl: None,
|
||||
url: format!("http://127.0.0.1:{port}"),
|
||||
listen_host: "127.0.0.1".to_string(),
|
||||
listen_port: port,
|
||||
|
||||
@@ -11,7 +11,7 @@ use bip39::Mnemonic;
|
||||
use cashu::quote_id::QuoteId;
|
||||
use cashu::{MeltQuoteBolt12Request, MintQuoteBolt12Request, MintQuoteBolt12Response};
|
||||
use cdk::amount::SplitTarget;
|
||||
use cdk::cdk_database::{self, MintDatabase, WalletDatabase};
|
||||
use cdk::cdk_database::{self, WalletDatabase};
|
||||
use cdk::mint::{MintBuilder, MintMeltLimits};
|
||||
use cdk::nuts::nut00::ProofsMethods;
|
||||
use cdk::nuts::{
|
||||
@@ -271,17 +271,14 @@ pub async fn create_and_start_test_mint() -> Result<Mint> {
|
||||
.with_description("pure test mint".to_string())
|
||||
.with_urls(vec!["https://aaa".to_string()]);
|
||||
|
||||
let tx_localstore = localstore.clone();
|
||||
let mut tx = tx_localstore.begin_transaction().await?;
|
||||
|
||||
let quote_ttl = QuoteTTL::new(10000, 10000);
|
||||
tx.set_quote_ttl(quote_ttl).await?;
|
||||
tx.commit().await?;
|
||||
|
||||
let mint = mint_builder
|
||||
.build_with_seed(localstore.clone(), &mnemonic.to_seed_normalized(""))
|
||||
.await?;
|
||||
|
||||
mint.set_quote_ttl(quote_ttl).await?;
|
||||
|
||||
mint.start().await?;
|
||||
|
||||
Ok(mint)
|
||||
|
||||
@@ -181,6 +181,8 @@ pub fn create_fake_wallet_settings(
|
||||
cdk_mintd::config::Settings {
|
||||
info: cdk_mintd::config::Info {
|
||||
url: format!("http://127.0.0.1:{port}"),
|
||||
quote_ttl: None,
|
||||
|
||||
listen_host: "127.0.0.1".to_string(),
|
||||
listen_port: port,
|
||||
seed: None,
|
||||
@@ -233,6 +235,8 @@ pub fn create_cln_settings(
|
||||
cdk_mintd::config::Settings {
|
||||
info: cdk_mintd::config::Info {
|
||||
url: format!("http://127.0.0.1:{port}"),
|
||||
quote_ttl: None,
|
||||
|
||||
listen_host: "127.0.0.1".to_string(),
|
||||
listen_port: port,
|
||||
seed: None,
|
||||
@@ -278,6 +282,7 @@ pub fn create_lnd_settings(
|
||||
) -> cdk_mintd::config::Settings {
|
||||
cdk_mintd::config::Settings {
|
||||
info: cdk_mintd::config::Info {
|
||||
quote_ttl: None,
|
||||
url: format!("http://127.0.0.1:{port}"),
|
||||
listen_host: "127.0.0.1".to_string(),
|
||||
listen_port: port,
|
||||
|
||||
@@ -15,7 +15,6 @@ use std::collections::{HashMap, HashSet};
|
||||
use std::sync::Arc;
|
||||
|
||||
use bip39::Mnemonic;
|
||||
use cdk::cdk_database::MintDatabase;
|
||||
use cdk::mint::{MintBuilder, MintMeltLimits};
|
||||
use cdk::nuts::{CurrencyUnit, PaymentMethod};
|
||||
use cdk::types::{FeeReserve, QuoteTTL};
|
||||
@@ -64,12 +63,9 @@ async fn test_correct_keyset() {
|
||||
.build_with_seed(localstore.clone(), &mnemonic.to_seed_normalized(""))
|
||||
.await
|
||||
.unwrap();
|
||||
let mut tx = localstore.begin_transaction().await.unwrap();
|
||||
|
||||
let quote_ttl = QuoteTTL::new(10000, 10000);
|
||||
tx.set_quote_ttl(quote_ttl).await.unwrap();
|
||||
|
||||
tx.commit().await.unwrap();
|
||||
mint.set_quote_ttl(quote_ttl).await.unwrap();
|
||||
|
||||
let active = mint.get_active_keysets();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user