Remove Default implementation of MintMeltLimits

The default would have been min=0, max=0. This made any mint initialized with MintMeltLimits::default() to fail every mint and melt operation, because the amount was out of bounds.
This commit is contained in:
ok300
2025-01-28 12:34:21 +01:00
parent 65283a82ec
commit a2005e1ff0
2 changed files with 4 additions and 4 deletions

View File

@@ -167,7 +167,7 @@ pub async fn create_and_start_test_mint() -> anyhow::Result<Arc<Mint>> {
mint_builder = mint_builder.add_ln_backend(
CurrencyUnit::Sat,
PaymentMethod::Bolt11,
MintMeltLimits::default(),
MintMeltLimits::new(1, 1_000),
ln_fake_backend,
);

View File

@@ -242,8 +242,8 @@ impl MintBuilder {
}
}
/// Mint Melt Limits
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
/// Mint and Melt Limits
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct MintMeltLimits {
/// Min mint amount
pub mint_min: Amount,
@@ -256,7 +256,7 @@ pub struct MintMeltLimits {
}
impl MintMeltLimits {
/// Create new [`MintMeltLimits`]
/// Create new [`MintMeltLimits`]. The `min` and `max` limits apply to both minting and melting.
pub fn new(min: u64, max: u64) -> Self {
Self {
mint_min: min.into(),