Skip to content

Commit

Permalink
fix: update bundler spec tests files
Browse files Browse the repository at this point in the history
  • Loading branch information
Vid201 committed Oct 11, 2024
1 parent ceca4a6 commit db80f03
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 27 deletions.
51 changes: 24 additions & 27 deletions bundler-spec-tests/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,32 @@
services:
geth-dev:
eth-node:
image: ethereum/client-go:v1.14.11
healthcheck:
test: [ "CMD-SHELL", "geth attach --exec eth.blockNumber" ]
interval: 10s
timeout: 5s
retries: 5
ports:
- 8545:8545
- 8546:8546
command:
- --miner.gaslimit=12000000
- --http
- --http.api=personal,eth,net,web3,debug
- --allow-insecure-unlock
- --rpc.allow-unprotected-txs
- --http.vhosts=*
- --http.corsdomain=*
- --http.addr=0.0.0.0
- --ws
- --ws.api=personal,eth,net,web3,debug
- --ws.origins=*
- --ws.addr=0.0.0.0
- --dev
- --nodiscover
- --maxpeers=0
- --mine
- --verbosity=2
command: --verbosity 1
--http.vhosts '*,localhost,host.docker.internal'
--http
--http.api eth,net,web3,debug
--http.corsdomain '*'
--http.addr "0.0.0.0"
--ws
--ws.api eth,net,web3,debug
--ws.origins '*'
--ws.addr "0.0.0.0"
--networkid 1337
--dev
--dev.period 0
--allow-insecure-unlock
--rpc.allow-unprotected-txs
--dev.gaslimit 20000000
fund-signer:
image: ethereum/client-go:v1.14.11
entrypoint: 'geth --exec "eth.sendTransaction({from: eth.accounts[0], to: \"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266\", value: web3.toWei(10000, \"ether\")})" attach http://geth-dev:8545'
build: funder
environment:
- FUND=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
- ETH_RPC_URL=http://eth-node:8545
- ENTRYPOINT=0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789
restart: on-failure:3
depends_on:
geth-dev:
eth-node:
condition: service_started
6 changes: 6 additions & 0 deletions bundler-spec-tests/funder/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM ghcr.io/foundry-rs/foundry:latest

RUN apk add jq
ADD funder.sh /
RUN chmod a+rx /funder.sh
ENTRYPOINT /funder.sh
41 changes: 41 additions & 0 deletions bundler-spec-tests/funder/funder.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/sh -e

test -n "$VERBOSE" && set -x

#fund all addresses in the FUND array
#each entry is either an address (42-char hex) or privatekey (66-char hex)
#use ether "FUND_PRIVATEKEY" or accounts[0]

function fatal {
echo "FATAL: $@"
exit 1
}

#ETH_RPC_URL=http://localhost:8545

if [ -n "$FUND_PRIVATEKEY" ]; then
funder=`cast w address $FUND_PRIVATEKEY`
echo "using account for FUND_PRIVATEKEY: $funder"
SENDER="--private-key $FUND_PRIVATEKEY"
else
funder=`cast rpc eth_accounts|jq -r .[0]`
SENDER="--unlocked --from $funder"
fi

test -z "$funder" && fatal "unable to find a funder account: no FUND_PRIVATEKEY and no accounts[0] in node"

funderBal=`cast balance $funder`
test "$funderBal" = "0" && fatal "Funder account $funder has no balance"

for addr in $FUND; do
len=`echo -n $addr | wc -c | xargs`
case $len in
42) ;;
64|66) addr=`cast wallet address $addr` ;;
*) fatal "not an address and not privatekey: $addr" ;;
esac

cast send --gas-price 1000000000 --priority-gas-price 1000000000 --async $SENDER $addr --value `cast to-wei 10 eth` > /dev/null
echo funded: $addr

done

0 comments on commit db80f03

Please sign in to comment.