Skip to content

Commit

Permalink
Pretty-print EIP-3076 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelsproul committed Dec 3, 2020
1 parent d3f0a21 commit a586bd6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion validator_client/slashing_protection/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TESTS_TAG := b8413ca42dc92308019d0d4db52c87e9e125c4e9
TESTS_TAG := f495032df9c26c678536cd2b7854e836ea94c217
GENERATE_DIR := generated-tests
OUTPUT_DIR := interchange-tests
TARBALL := $(OUTPUT_DIR)-$(TESTS_TAG).tar.gz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use slashing_protection::interchange_test::{MultiTestCase, TestCase};
use slashing_protection::test_utils::{pubkey, DEFAULT_GENESIS_VALIDATORS_ROOT};
use slashing_protection::SUPPORTED_INTERCHANGE_FORMAT_VERSION;
use std::fs::{self, File};
use std::io::Write;
use std::path::Path;
use types::{Epoch, Hash256, Slot};

Expand Down Expand Up @@ -346,6 +347,7 @@ fn main() {
for test in tests {
test.run();
let f = File::create(output_dir.join(format!("{}.json", test.name))).unwrap();
serde_json::to_writer(f, &test).unwrap();
serde_json::to_writer_pretty(&f, &test).unwrap();
writeln!(&f).unwrap();
}
}

0 comments on commit a586bd6

Please sign in to comment.