mirror of
https://github.com/pezkuwichain/revive-differential-tests.git
synced 2026-04-24 20:37:56 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e1072cea1a | |||
| be448d78bd | |||
| 523557bc72 | |||
| e0f02878a5 | |||
| 4276fcebf3 | |||
| ae687f8dc6 | |||
| 572daf17c0 |
@@ -18,9 +18,10 @@ inputs:
|
||||
required: false
|
||||
default: "main"
|
||||
type: string
|
||||
resolc-path:
|
||||
description: "The path of the resolc compiler."
|
||||
required: true
|
||||
resolc-version:
|
||||
description: "The version of resolc to install and use in tests."
|
||||
required: false
|
||||
default: "0.5.0"
|
||||
type: string
|
||||
use-compilation-caches:
|
||||
description: "Controls if the compilation caches will be used for the test run or not."
|
||||
@@ -59,6 +60,16 @@ runs:
|
||||
ref: ${{ inputs['revive-differential-tests-ref'] }}
|
||||
path: revive-differential-tests
|
||||
submodules: recursive
|
||||
- name: Installing the Latest Resolc
|
||||
shell: bash
|
||||
if: ${{ runner.os == 'Linux' && runner.arch == 'X64' }}
|
||||
run: |
|
||||
VERSION="${{ inputs['resolc-version'] }}"
|
||||
ASSET_URL="https://github.com/paritytech/revive/releases/download/v$VERSION/resolc-x86_64-unknown-linux-musl"
|
||||
echo "Downloading resolc v$VERSION from $ASSET_URL"
|
||||
curl -Lsf --show-error -o resolc "$ASSET_URL"
|
||||
chmod +x resolc
|
||||
./resolc --version
|
||||
- name: Installing Retester
|
||||
shell: bash
|
||||
run: ${{ inputs['cargo-command'] }} install --locked --path revive-differential-tests/crates/core
|
||||
@@ -113,8 +124,9 @@ runs:
|
||||
--revive-dev-node.path ${{ inputs['polkadot-sdk-path'] }}/target/release/revive-dev-node \
|
||||
--eth-rpc.path ${{ inputs['polkadot-sdk-path'] }}/target/release/eth-rpc \
|
||||
--polkadot-omni-node.path ${{ inputs['polkadot-sdk-path'] }}/target/release/polkadot-omni-node \
|
||||
--resolc.path ${{ inputs['resolc-path'] }} \
|
||||
--resolc.heap-size 500000 \
|
||||
--resolc.path ./resolc \
|
||||
--resolc.heap-size 128000 \
|
||||
--resolc.stack-size 128000 \
|
||||
"${OMNI_ARGS[@]}" || true
|
||||
- name: Generate the expectation file
|
||||
shell: bash
|
||||
|
||||
@@ -32,12 +32,8 @@ pub enum PlatformIdentifier {
|
||||
/// The Lighthouse Go-ethereum reference full node EVM implementation with the solc compiler.
|
||||
LighthouseGethEvmSolc,
|
||||
/// The revive dev node with the PolkaVM backend with the resolc compiler.
|
||||
#[strum(serialize = "revive-dev-node-polkavm-resolc", serialize = "pez-revive-dev-node-polkavm-resolc")]
|
||||
#[serde(alias = "pez-revive-dev-node-polkavm-resolc")]
|
||||
ReviveDevNodePolkavmResolc,
|
||||
/// The revive dev node with the REVM backend with the solc compiler.
|
||||
#[strum(serialize = "revive-dev-node-revm-solc", serialize = "pez-revive-dev-node-revm-solc")]
|
||||
#[serde(alias = "pez-revive-dev-node-revm-solc")]
|
||||
ReviveDevNodeRevmSolc,
|
||||
/// A zombienet based Substrate/Polkadot node with the PolkaVM backend with the resolc compiler.
|
||||
ZombienetPolkavmResolc,
|
||||
@@ -102,8 +98,6 @@ pub enum NodeIdentifier {
|
||||
/// The go-ethereum node implementation.
|
||||
LighthouseGeth,
|
||||
/// The revive dev node implementation.
|
||||
#[strum(serialize = "revive-dev-node", serialize = "pez-revive-dev-node")]
|
||||
#[serde(alias = "pez-revive-dev-node")]
|
||||
ReviveDevNode,
|
||||
/// A zombienet spawned nodes
|
||||
Zombienet,
|
||||
|
||||
@@ -482,16 +482,15 @@ where
|
||||
.context("Failed to find deployment receipt for constructor call"),
|
||||
Method::Fallback | Method::FunctionName(_) => {
|
||||
let resolver = self.platform_information.node.resolver().await?;
|
||||
let mut tx = step
|
||||
let tx = match step
|
||||
.as_transaction(resolver.as_ref(), self.default_resolution_context())
|
||||
.await?;
|
||||
|
||||
let gas_overrides = step
|
||||
.gas_overrides
|
||||
.get(&self.platform_information.platform.platform_identifier())
|
||||
.copied()
|
||||
.unwrap_or_default();
|
||||
gas_overrides.apply_to::<Ethereum>(&mut tx);
|
||||
.await
|
||||
{
|
||||
Ok(tx) => tx,
|
||||
Err(err) => {
|
||||
return Err(err);
|
||||
}
|
||||
};
|
||||
|
||||
self.platform_information.node.execute_transaction(tx).await
|
||||
}
|
||||
@@ -912,6 +911,7 @@ where
|
||||
.get(contract_instance)
|
||||
{
|
||||
info!(
|
||||
|
||||
%address,
|
||||
"Contract instance already deployed."
|
||||
);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
use std::{collections::HashMap, fmt::Display, str::FromStr};
|
||||
|
||||
use alloy::hex::ToHexExt;
|
||||
use alloy::network::Network;
|
||||
use alloy::primitives::{FixedBytes, utils::parse_units};
|
||||
use alloy::{
|
||||
eips::BlockNumberOrTag,
|
||||
@@ -12,7 +11,6 @@ use alloy::{
|
||||
};
|
||||
use anyhow::Context as _;
|
||||
use futures::{FutureExt, StreamExt, TryFutureExt, TryStreamExt, stream};
|
||||
use revive_dt_common::types::PlatformIdentifier;
|
||||
use schemars::JsonSchema;
|
||||
use semver::VersionReq;
|
||||
use serde::{Deserialize, Serialize};
|
||||
@@ -154,11 +152,6 @@ pub struct FunctionCallStep {
|
||||
/// during the execution.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub variable_assignments: Option<VariableAssignments>,
|
||||
|
||||
/// Allows for the test to set a specific value for the various gas parameter for each one of
|
||||
/// the platforms we support. This is ignored for steps that perform contract deployments.
|
||||
#[serde(default, skip_serializing_if = "HashMap::is_empty")]
|
||||
pub gas_overrides: HashMap<PlatformIdentifier, GasOverrides>,
|
||||
}
|
||||
|
||||
/// This represents a balance assertion step where the framework needs to query the balance of some
|
||||
@@ -972,62 +965,6 @@ impl<'de> Deserialize<'de> for EtherValue {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Default, Serialize, Deserialize, Eq, PartialEq, JsonSchema)]
|
||||
pub struct GasOverrides {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub gas_limit: Option<u64>,
|
||||
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub gas_price: Option<u128>,
|
||||
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub max_fee_per_gas: Option<u128>,
|
||||
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub max_priority_fee_per_gas: Option<u128>,
|
||||
}
|
||||
|
||||
impl GasOverrides {
|
||||
pub fn new() -> Self {
|
||||
Default::default()
|
||||
}
|
||||
|
||||
pub fn with_gas_limit(mut self, value: impl Into<Option<u64>>) -> Self {
|
||||
self.gas_limit = value.into();
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_gas_price(mut self, value: impl Into<Option<u128>>) -> Self {
|
||||
self.gas_price = value.into();
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_max_fee_per_gas(mut self, value: impl Into<Option<u128>>) -> Self {
|
||||
self.max_fee_per_gas = value.into();
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_max_priority_fee_per_gas(mut self, value: impl Into<Option<u128>>) -> Self {
|
||||
self.max_priority_fee_per_gas = value.into();
|
||||
self
|
||||
}
|
||||
|
||||
pub fn apply_to<N: Network>(&self, transaction_request: &mut N::TransactionRequest) {
|
||||
if let Some(gas_limit) = self.gas_limit {
|
||||
transaction_request.set_gas_limit(gas_limit);
|
||||
}
|
||||
if let Some(gas_price) = self.gas_price {
|
||||
transaction_request.set_gas_price(gas_price);
|
||||
}
|
||||
if let Some(max_fee_per_gas) = self.max_fee_per_gas {
|
||||
transaction_request.set_max_fee_per_gas(max_fee_per_gas);
|
||||
}
|
||||
if let Some(max_priority_fee_per_gas) = self.max_priority_fee_per_gas {
|
||||
transaction_request.set_max_priority_fee_per_gas(max_priority_fee_per_gas)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
|
||||
|
||||
+1
-1
Submodule resolc-compiler-tests updated: 9522e30552...d5185923e0
Reference in New Issue
Block a user