Skip to content

Commit 01328a9

Browse files
authored
feat(script): keep script / tx timestamp as milis instead seconds (#10711)
feat(script): keep script timestamp as milis instead seconds
1 parent f914e01 commit 01328a9

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

crates/script-sequence/src/sequence.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub struct ScriptSequence {
3434
/// None if sequence should not be saved to disk (e.g. part of a multi-chain sequence)
3535
pub paths: Option<(PathBuf, PathBuf)>,
3636
pub returns: HashMap<String, NestedValue>,
37-
pub timestamp: u64,
37+
pub timestamp: u128,
3838
pub chain: u64,
3939
pub commit: Option<String>,
4040
}
@@ -101,7 +101,7 @@ impl ScriptSequence {
101101

102102
let Some((path, sensitive_path)) = self.paths.clone() else { return Ok(()) };
103103

104-
self.timestamp = now().as_secs();
104+
self.timestamp = now().as_millis();
105105
let ts_name = format!("run-{}.json", self.timestamp);
106106

107107
let sensitive_script_sequence: SensitiveScriptSequence = self.clone().into();

crates/script/src/multi_sequence.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub struct MultiChainSequence {
1919
pub path: PathBuf,
2020
#[serde(skip)]
2121
pub sensitive_path: PathBuf,
22-
pub timestamp: u64,
22+
pub timestamp: u128,
2323
}
2424

2525
/// Sensitive values from script sequences.
@@ -46,7 +46,7 @@ impl MultiChainSequence {
4646
) -> Result<Self> {
4747
let (path, sensitive_path) = Self::get_paths(config, sig, target, dry_run)?;
4848

49-
Ok(Self { deployments, path, sensitive_path, timestamp: now().as_secs() })
49+
Ok(Self { deployments, path, sensitive_path, timestamp: now().as_millis() })
5050
}
5151

5252
/// Gets paths in the formats
@@ -113,7 +113,7 @@ impl MultiChainSequence {
113113
pub fn save(&mut self, silent: bool, save_ts: bool) -> Result<()> {
114114
self.deployments.iter_mut().for_each(|sequence| sequence.sort_receipts());
115115

116-
self.timestamp = now().as_secs();
116+
self.timestamp = now().as_millis();
117117

118118
let sensitive_sequence = SensitiveMultiChainSequence::from_multi_sequence(self.clone());
119119

crates/script/src/simulate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ impl FilledTransactionsState {
454454
receipts: vec![],
455455
pending: vec![],
456456
paths,
457-
timestamp: now().as_secs(),
457+
timestamp: now().as_millis(),
458458
libraries,
459459
chain,
460460
commit,

0 commit comments

Comments
 (0)