Skip to content

Commit

Permalink
add partial test script
Browse files Browse the repository at this point in the history
  • Loading branch information
sskeirik committed Dec 19, 2024
1 parent e8a66ae commit dbfed37
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions tests/ulm/erc20/erc20_test.sh
Original file line number Diff line number Diff line change
@@ -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)


0 comments on commit dbfed37

Please sign in to comment.