mirror of
https://github.com/alexgo-io/bitcoin-indexer.git
synced 2026-01-12 16:52:57 +08:00
fix: PoxInfo default for scan commands
This commit is contained in:
@@ -12,7 +12,7 @@ serde = "1"
|
||||
serde_json = { version = "1", features = ["arbitrary_precision"] }
|
||||
serde-hex = "0.1.0"
|
||||
serde_derive = "1"
|
||||
stacks-rpc-client = "1"
|
||||
stacks-rpc-client = "=1.0.1"
|
||||
clarinet-utils = "1"
|
||||
clarity-repl = "=1.5.0"
|
||||
hiro-system-kit = "0.1.0"
|
||||
|
||||
@@ -29,10 +29,14 @@ pub struct StacksChainContext {
|
||||
}
|
||||
|
||||
impl StacksChainContext {
|
||||
pub fn new() -> StacksChainContext {
|
||||
pub fn new(network: &StacksNetwork) -> StacksChainContext {
|
||||
StacksChainContext {
|
||||
asset_class_map: HashMap::new(),
|
||||
pox_info: PoxInfo::default(),
|
||||
pox_info: match network {
|
||||
StacksNetwork::Mainnet => PoxInfo::mainnet_default(),
|
||||
StacksNetwork::Testnet => PoxInfo::testnet_default(),
|
||||
_ => PoxInfo::devnet_default(),
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -68,7 +72,7 @@ impl Indexer {
|
||||
pub fn new(config: IndexerConfig) -> Indexer {
|
||||
let stacks_blocks_pool = StacksBlockPool::new();
|
||||
let bitcoin_blocks_pool = ForkScratchPad::new();
|
||||
let stacks_context = StacksChainContext::new();
|
||||
let stacks_context = StacksChainContext::new(&config.stacks_network);
|
||||
let bitcoin_context = BitcoinChainContext::new();
|
||||
|
||||
Indexer {
|
||||
|
||||
Reference in New Issue
Block a user