Zcashd integration is based on branch id.

This commit is contained in:
Kris Nuttycombe 2020-09-24 17:29:38 -06:00
parent 03b4e56a44
commit e4e159b117
1 changed files with 4 additions and 4 deletions

View File

@ -1,7 +1,7 @@
//! Consensus logic for Transparent Zcash Extensions.
use std::convert::TryFrom;
use zcash_primitives::consensus::{BlockHeight, NetworkUpgrade};
use zcash_primitives::consensus::{BlockHeight, BranchId};
use zcash_primitives::extensions::transparent::{Error, Extension, Precondition, Witness};
use zcash_primitives::transaction::{components::TzeOut, Transaction};
@ -113,10 +113,10 @@ impl Epoch for EpochVTest {
}
}
pub fn epoch_for_branch(network_upgrade: NetworkUpgrade) -> Option<Box<dyn Epoch<Error = String>>> {
pub fn epoch_for_branch(branch_id: BranchId) -> Option<Box<dyn Epoch<Error = String>>> {
// Map from consensus branch IDs to epochs.
match network_upgrade {
NetworkUpgrade::ZFuture => Some(Box::new(EpochVTest)),
match branch_id {
BranchId::ZFuture => Some(Box::new(EpochVTest)),
_ => None,
}
}