changed slot_length to u32

This commit is contained in:
alessandrokonrad 2022-10-16 20:32:24 -04:00 committed by Lucas
parent 28b9fed8e5
commit a14dae5863
4 changed files with 4 additions and 4 deletions

View File

@ -50,7 +50,7 @@ pub enum TxCommand {
/// Time between each slot /// Time between each slot
#[clap(short, long, default_value_t = 1000)] #[clap(short, long, default_value_t = 1000)]
slot_length: u64, slot_length: u32,
/// Time of shelley hardfork /// Time of shelley hardfork
#[clap(long, default_value_t = 1596059091000)] #[clap(long, default_value_t = 1596059091000)]

View File

@ -74,7 +74,7 @@ pub fn eval_phase_two_raw(
utxos_bytes: &[(Vec<u8>, Vec<u8>)], utxos_bytes: &[(Vec<u8>, Vec<u8>)],
cost_mdls_bytes: &[u8], cost_mdls_bytes: &[u8],
initial_budget: (u64, u64), initial_budget: (u64, u64),
slot_config: (u64, u64, u64), slot_config: (u64, u64, u32),
run_phase_one: bool, run_phase_one: bool,
) -> Result<Vec<Vec<u8>>, Error> { ) -> Result<Vec<Vec<u8>>, Error> {
let multi_era_tx = MultiEraTx::decode(Era::Babbage, tx_bytes) let multi_era_tx = MultiEraTx::decode(Era::Babbage, tx_bytes)

View File

@ -24,7 +24,7 @@ use super::{
}; };
fn slot_to_begin_posix_time(slot: u64, sc: &SlotConfig) -> u64 { fn slot_to_begin_posix_time(slot: u64, sc: &SlotConfig) -> u64 {
let ms_after_begin = (slot - sc.zero_slot) * sc.slot_length; let ms_after_begin = (slot - sc.zero_slot) * sc.slot_length as u64;
sc.zero_time + ms_after_begin sc.zero_time + ms_after_begin
} }

View File

@ -83,7 +83,7 @@ pub struct TimeRange {
} }
pub struct SlotConfig { pub struct SlotConfig {
pub slot_length: u64, pub slot_length: u32,
pub zero_slot: u64, pub zero_slot: u64,
pub zero_time: u64, pub zero_time: u64,
} }