Retype num_ticks as u64 to reduce casting
This commit is contained in:
@ -376,10 +376,7 @@ mod test {
|
|||||||
max_tick_height,
|
max_tick_height,
|
||||||
);
|
);
|
||||||
|
|
||||||
let ticks = create_ticks(
|
let ticks = create_ticks(max_tick_height - start_tick_height, Hash::default());
|
||||||
(max_tick_height - start_tick_height) as usize,
|
|
||||||
Hash::default(),
|
|
||||||
);
|
|
||||||
for (i, mut tick) in ticks.into_iter().enumerate() {
|
for (i, mut tick) in ticks.into_iter().enumerate() {
|
||||||
// Simulate the tick heights generated in poh.rs
|
// Simulate the tick heights generated in poh.rs
|
||||||
tick.tick_height = start_tick_height + i as u64 + 1;
|
tick.tick_height = start_tick_height + i as u64 + 1;
|
||||||
|
@ -895,7 +895,7 @@ pub fn create_tmp_genesis(
|
|||||||
pub fn create_tmp_sample_ledger(
|
pub fn create_tmp_sample_ledger(
|
||||||
name: &str,
|
name: &str,
|
||||||
num_tokens: u64,
|
num_tokens: u64,
|
||||||
num_ending_ticks: usize,
|
num_ending_ticks: u64,
|
||||||
bootstrap_leader_id: Pubkey,
|
bootstrap_leader_id: Pubkey,
|
||||||
bootstrap_leader_tokens: u64,
|
bootstrap_leader_tokens: u64,
|
||||||
) -> (GenesisBlock, Keypair, String, Vec<Entry>) {
|
) -> (GenesisBlock, Keypair, String, Vec<Entry>) {
|
||||||
|
@ -386,9 +386,9 @@ pub fn next_entries(
|
|||||||
next_entries_mut(&mut id, &mut num_hashes, transactions)
|
next_entries_mut(&mut id, &mut num_hashes, transactions)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn create_ticks(num_ticks: usize, mut hash: Hash) -> Vec<Entry> {
|
pub fn create_ticks(num_ticks: u64, mut hash: Hash) -> Vec<Entry> {
|
||||||
let mut ticks = Vec::with_capacity(num_ticks as usize);
|
let mut ticks = Vec::with_capacity(num_ticks as usize);
|
||||||
for _ in 0..num_ticks as u64 {
|
for _ in 0..num_ticks {
|
||||||
let new_tick = Entry::new(&hash, 0, 1, vec![]);
|
let new_tick = Entry::new(&hash, 0, 1, vec![]);
|
||||||
hash = new_tick.id;
|
hash = new_tick.id;
|
||||||
ticks.push(new_tick);
|
ticks.push(new_tick);
|
||||||
@ -453,7 +453,7 @@ pub fn make_consecutive_blobs(
|
|||||||
start_hash: Hash,
|
start_hash: Hash,
|
||||||
addr: &std::net::SocketAddr,
|
addr: &std::net::SocketAddr,
|
||||||
) -> Vec<SharedBlob> {
|
) -> Vec<SharedBlob> {
|
||||||
let entries = create_ticks(num_blobs_to_make as usize, start_hash);
|
let entries = create_ticks(num_blobs_to_make, start_hash);
|
||||||
|
|
||||||
let blobs = entries.to_shared_blobs();
|
let blobs = entries.to_shared_blobs();
|
||||||
let mut index = start_height;
|
let mut index = start_height;
|
||||||
|
@ -485,7 +485,7 @@ pub fn make_active_set_entries(
|
|||||||
token_source: &Keypair,
|
token_source: &Keypair,
|
||||||
last_entry_id: &Hash,
|
last_entry_id: &Hash,
|
||||||
last_tick_id: &Hash,
|
last_tick_id: &Hash,
|
||||||
num_ending_ticks: usize,
|
num_ending_ticks: u64,
|
||||||
) -> (Vec<Entry>, VoteSignerProxy) {
|
) -> (Vec<Entry>, VoteSignerProxy) {
|
||||||
// 1) Create transfer token entry
|
// 1) Create transfer token entry
|
||||||
let transfer_tx =
|
let transfer_tx =
|
||||||
|
Reference in New Issue
Block a user