mirror of
https://github.com/pezkuwichain/revive-differential-tests.git
synced 2026-06-17 17:01:05 +00:00
@@ -207,6 +207,18 @@ impl Node for Instance {
|
|||||||
_ => anyhow::bail!("expected a diff mode trace"),
|
_ => anyhow::bail!("expected a diff mode trace"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn version(&self) -> anyhow::Result<String> {
|
||||||
|
let output = Command::new(&self.geth)
|
||||||
|
.arg("--version")
|
||||||
|
.stdin(Stdio::null())
|
||||||
|
.stdout(Stdio::piped())
|
||||||
|
.stderr(Stdio::null())
|
||||||
|
.spawn()?
|
||||||
|
.wait_with_output()?
|
||||||
|
.stdout;
|
||||||
|
Ok(String::from_utf8_lossy(&output).into())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Drop for Instance {
|
impl Drop for Instance {
|
||||||
@@ -252,4 +264,13 @@ mod tests {
|
|||||||
.spawn(GENESIS_JSON.to_string())
|
.spawn(GENESIS_JSON.to_string())
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn version_works() {
|
||||||
|
let version = Instance::new(&test_config().0).unwrap().version().unwrap();
|
||||||
|
assert!(
|
||||||
|
version.starts_with("geth version"),
|
||||||
|
"expected version string, got: '{version}'"
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,4 +25,7 @@ pub trait Node: EthereumNode {
|
|||||||
|
|
||||||
/// Returns the state diff of the transaction hash in the [TransactionReceipt].
|
/// Returns the state diff of the transaction hash in the [TransactionReceipt].
|
||||||
fn state_diff(&self, transaction: TransactionReceipt) -> anyhow::Result<DiffMode>;
|
fn state_diff(&self, transaction: TransactionReceipt) -> anyhow::Result<DiffMode>;
|
||||||
|
|
||||||
|
/// Returns the node version.
|
||||||
|
fn version(&self) -> anyhow::Result<String>;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user