mirror of
https://github.com/pezkuwichain/revive-differential-tests.git
synced 2026-04-22 23:07:58 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 540a662f20 | |||
| 16d526a9ab |
@@ -9,3 +9,5 @@ node_modules
|
||||
*.log
|
||||
|
||||
profile.json.gz
|
||||
resolc-compiler-tests
|
||||
workdir
|
||||
|
||||
@@ -499,6 +499,10 @@ impl ResolverApi for GethNode {
|
||||
}
|
||||
|
||||
impl Node for GethNode {
|
||||
fn name() -> &'static str {
|
||||
"geth"
|
||||
}
|
||||
|
||||
fn new(config: &Arguments) -> Self {
|
||||
let geth_directory = config.directory().join(Self::BASE_DIRECTORY);
|
||||
let id = NODE_COUNT.fetch_add(1, Ordering::SeqCst);
|
||||
|
||||
@@ -105,7 +105,11 @@ impl KitchensinkNode {
|
||||
.arg("export-chain-spec")
|
||||
.arg("--chain")
|
||||
.arg("dev")
|
||||
.output()?;
|
||||
.output()
|
||||
.context(format!(
|
||||
"Failed to export chain spec with {}",
|
||||
self.substrate_binary.display()
|
||||
))?;
|
||||
|
||||
if !output.status.success() {
|
||||
anyhow::bail!(
|
||||
@@ -515,6 +519,10 @@ impl ResolverApi for KitchensinkNode {
|
||||
}
|
||||
|
||||
impl Node for KitchensinkNode {
|
||||
fn name() -> &'static str {
|
||||
"kitchensink"
|
||||
}
|
||||
|
||||
fn new(config: &Arguments) -> Self {
|
||||
let kitchensink_directory = config.directory().join(Self::BASE_DIRECTORY);
|
||||
let id = NODE_COUNT.fetch_add(1, Ordering::SeqCst);
|
||||
|
||||
@@ -15,6 +15,9 @@ pub const GENESIS_JSON: &str = include_str!("../../../genesis.json");
|
||||
|
||||
/// An abstract interface for testing nodes.
|
||||
pub trait Node: EthereumNode {
|
||||
/// The name of the node implementation.
|
||||
fn name() -> &'static str;
|
||||
|
||||
/// Create a new uninitialized instance.
|
||||
fn new(config: &Arguments) -> Self;
|
||||
|
||||
|
||||
Executable
+61
@@ -0,0 +1,61 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Revive Differential Tests - Quick Start Script
|
||||
# This script clones the test repository, sets up the corpus file, and runs the tool
|
||||
|
||||
set -e # Exit on any error
|
||||
|
||||
# Colors for output
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
# Configuration
|
||||
TEST_REPO_URL="https://github.com/paritytech/resolc-compiler-tests"
|
||||
TEST_REPO_DIR="resolc-compiler-tests"
|
||||
CORPUS_FILE="./corpus.json"
|
||||
WORKDIR="workdir"
|
||||
|
||||
echo -e "${GREEN}=== Revive Differential Tests Quick Start ===${NC}"
|
||||
echo ""
|
||||
|
||||
# Check if test repo already exists
|
||||
if [ -d "$TEST_REPO_DIR" ]; then
|
||||
echo -e "${YELLOW}Test repository already exists. Pulling latest changes...${NC}"
|
||||
cd "$TEST_REPO_DIR"
|
||||
git pull
|
||||
cd ..
|
||||
else
|
||||
echo -e "${GREEN}Cloning test repository...${NC}"
|
||||
git clone "$TEST_REPO_URL"
|
||||
fi
|
||||
|
||||
# Create corpus file with absolute path resolved at runtime
|
||||
echo -e "${GREEN}Creating corpus file...${NC}"
|
||||
ABSOLUTE_PATH=$(realpath "$TEST_REPO_DIR/fixtures/solidity/simple/yul_instructions/codesize.sol")
|
||||
|
||||
cat > "$CORPUS_FILE" << EOF
|
||||
{
|
||||
"name": "MatterLabs Solidity Simple, Complex, and Semantic Tests",
|
||||
"path": "$ABSOLUTE_PATH"
|
||||
}
|
||||
EOF
|
||||
|
||||
echo -e "${GREEN}Corpus file created: $CORPUS_FILE${NC}"
|
||||
|
||||
# Create workdir if it doesn't exist
|
||||
mkdir -p "$WORKDIR"
|
||||
|
||||
echo -e "${GREEN}Starting differential tests...${NC}"
|
||||
echo "This may take a while..."
|
||||
echo ""
|
||||
|
||||
# Run the tool
|
||||
RUST_LOG="error" cargo run --release -- \
|
||||
--kitchensink "$(realpath ~/polkadot-sdk/target/debug/substrate-node)" \
|
||||
--eth_proxy "$(realpath ~/polkadot-sdk/target/debug/eth-rpc)" \
|
||||
--corpus "$CORPUS_FILE" \
|
||||
--workdir "$WORKDIR" \
|
||||
|
||||
echo -e "${GREEN}=== Test run completed! ===${NC}"
|
||||
Reference in New Issue
Block a user