Tweak some assertions to better match their error messages (#2822)
* Change assertion condition to match message Refactor the condition so that the expression is easier to compare to the panic message. * Change comparison order to match panic message Change the order of the equality so that it matches the panic message.
This commit is contained in:
parent
21a3e434bc
commit
800141446c
|
@ -200,7 +200,7 @@ impl NonEmptyHistoryTree {
|
|||
.expect("block must have coinbase height during contextual verification");
|
||||
|
||||
assert!(
|
||||
height - self.current_height == 1,
|
||||
Some(height) == self.current_height + 1,
|
||||
"added block with height {:?} but it must be {:?}+1",
|
||||
height,
|
||||
self.current_height
|
||||
|
|
|
@ -184,7 +184,7 @@ impl<V: Version> Tree<V> {
|
|||
let network_upgrade = NetworkUpgrade::current(self.network, height);
|
||||
|
||||
assert!(
|
||||
self.network_upgrade == network_upgrade,
|
||||
network_upgrade == self.network_upgrade,
|
||||
"added block from network upgrade {:?} but history tree is restricted to {:?}",
|
||||
network_upgrade,
|
||||
self.network_upgrade
|
||||
|
|
Loading…
Reference in New Issue