Skip to content

Commit

Permalink
Merge pull request #3607 from stacks-network/fix/mempool-sync-tests
Browse files Browse the repository at this point in the history
fix/ updated mempool sync protocol tests
  • Loading branch information
jcnelson committed Mar 21, 2023
2 parents 8432df3 + 441490e commit c622b89
Show file tree
Hide file tree
Showing 2 changed files with 762 additions and 776 deletions.
17 changes: 13 additions & 4 deletions src/net/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2936,10 +2936,8 @@ pub mod test {
}

pub fn step(&mut self) -> Result<NetworkResult, net_error> {
let mut sortdb = self.sortdb.take().unwrap();
let mut stacks_node = self.stacks_node.take().unwrap();
let mut mempool = self.mempool.take().unwrap();

let sortdb = self.sortdb.take().unwrap();
let stacks_node = self.stacks_node.take().unwrap();
let burn_tip_height = SortitionDB::get_canonical_burn_chain_tip(sortdb.conn())
.unwrap()
.block_height;
Expand All @@ -2954,6 +2952,17 @@ pub mod test {
stacks_tip_height,
burn_tip_height,
);
self.sortdb = Some(sortdb);
self.stacks_node = Some(stacks_node);

self.step_with_ibd(ibd)
}

pub fn step_with_ibd(&mut self, ibd: bool) -> Result<NetworkResult, net_error> {
let mut sortdb = self.sortdb.take().unwrap();
let mut stacks_node = self.stacks_node.take().unwrap();
let mut mempool = self.mempool.take().unwrap();

let indexer = BitcoinIndexer::new_unit_test(&self.config.burnchain.working_dir);

let ret = self.network.run(
Expand Down
Loading

0 comments on commit c622b89

Please sign in to comment.