assert 2 items in stores don't have same slot and version with different values (#15250)
* assert 2 items in stores don't have same slot and version with different values * add message to assert
This commit is contained in:
parent
17a328bc6f
commit
708b8380b7
|
@ -4097,6 +4097,14 @@ impl AccountsDB {
|
||||||
i = k;
|
i = k;
|
||||||
look_for_first_key = false;
|
look_for_first_key = false;
|
||||||
continue 'outer;
|
continue 'outer;
|
||||||
|
} else {
|
||||||
|
let prev = &slice[k - 1];
|
||||||
|
assert!(
|
||||||
|
!(prev.slot == now.slot
|
||||||
|
&& prev.version == now.version
|
||||||
|
&& (prev.hash != now.hash || prev.lamports != now.lamports)),
|
||||||
|
"Conflicting store data. Pubkey: {}, Slot: {}, Version: {}, Hashes: {}, {}, Lamports: {}, {}", now.pubkey, now.slot, now.version, prev.hash, now.hash, prev.lamports, now.lamports
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5938,7 +5946,13 @@ pub mod tests {
|
||||||
.zip(keys.iter())
|
.zip(keys.iter())
|
||||||
.enumerate()
|
.enumerate()
|
||||||
.map(|(i, (hash, key))| {
|
.map(|(i, (hash, key))| {
|
||||||
CalculateHashIntermediate::new(VERSION, hash, (i + 1) as u64, Slot::default(), *key)
|
CalculateHashIntermediate::new(
|
||||||
|
VERSION,
|
||||||
|
hash,
|
||||||
|
(i + 1) as u64,
|
||||||
|
u64::MAX - i as u64,
|
||||||
|
*key,
|
||||||
|
)
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue