Implement the core benchmarking components

This commit is contained in:
Omar Abdulla
2025-10-02 18:42:38 +03:00
parent 8762702560
commit ba90c60c1b
29 changed files with 1973 additions and 1168 deletions
-2
View File
@@ -14,8 +14,6 @@ revive-dt-common = { workspace = true }
revive-common = { workspace = true }
alloy = { workspace = true }
alloy-primitives = { workspace = true }
alloy-sol-types = { workspace = true }
anyhow = { workspace = true }
futures = { workspace = true }
regex = { workspace = true }
+6 -6
View File
@@ -1,5 +1,6 @@
use std::{collections::HashMap, fmt::Display, str::FromStr};
use alloy::primitives::{FixedBytes, utils::parse_units};
use alloy::{
eips::BlockNumberOrTag,
json_abi::Function,
@@ -7,7 +8,6 @@ use alloy::{
primitives::{Address, Bytes, U256},
rpc::types::TransactionRequest,
};
use alloy_primitives::{FixedBytes, utils::parse_units};
use anyhow::Context as _;
use futures::{FutureExt, StreamExt, TryFutureExt, TryStreamExt, stream};
use schemars::JsonSchema;
@@ -537,7 +537,7 @@ impl FunctionCallStep {
}
/// Parse this input into a legacy transaction.
pub async fn legacy_transaction(
pub async fn as_transaction(
&self,
resolver: &(impl ResolverApi + ?Sized),
context: ResolutionContext<'_>,
@@ -959,9 +959,9 @@ impl<'de> Deserialize<'de> for EtherValue {
#[cfg(test)]
mod tests {
use alloy::primitives::{BlockHash, BlockNumber, BlockTimestamp, ChainId, TxHash, address};
use alloy::sol_types::SolValue;
use alloy::{eips::BlockNumberOrTag, json_abi::JsonAbi};
use alloy_primitives::{BlockHash, BlockNumber, BlockTimestamp, ChainId, TxHash, address};
use alloy_sol_types::SolValue;
use std::{collections::HashMap, pin::Pin};
use super::*;
@@ -1115,7 +1115,7 @@ mod tests {
let encoded = input.encoded_input(&resolver, context).await.unwrap();
assert!(encoded.0.starts_with(&selector));
type T = (alloy_primitives::Address,);
type T = (alloy::primitives::Address,);
let decoded: T = T::abi_decode(&encoded.0[4..]).unwrap();
assert_eq!(
decoded.0,
@@ -1162,7 +1162,7 @@ mod tests {
let encoded = input.encoded_input(&resolver, context).await.unwrap();
assert!(encoded.0.starts_with(&selector));
type T = (alloy_primitives::Address,);
type T = (alloy::primitives::Address,);
let decoded: T = T::abi_decode(&encoded.0[4..]).unwrap();
assert_eq!(
decoded.0,
+1 -1
View File
@@ -3,8 +3,8 @@ use std::pin::Pin;
use alloy::eips::BlockNumberOrTag;
use alloy::json_abi::JsonAbi;
use alloy::primitives::TxHash;
use alloy::primitives::{Address, BlockHash, BlockNumber, BlockTimestamp, ChainId, U256};
use alloy_primitives::TxHash;
use anyhow::Result;
use crate::metadata::{ContractIdent, ContractInstance};