use zero consensus ids

This commit is contained in:
Cryptoforge 2020-07-12 22:31:27 -07:00
parent ff0ffc3d1b
commit 1ce4e97632
2 changed files with 6 additions and 6 deletions

View File

@ -5,5 +5,5 @@ pub mod regtest;
pub mod testnet;
pub const SPROUT_CONSENSUS_BRANCH_ID: u32 = 0;
pub const OVERWINTER_CONSENSUS_BRANCH_ID: u32 = 0x5ba8_1b19;
pub const SAPLING_CONSENSUS_BRANCH_ID: u32 = 0x76b8_09bb;
pub const OVERWINTER_CONSENSUS_BRANCH_ID: u32 = 0x6f76_727a;
pub const SAPLING_CONSENSUS_BRANCH_ID: u32 = 0x7361_707a;

View File

@ -135,8 +135,8 @@ impl TryFrom<u32> for BranchId {
fn try_from(value: u32) -> Result<Self, Self::Error> {
match value {
0 => Ok(BranchId::Sprout),
0x5ba8_1b19 => Ok(BranchId::Overwinter),
0x76b8_09bb => Ok(BranchId::Sapling),
0x6f76_727a => Ok(BranchId::Overwinter),
0x7361_707a => Ok(BranchId::Sapling),
0x2bb4_0e60 => Ok(BranchId::Blossom),
0xf5b9_230b => Ok(BranchId::Heartwood),
_ => Err("Unknown consensus branch ID"),
@ -148,8 +148,8 @@ impl From<BranchId> for u32 {
fn from(consensus_branch_id: BranchId) -> u32 {
match consensus_branch_id {
BranchId::Sprout => 0,
BranchId::Overwinter => 0x5ba8_1b19,
BranchId::Sapling => 0x76b8_09bb,
BranchId::Overwinter => 0x6f76_727a,
BranchId::Sapling => 0x7361_707a,
BranchId::Blossom => 0x2bb4_0e60,
BranchId::Heartwood => 0xf5b9_230b,
}