Clean up tests at then end
@@ -205,8 +205,6 @@ impl ProtocolTester {
where
F: FnOnce(ProtocolTester),
{
- //delete a state file if present
- fs::remove_file("test_chain_id_priv_validator_state.json").unwrap();
let tcp_device = KmsProcess::create_tcp();
let tcp_connection = tcp_device.create_connection();
@@ -226,6 +224,8 @@ impl Drop for ProtocolTester {
fn drop(&mut self) {
self.tcp_device.process.kill().unwrap();
self.unix_device.process.kill().unwrap();
+ fs::remove_file("test_chain_id_priv_validator_state.json").unwrap();
+
}
}
