Skip to content

Commit

Permalink
Merge branch 'develop' into chore/open-api-nit
Browse files Browse the repository at this point in the history
  • Loading branch information
pavitthrap authored Jun 7, 2023
2 parents 6dbcab0 + 05ba57b commit 7a0e572
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 22 deletions.
2 changes: 1 addition & 1 deletion clarity/src/vm/docs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2764,7 +2764,7 @@ mod test {
Some(StacksEpoch {
epoch_id: StacksEpochId::Epoch21,
start_height: 0,
end_height: u64::max_value(),
end_height: u64::MAX,
block_limit: ExecutionCost::max_value(),
network_epoch: PEER_VERSION_EPOCH_2_1,
})
Expand Down
4 changes: 2 additions & 2 deletions src/chainstate/stacks/boot/contract_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ impl ClarityTestSim {
marf,
height: 0,
fork: 0,
epoch_bounds: vec![0, u64::max_value()],
epoch_bounds: vec![0, u64::MAX],
}
}

Expand Down Expand Up @@ -390,7 +390,7 @@ impl BurnStateDB for TestSimBurnStateDB {
.epoch_bounds
.get(epoch_begin_index + 1)
.cloned()
.unwrap_or(u64::max_value()),
.unwrap_or(u64::MAX),
epoch_id,
block_limit: ExecutionCost::max_value(),
network_epoch: PEER_VERSION_EPOCH_1_0,
Expand Down
4 changes: 2 additions & 2 deletions src/chainstate/stacks/miner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,15 @@ pub struct BlockBuilderSettings {
impl BlockBuilderSettings {
pub fn limited() -> BlockBuilderSettings {
BlockBuilderSettings {
max_miner_time_ms: u64::max_value(),
max_miner_time_ms: u64::MAX,
mempool_settings: MemPoolWalkSettings::default(),
miner_status: Arc::new(Mutex::new(MinerStatus::make_ready(0))),
}
}

pub fn max_value() -> BlockBuilderSettings {
BlockBuilderSettings {
max_miner_time_ms: u64::max_value(),
max_miner_time_ms: u64::MAX,
mempool_settings: MemPoolWalkSettings::zero(),
miner_status: Arc::new(Mutex::new(MinerStatus::make_ready(0))),
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/mempool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ impl MemPoolWalkSettings {
pub fn default() -> MemPoolWalkSettings {
MemPoolWalkSettings {
min_tx_fee: 1,
max_walk_time_ms: u64::max_value(),
max_walk_time_ms: u64::MAX,
consider_no_estimate_tx_prob: 5,
nonce_cache_size: 1024 * 1024,
candidate_retry_cache_size: 64 * 1024,
Expand All @@ -323,7 +323,7 @@ impl MemPoolWalkSettings {
pub fn zero() -> MemPoolWalkSettings {
MemPoolWalkSettings {
min_tx_fee: 0,
max_walk_time_ms: u64::max_value(),
max_walk_time_ms: u64::MAX,
consider_no_estimate_tx_prob: 5,
nonce_cache_size: 1024 * 1024,
candidate_retry_cache_size: 64 * 1024,
Expand Down
2 changes: 1 addition & 1 deletion src/cost_estimates/pessimistic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ impl Samples {
fn flush_sqlite(&self, tx: &SqliteTransaction, identifier: &str) {
let sql = "INSERT OR REPLACE INTO pessimistic_estimator
(estimate_key, current_value, samples) VALUES (?, ?, ?)";
let current_value = u64_to_sql(self.mean()).unwrap_or_else(|_| i64::max_value());
let current_value = u64_to_sql(self.mean()).unwrap_or_else(|_| i64::MAX);
tx.execute(
sql,
rusqlite::params![identifier, current_value, self.to_json()],
Expand Down
2 changes: 1 addition & 1 deletion src/deps/httparse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1269,7 +1269,7 @@ mod tests {
assert_eq!(parse_chunk_size(b"567xf8a\r\n"), Err(Error::ChunkSize));
assert_eq!(
parse_chunk_size(b"ffffffffffffffff\r\n"),
Ok(Status::Complete((18, u64::max_value())))
Ok(Status::Complete((18, u64::MAX)))
);
assert_eq!(
parse_chunk_size(b"1ffffffffffffffff\r\n"),
Expand Down
16 changes: 4 additions & 12 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -734,8 +734,8 @@ simulating a miner.
let sort_db_path = format!("{}/mainnet/burnchain/sortition", &argv[2]);
let chain_state_path = format!("{}/mainnet/chainstate/", &argv[2]);

let mut min_fee = u64::max_value();
let mut max_time = u64::max_value();
let mut min_fee = u64::MAX;
let mut max_time = u64::MAX;

if argv.len() >= 4 {
min_fee = argv[3].parse().expect("Could not parse min_fee");
Expand Down Expand Up @@ -1122,11 +1122,7 @@ simulating a miner.
let burnchain = Burnchain::regtest(&burnchain_db_path);
let first_burnchain_block_height = burnchain.first_block_height;
let first_burnchain_block_hash = burnchain.first_block_hash;
let epochs = StacksEpoch::all(
first_burnchain_block_height,
u64::max_value(),
u64::max_value(),
);
let epochs = StacksEpoch::all(first_burnchain_block_height, u64::MAX, u64::MAX);
let (mut new_sortition_db, _) = burnchain
.connect_db(
true,
Expand Down Expand Up @@ -1211,11 +1207,7 @@ simulating a miner.
let mut known_stacks_blocks = HashSet::new();
let mut next_arrival = 0;

let epochs = StacksEpoch::all(
first_burnchain_block_height,
u64::max_value(),
u64::max_value(),
);
let epochs = StacksEpoch::all(first_burnchain_block_height, u64::MAX, u64::MAX);

let (p2p_new_sortition_db, _) = burnchain
.connect_db(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl OutPoint {
pub fn null() -> OutPoint {
OutPoint {
txid: Default::default(),
vout: u32::max_value(),
vout: u32::MAX,
}
}

Expand Down

0 comments on commit 7a0e572

Please sign in to comment.