diff --git a/sequencer/src/bin/deploy.rs b/sequencer/src/bin/deploy.rs index f3dde02922..02939f289d 100644 --- a/sequencer/src/bin/deploy.rs +++ b/sequencer/src/bin/deploy.rs @@ -145,7 +145,11 @@ async fn main() -> anyhow::Result<()> { } if let Some(out) = &opt.out { - let file = File::options().create(true).write(true).open(out)?; + let file = File::options() + .create(true) + .truncate(true) + .write(true) + .open(out)?; contracts.write(file)?; } else { contracts.write(stdout())?; diff --git a/sequencer/src/bin/keygen.rs b/sequencer/src/bin/keygen.rs index f8ead1eb47..f2bf8760c6 100644 --- a/sequencer/src/bin/keygen.rs +++ b/sequencer/src/bin/keygen.rs @@ -138,7 +138,11 @@ fn main() -> anyhow::Result<()> { tracing::info!("generating new key set"); let path = opts.out.join(format!("{index}.env")); - let mut file = File::options().write(true).create(true).open(&path)?; + let mut file = File::options() + .write(true) + .create(true) + .truncate(true) + .open(&path)?; opts.scheme.gen(seed, index as u64, &mut file)?; tracing::info!("private keys written to {}", path.display()); diff --git a/sequencer/src/block/payload.rs b/sequencer/src/block/payload.rs index 0f73afdec0..3a07cc3d18 100644 --- a/sequencer/src/block/payload.rs +++ b/sequencer/src/block/payload.rs @@ -355,7 +355,7 @@ mod test { fn check_basic_correctness() { // play with this - let test_cases = vec![ + let test_cases = [ // 1 namespace only vec![vec![5, 8, 8]], // 3 non-empty txs vec![vec![0, 8, 8]], // 1 empty tx at the beginning