mirror of
https://github.com/Qortal/piratewallet-light-cli.git
synced 2025-02-11 17:55:47 +00:00
Rollback witness test
This commit is contained in:
parent
f0f7684346
commit
11c409ec7c
@ -2759,10 +2759,22 @@ pub mod tests {
|
||||
|
||||
add_blocks(&wallet, 2, 5, block_hash).unwrap();
|
||||
|
||||
// Make sure the note exists with the witnesses
|
||||
{
|
||||
let txs = wallet.txs.read().unwrap();
|
||||
assert_eq!(txs[&txid1].notes[0].witnesses.len(), 7);
|
||||
}
|
||||
|
||||
// Invalidate 2 blocks
|
||||
assert_eq!(wallet.last_scanned_height(), 6);
|
||||
assert_eq!(wallet.invalidate_block(5), 2);
|
||||
|
||||
// THe witnesses should be rolledback
|
||||
{
|
||||
let txs = wallet.txs.read().unwrap();
|
||||
assert_eq!(txs[&txid1].notes[0].witnesses.len(), 5);
|
||||
}
|
||||
|
||||
let blk3_hash;
|
||||
let blk4_hash;
|
||||
{
|
||||
@ -2817,6 +2829,7 @@ pub mod tests {
|
||||
assert_eq!(txs[&sent_txid].notes[0].is_change, true);
|
||||
assert_eq!(txs[&sent_txid].notes[0].spent, None);
|
||||
assert_eq!(txs[&sent_txid].notes[0].unconfirmed_spent, None);
|
||||
assert_eq!(txs[&sent_txid].notes[0].witnesses.len(), 1);
|
||||
}
|
||||
|
||||
// Invalidate 3 blocks
|
||||
|
Loading…
x
Reference in New Issue
Block a user