Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Send EOA and deploy contract E2E tests using Bats #69

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: cast call helper function and invocation of balanceOf function
Stefan-Ethernal committed Sep 13, 2024
commit 4ffd49119e8c698702be918a9d51b5afc8fbd01a
2 changes: 1 addition & 1 deletion test/basic-e2e.bats
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ setup() {

# Assert that balance is correct
local balanceOfFnSig="function balanceOf(address) (uint256)"
run queryContract $contract_addr $balanceOfFnSig $receiver
run queryContract "$contract_addr" "$balanceOfFnSig" "$receiver"
assert_success
receiverBalance=$(echo "$output" | tail -n 1)

3 changes: 3 additions & 0 deletions test/helpers/common.bash
Original file line number Diff line number Diff line change
@@ -21,6 +21,7 @@ function deployContract() {
echo "Error: Failed to retrieve sender address."
return 1
fi

echo "Attempting to deploy contract artifact $contract_artifact to $rpc_url (sender: $senderAddr)"

# Get bytecode from the contract artifact
@@ -153,6 +154,8 @@ function queryContract() {
shift 2 # Shift past the first two arguments
local params=("$@") # Collect remaining arguments as parameters array

echo "Querying state of $addr account (RPC URL: $rpc_url) with function signature: '$funcSignature' and params: ${params[*]}"

# Check if rpc_url is available
if [[ -z "$rpc_url" ]]; then
echo "Error: rpc_url environment variable is not set."