Skip to content

Commit

Permalink
feat: deploy contract E2E test (draft)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan-Ethernal committed Sep 10, 2024
1 parent 5528195 commit 6a63153
Show file tree
Hide file tree
Showing 3 changed files with 718 additions and 12 deletions.
22 changes: 21 additions & 1 deletion test/basic-e2e.bats
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,32 @@ setup() {
@test "Send EOA transaction" {
load 'helpers/common'

local private_key="12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625"
local receiver="0x85dA99c8a7C2C95964c8EfD687E95E632Fc533D6"
local value="10ether"
local private_key="0x12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625"

run sendTx $private_key $receiver $value

assert_success
assert_output --partial 'Transaction successful'
}

@test "Deploy ERC20Mock contract" {
load 'helpers/common'

local private_key=12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625
local contract_artifact="./test/contracts/erc20mock/ERC20Mock.json"

local contract_addr=run deployContract $private_key $contract_artifact

local receiver="0x85dA99c8a7C2C95964c8EfD687E95E632Fc533D6"
local mintSig="function mint(address to, uint256 amount)"
local amount="5"

run sendTx $private_key $contract_addr $mintSig $receiver $amount
# TODO:
# 1. mint tokens to some receiver
# 2. invoke balanceOf

assert_success
}
Loading

0 comments on commit 6a63153

Please sign in to comment.