fix: PoxInfo default for scan commands

This commit is contained in:
Ludo Galabru
2023-04-03 10:44:47 -04:00
parent ab022e6098
commit a00ccf589a
2 changed files with 8 additions and 4 deletions

View File

@@ -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"

View File

@@ -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 {