diff --git a/src/wallet.rs b/src/wallet.rs index 02dd6a8907..ef920a7e7e 100644 --- a/src/wallet.rs +++ b/src/wallet.rs @@ -319,7 +319,7 @@ impl Wallet { .into_option()?; if let Some(transaction) = transaction { - if u32::try_from(transaction.info.confirmations).unwrap() + if u32::try_from(transaction.info.confirmations).unwrap() + 1 >= Runestone::COMMIT_CONFIRMATIONS.into() { let tx_out = self @@ -327,7 +327,7 @@ impl Wallet { .get_tx_out(&commit.txid(), 0, Some(true))?; if let Some(tx_out) = tx_out { - if tx_out.confirmations >= Runestone::COMMIT_CONFIRMATIONS.into() { + if tx_out.confirmations + 1 >= Runestone::COMMIT_CONFIRMATIONS.into() { break; } } else { diff --git a/tests/json_api.rs b/tests/json_api.rs index 210d3c4164..4b5292b152 100644 --- a/tests/json_api.rs +++ b/tests/json_api.rs @@ -545,10 +545,10 @@ fn get_runes() { spacers: 0 }, symbol: Some('¢'), - timestamp: 11, + timestamp: 10, turbo: false, }, - id: RuneId { block: 11, tx: 1 }, + id: RuneId { block: 10, tx: 1 }, mintable: false, parent: Some(InscriptionId { txid: a.output.reveal, @@ -568,7 +568,7 @@ fn get_runes() { api::Runes { entries: vec![ ( - RuneId { block: 11, tx: 1 }, + RuneId { block: 10, tx: 1 }, RuneEntry { block: a.id.block, burned: 0, @@ -583,12 +583,12 @@ fn get_runes() { spacers: 0 }, symbol: Some('¢'), - timestamp: 11, + timestamp: 10, turbo: false, } ), ( - RuneId { block: 19, tx: 1 }, + RuneId { block: 17, tx: 1 }, RuneEntry { block: b.id.block, burned: 0, @@ -603,12 +603,12 @@ fn get_runes() { spacers: 0 }, symbol: Some('¢'), - timestamp: 19, + timestamp: 17, turbo: false, } ), ( - RuneId { block: 27, tx: 1 }, + RuneId { block: 24, tx: 1 }, RuneEntry { block: c.id.block, burned: 0, @@ -623,7 +623,7 @@ fn get_runes() { spacers: 0 }, symbol: Some('¢'), - timestamp: 27, + timestamp: 24, turbo: false, } ) diff --git a/tests/lib.rs b/tests/lib.rs index 98fdc317fa..a2160b6670 100644 --- a/tests/lib.rs +++ b/tests/lib.rs @@ -203,7 +203,7 @@ fn batch(core: &mockcore::Handle, ord: &TestServer, batchfile: batch::File) -> E "Waiting for rune commitment [[:xdigit:]]{64} to mature…\n" ); - core.mine_blocks(6); + core.mine_blocks(5); let output = spawn.run_and_deserialize_output::(); diff --git a/tests/runes.rs b/tests/runes.rs index c7ed56ea08..56337b6a61 100644 --- a/tests/runes.rs +++ b/tests/runes.rs @@ -46,11 +46,11 @@ fn one_rune() { runes: vec![( Rune(RUNE), RuneInfo { - block: 8, + block: 7, burned: 0, divisibility: 0, etching: etch.output.reveal, - id: RuneId { block: 8, tx: 1 }, + id: RuneId { block: 7, tx: 1 }, terms: None, mints: 0, number: 0, @@ -61,7 +61,7 @@ fn one_rune() { }, supply: 1000, symbol: Some('¢'), - timestamp: ord::timestamp(8), + timestamp: ord::timestamp(7), turbo: false, tx: 1, } @@ -92,11 +92,11 @@ fn two_runes() { ( Rune(RUNE), RuneInfo { - block: 8, + block: 7, burned: 0, divisibility: 0, etching: a.output.reveal, - id: RuneId { block: 8, tx: 1 }, + id: RuneId { block: 7, tx: 1 }, terms: None, mints: 0, number: 0, @@ -107,7 +107,7 @@ fn two_runes() { }, supply: 1000, symbol: Some('¢'), - timestamp: ord::timestamp(8), + timestamp: ord::timestamp(7), turbo: false, tx: 1, } @@ -115,11 +115,11 @@ fn two_runes() { ( Rune(RUNE + 1), RuneInfo { - block: 16, + block: 14, burned: 0, divisibility: 0, etching: b.output.reveal, - id: RuneId { block: 16, tx: 1 }, + id: RuneId { block: 14, tx: 1 }, terms: None, mints: 0, number: 1, @@ -130,7 +130,7 @@ fn two_runes() { }, supply: 1000, symbol: Some('¢'), - timestamp: ord::timestamp(16), + timestamp: ord::timestamp(14), turbo: false, tx: 1, } diff --git a/tests/wallet/balance.rs b/tests/wallet/balance.rs index 6d1fb14a94..c323b24fcd 100644 --- a/tests/wallet/balance.rs +++ b/tests/wallet/balance.rs @@ -124,7 +124,7 @@ fn runic_utxos_are_deducted_from_cardinal() { .ord(&ord) .run_and_deserialize_output::(), Balance { - cardinal: 50 * COIN_VALUE * 8 - 20_000, + cardinal: 50 * COIN_VALUE * 7 - 20_000, ordinal: 10000, runic: Some(10_000), runes: Some( @@ -138,7 +138,7 @@ fn runic_utxos_are_deducted_from_cardinal() { .into_iter() .collect() ), - total: 50 * COIN_VALUE * 8, + total: 50 * COIN_VALUE * 7, } ); } @@ -240,7 +240,7 @@ fn runic_utxos_are_displayed_with_decimal_amount() { .ord(&ord) .run_and_deserialize_output::(), Balance { - cardinal: 50 * COIN_VALUE * 8 - 20_000, + cardinal: 50 * COIN_VALUE * 7 - 20_000, ordinal: 10000, runic: Some(10_000), runes: Some( @@ -254,7 +254,7 @@ fn runic_utxos_are_displayed_with_decimal_amount() { .into_iter() .collect() ), - total: 50 * COIN_VALUE * 8, + total: 50 * COIN_VALUE * 7, } ); } diff --git a/tests/wallet/batch_command.rs b/tests/wallet/batch_command.rs index 423b903ddb..7418b57e18 100644 --- a/tests/wallet/batch_command.rs +++ b/tests/wallet/batch_command.rs @@ -1504,7 +1504,7 @@ fn batch_can_etch_rune() { .ord(&ord) .run_and_deserialize_output::(), Balance { - cardinal: 44999980000, + cardinal: 39999980000, ordinal: 10000, runic: Some(10000), runes: Some( @@ -1518,7 +1518,7 @@ fn batch_can_etch_rune() { .into_iter() .collect() ), - total: 450 * COIN_VALUE, + total: 400 * COIN_VALUE, } ); } @@ -1645,11 +1645,11 @@ fn batch_can_etch_rune_without_premine() { .ord(&ord) .run_and_deserialize_output::(), Balance { - cardinal: 44999990000, + cardinal: 39999990000, ordinal: 10000, runic: Some(0), runes: Some(default()), - total: 450 * COIN_VALUE, + total: 400 * COIN_VALUE, } ); } diff --git a/tests/wallet/mint.rs b/tests/wallet/mint.rs index db8da67170..40f148c83d 100644 --- a/tests/wallet/mint.rs +++ b/tests/wallet/mint.rs @@ -95,7 +95,7 @@ fn minting_rune_and_fails_if_after_end() { .core(&core) .ord(&ord) .expected_exit_code(1) - .expected_stderr("error: rune AAAAAAAAAAAAA mint ended on block 11\n") + .expected_stderr("error: rune AAAAAAAAAAAAA mint ended on block 10\n") .run_and_extract_stdout(); }