Skip to content

Commit 7452869

Browse files
authored
Merge pull request #41 from paritytech/pg/update-node-env
update node-env
2 parents 036f1e9 + 78bc19b commit 7452869

File tree

1 file changed

+35
-10
lines changed

1 file changed

+35
-10
lines changed

scripts/node-env.sh

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -722,16 +722,18 @@ function revive_dev_stack() {
722722

723723
# Runs revive differential tests against a local dev node
724724
# Requires ~/github/revive-differential-tests repository to be checked out
725-
# Usage: retester_test <test_path>
726-
# Example:
725+
# Usage: retester_test <test_path> [--pvm]
726+
# Examples:
727727
# retester_test "./resolc-compiler-tests/fixtures/solidity/complex/create/create2_many/test.json"
728+
# retester_test "./resolc-compiler-tests/fixtures/solidity/complex/create/create2_many/test.json" --pvm
728729
function retester_test() {
729730
local test_path="$1"
731+
shift
730732

731733
# Check if test path was provided
732734
if [ -z "$test_path" ]; then
733735
echo "Error: Test path is required"
734-
echo "Usage: retester_test <test_path>"
736+
echo "Usage: retester_test <test_path> [--pvm]"
735737
return 1
736738
fi
737739

@@ -742,13 +744,26 @@ function retester_test() {
742744
return 1
743745
fi
744746

747+
# Parse arguments to detect --pvm flag
748+
local platform="revive-dev-node-revm-solc"
749+
for arg in "$@"; do
750+
if [ "$arg" = "--pvm" ]; then
751+
platform="revive-dev-node-polkavm-resolc"
752+
fi
753+
done
754+
755+
# Prefix with ./resolc-compiler-tests/fixtures/ if path starts with complex or simple
756+
if [[ "$test_path" =~ ^(complex|simple) ]]; then
757+
test_path="resolc-compiler-tests/fixtures/solidity/$test_path"
758+
fi
759+
745760
# Resolve test path relative to RETESTER_DIR
746761
local full_test_path="$RETESTER_DIR/$test_path"
747762

748763
# Run the test
749764
set -x
750765
cargo run --quiet --release --manifest-path "$RETESTER_DIR/Cargo.toml" -- test \
751-
--platform revive-dev-node-revm-solc \
766+
--platform "$platform" \
752767
--profile debug \
753768
--revive-dev-node.existing-rpc-url "http://localhost:8545" \
754769
--test "$full_test_path"
@@ -1084,10 +1099,12 @@ function westend() {
10841099
# cast_passet
10851100
# cast send --value 0.1ether 0x... --private-key $PRIVATE_KEY
10861101
function cast_passet() {
1087-
echo "Loading account 0x3d26c9637dFaB74141bA3C466224C0DBFDfF4A63"
1088-
echo "Setting ETH_RPC_URL to $PASSET_HUB_ETH_HTTP_URL"
1102+
export ETH_FROM="0x3d26c9637dFaB74141bA3C466224C0DBFDfF4A63"
10891103
export PRIVATE_KEY=2286c61f76910500cb63395dc50b77f821ac9687297081593057a8da0c7d92ba
10901104
export ETH_RPC_URL=$PASSET_HUB_ETH_HTTP_URL
1105+
1106+
echo "Loading account $ETH_FROM"
1107+
echo "Setting ETH_RPC_URL to $ETH_RPC_URL"
10911108
}
10921109

10931110
# Configures cast environment for westend Hub testnet
@@ -1097,10 +1114,12 @@ function cast_passet() {
10971114
# cast_westend
10981115
# cast send --value 0.1ether 0x... --private-key $PRIVATE_KEY
10991116
function cast_westend() {
1100-
echo "Loading account 0x3d26c9637dFaB74141bA3C466224C0DBFDfF4A63"
1101-
echo "Setting ETH_RPC_URL to $WESTEND_HUB_ETH_HTTP_URL"
1117+
export ETH_FROM="0x3d26c9637dFaB74141bA3C466224C0DBFDfF4A63"
11021118
export PRIVATE_KEY=2286c61f76910500cb63395dc50b77f821ac9687297081593057a8da0c7d92ba
11031119
export ETH_RPC_URL=$WESTEND_HUB_ETH_HTTP_URL
1120+
1121+
echo "Loading account $ETH_FROM"
1122+
echo "Setting ETH_RPC_URL to $ETH_RPC_URL"
11041123
}
11051124

11061125
# Configures cast environment for local development node
@@ -1110,11 +1129,17 @@ function cast_westend() {
11101129
# cast_local
11111130
# cast send --value 0.1ether 0x... --private-key $PRIVATE_KEY
11121131
function cast_local() {
1113-
echo "Loading account ETH_FROM = 0xf24FF3a9CF04c71Dbc94D0b566f7A27B94566cac"
1114-
echo "Setting ETH_RPC_URL to localhost:8545"
11151132
export ETH_FROM="0xf24FF3a9CF04c71Dbc94D0b566f7A27B94566cac"
11161133
export PRIVATE_KEY=5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133
11171134
export ETH_RPC_URL=http://localhost:8545
1135+
echo "Loading account $ETH_FROM"
1136+
echo "Setting ETH_RPC_URL to $ETH_RPC_URL"
1137+
}
1138+
1139+
# Configures cast environment for kusama
1140+
function cast_kusama() {
1141+
export ETH_RPC_URL=$KSM_ETH_HTTP_URL
1142+
echo "Setting ETH_RPC_URL to $ETH_RPC_URL"
11181143
}
11191144

11201145
# Manages the Passet Hub runtime for testing (custom parachain)

0 commit comments

Comments
 (0)