Replace infra with the dyn infra

This commit is contained in:
Omar Abdulla
2025-09-18 19:59:52 +03:00
parent 92fc7894c0
commit 496bc9a0ec
21 changed files with 556 additions and 693 deletions
+8 -8
View File
@@ -308,7 +308,7 @@ impl Input {
pub async fn encoded_input(
&self,
resolver: &impl ResolverApi,
resolver: &(impl ResolverApi + ?Sized),
context: ResolutionContext<'_>,
) -> anyhow::Result<Bytes> {
match self.method {
@@ -377,7 +377,7 @@ impl Input {
/// Parse this input into a legacy transaction.
pub async fn legacy_transaction(
&self,
resolver: &impl ResolverApi,
resolver: &(impl ResolverApi + ?Sized),
context: ResolutionContext<'_>,
) -> anyhow::Result<TransactionRequest> {
let input_data = self
@@ -466,7 +466,7 @@ impl Calldata {
pub async fn calldata(
&self,
resolver: &impl ResolverApi,
resolver: &(impl ResolverApi + ?Sized),
context: ResolutionContext<'_>,
) -> anyhow::Result<Vec<u8>> {
let mut buffer = Vec::<u8>::with_capacity(self.size_requirement());
@@ -478,7 +478,7 @@ impl Calldata {
pub async fn calldata_into_slice(
&self,
buffer: &mut Vec<u8>,
resolver: &impl ResolverApi,
resolver: &(impl ResolverApi + ?Sized),
context: ResolutionContext<'_>,
) -> anyhow::Result<()> {
match self {
@@ -515,7 +515,7 @@ impl Calldata {
pub async fn is_equivalent(
&self,
other: &[u8],
resolver: &impl ResolverApi,
resolver: &(impl ResolverApi + ?Sized),
context: ResolutionContext<'_>,
) -> anyhow::Result<bool> {
match self {
@@ -557,7 +557,7 @@ impl CalldataItem {
#[instrument(level = "info", skip_all, err)]
async fn resolve(
&self,
resolver: &impl ResolverApi,
resolver: &(impl ResolverApi + ?Sized),
context: ResolutionContext<'_>,
) -> anyhow::Result<U256> {
let mut stack = Vec::<CalldataToken<U256>>::new();
@@ -662,7 +662,7 @@ impl<T: AsRef<str>> CalldataToken<T> {
/// https://github.com/matter-labs/era-compiler-tester/blob/0ed598a27f6eceee7008deab3ff2311075a2ec69/compiler_tester/src/test/case/input/value.rs#L43-L146
async fn resolve(
self,
resolver: &impl ResolverApi,
resolver: &(impl ResolverApi + ?Sized),
context: ResolutionContext<'_>,
) -> anyhow::Result<CalldataToken<U256>> {
match self {
@@ -1010,7 +1010,7 @@ mod tests {
async fn resolve_calldata_item(
input: &str,
deployed_contracts: &HashMap<ContractInstance, (ContractIdent, Address, JsonAbi)>,
resolver: &impl ResolverApi,
resolver: &(impl ResolverApi + ?Sized),
) -> anyhow::Result<U256> {
let context = ResolutionContext::default().with_deployed_contracts(deployed_contracts);
CalldataItem::new(input).resolve(resolver, context).await
+5 -3
View File
@@ -13,8 +13,10 @@ use serde::{Deserialize, Serialize};
use revive_common::EVMVersion;
use revive_dt_common::{
cached_fs::read_to_string, iterators::FilesWithExtensionIterator, macros::define_wrapper_type,
types::Mode,
cached_fs::read_to_string,
iterators::FilesWithExtensionIterator,
macros::define_wrapper_type,
types::{Mode, VmIdentifier},
};
use tracing::error;
@@ -81,7 +83,7 @@ pub struct Metadata {
/// example, if we wish for the metadata file's cases to only be run on PolkaVM then we'd
/// specify a target of "PolkaVM" in here.
#[serde(skip_serializing_if = "Option::is_none")]
pub targets: Option<Vec<String>>,
pub targets: Option<Vec<VmIdentifier>>,
/// A vector of the test cases and workloads contained within the metadata file. This is their
/// primary description.