From dbfed375bc219e580c903b2103f72d1f0c006662 Mon Sep 17 00:00:00 2001 From: Stephen Skeirik Date: Thu, 19 Dec 2024 00:19:10 -0500 Subject: [PATCH] add partial test script --- tests/ulm/erc20/erc20_test.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 tests/ulm/erc20/erc20_test.sh diff --git a/tests/ulm/erc20/erc20_test.sh b/tests/ulm/erc20/erc20_test.sh new file mode 100755 index 000000000..bd46a1d73 --- /dev/null +++ b/tests/ulm/erc20/erc20_test.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +ROOT_DIR="$SCRIPT_DIR/../../.." + +# change to root directory +cd "$ROOT_DIR" + +# re-execute script with poetry to get poetry script aliases +if [ -z ${IN_POETRY_SHELL:+x} ]; then + export IN_POETRY_SHELL=1 + exec poetry -C pykwasm run bash "$SCRIPT_DIR/$0" +fi + +# generate some accounts +a1=$(mkacct) +a2=$(mkacct) +a3=$(mkacct) + +# fund accounts +fund /dev/stdin <<< $a1 +fund /dev/stdin <<< $a2 +fund /dev/stdin <<< $a3 + +# deploy contract +contract=$(deploy build/erc20/erc20.bin http://localhost:8545 /dev/stdin <<< $a1) + +# check decimals +decimals=$(call http://localhost:8545 erc20 $contract /dev/stdin 0 decimals <<< $a1) + +# check total supply +supply=$(call http://localhost:8545 erc20 $contract /dev/stdin 0 totalSupply <<< $a1) + +