Skip to content

Commit

Permalink
Removes unused imports. Refactors code for correctness in genesis byt…
Browse files Browse the repository at this point in the history
…es reference and tokio pause() call
  • Loading branch information
Elijah Hampton committed Jan 21, 2025
1 parent 23515b6 commit 4a89e08
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions zebra-rpc/src/methods/tests/prop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ use tower::buffer::Buffer;

use zebra_chain::{
amount::{Amount, NonNegative},
block::{self, Block, Header, Height},
block::{self, Block, Height},
chain_tip::{mock::MockChainTip, ChainTip, NoChainTip},
parameters::{ConsensusBranchId, Network, NetworkUpgrade},
serialization::{DateTime32, ZcashDeserialize, ZcashDeserializeInto, ZcashSerialize},
serialization::{ZcashDeserialize, ZcashDeserializeInto, ZcashSerialize},
transaction::{self, Transaction, UnminedTx, VerifiedUnminedTx},
transparent,
value_balance::ValueBalance,
work::equihash::Solution,
};
use zebra_node_services::mempool;
use zebra_state::{BoxError, HashOrHeight};
Expand Down Expand Up @@ -503,23 +502,22 @@ proptest! {
let _guard = runtime.enter();
let (mut mempool, mut state, rpc, mempool_tx_queue) = mock_services(network.clone(), NoChainTip);

// CORRECTNESS: Nothing in this test depends on real time, so we can speed it up.
tokio::time::pause();

let genesis_block = match network {
Network::Mainnet => {
let block_bytes = zebra_test::vectors::CONTINUOUS_MAINNET_BLOCKS[&0];
let block_bytes = &zebra_test::vectors::BLOCK_MAINNET_GENESIS_BYTES;
let block: Arc<Block> = block_bytes.zcash_deserialize_into().expect("block is valid");
block
},
Network::Testnet(_) => {
let block_bytes = zebra_test::vectors::CONTINUOUS_TESTNET_BLOCKS[&0];
let block_bytes = &zebra_test::vectors::BLOCK_MAINNET_GENESIS_BYTES;
let block: Arc<Block> = block_bytes.zcash_deserialize_into().expect("block is valid");
block
},
};

// CORRECTNESS: Nothing in this test depends on real time, so we can speed it up.
tokio::time::pause();

// Genesis block fields
let block_time = genesis_block.header.time;
let block_version = genesis_block.header.version;
Expand Down

0 comments on commit 4a89e08

Please sign in to comment.