mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-06-17 10:51:22 +08:00
add get_stacks_epoch() to BurnStateDB
This commit is contained in:
@@ -18,6 +18,8 @@ use crate::types::chainstate::{BlockHeaderHash, BurnchainHeaderHash, SortitionId
|
||||
use crate::types::chainstate::{StacksAddress, VRFSeed};
|
||||
use crate::types::proof::{ClarityMarfTrieId, TrieMerkleProof};
|
||||
|
||||
use core::StacksEpoch;
|
||||
|
||||
pub mod marf;
|
||||
|
||||
impl HeadersDB for DBConn {
|
||||
@@ -97,6 +99,11 @@ impl BurnStateDB for SortitionHandleTx<'_> {
|
||||
_ => return None,
|
||||
}
|
||||
}
|
||||
|
||||
fn get_stacks_epoch(&self, height: u32) -> Option<StacksEpoch> {
|
||||
SortitionDB::get_stacks_epoch(self.tx(), height as u64)
|
||||
.expect("BUG: failed to get epoch for burn block height")
|
||||
}
|
||||
}
|
||||
|
||||
impl BurnStateDB for SortitionDBConn<'_> {
|
||||
@@ -118,6 +125,11 @@ impl BurnStateDB for SortitionDBConn<'_> {
|
||||
_ => return None,
|
||||
}
|
||||
}
|
||||
|
||||
fn get_stacks_epoch(&self, height: u32) -> Option<StacksEpoch> {
|
||||
SortitionDB::get_stacks_epoch(self.conn(), height as u64)
|
||||
.expect("BUG: failed to get epoch for burn block height")
|
||||
}
|
||||
}
|
||||
|
||||
pub struct MemoryBackingStore {
|
||||
|
||||
Reference in New Issue
Block a user