fix(merkle): fix overflow in to_scalar_index for nodes at depth 64
This commit is contained in:
parent
e5dd7c6d6a
commit
0e7e6705d8
1 changed files with 2 additions and 2 deletions
|
@ -114,8 +114,8 @@ impl NodeIndex {
|
||||||
/// Returns the scalar representation of the depth/value pair.
|
/// Returns the scalar representation of the depth/value pair.
|
||||||
///
|
///
|
||||||
/// It is computed as `2^depth + value`.
|
/// It is computed as `2^depth + value`.
|
||||||
pub const fn to_scalar_index(&self) -> u64 {
|
pub const fn to_scalar_index(&self) -> u128 {
|
||||||
(1 << self.depth as u64) + self.value
|
(1 << self.depth as u64) + (self.value as u128)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the depth of the current instance.
|
/// Returns the depth of the current instance.
|
||||||
|
|
Loading…
Add table
Reference in a new issue