Balance assertions (#133)

* Make metadata serializable

* Refactor tests to use steps

* Add a balance assertion test step

* Test balance deserialization

* Box the test steps

* Permit size difference in step output
This commit is contained in:
Omar
2025-08-11 15:11:16 +03:00
committed by GitHub
parent 90b2dd4cfe
commit f7fbe094ec
9 changed files with 216 additions and 40 deletions
+9
View File
@@ -371,6 +371,15 @@ impl EthereumNode for GethNode {
_ => anyhow::bail!("expected a diff mode trace"),
}
}
#[tracing::instrument(skip_all, fields(geth_node_id = self.id))]
async fn balance_of(&self, address: Address) -> anyhow::Result<U256> {
self.provider()
.await?
.get_balance(address)
.await
.map_err(Into::into)
}
}
impl ResolverApi for GethNode {
+9
View File
@@ -428,6 +428,15 @@ impl EthereumNode for KitchensinkNode {
_ => anyhow::bail!("expected a diff mode trace"),
}
}
#[tracing::instrument(skip_all, fields(kitchensink_node_id = self.id))]
async fn balance_of(&self, address: Address) -> anyhow::Result<U256> {
self.provider()
.await?
.get_balance(address)
.await
.map_err(Into::into)
}
}
impl ResolverApi for KitchensinkNode {