From abbe4075fa85cdc15d32b4e866130ee7c5cc1230 Mon Sep 17 00:00:00 2001 From: Yuriy Glukhov Date: Wed, 30 Oct 2019 15:18:55 +0200 Subject: [PATCH] Fixed deposit contract deployment --- beacon_chain/deposit_contract.nim | 5 +---- scripts/reset_testnet.sh | 2 ++ vendor/nim-web3 | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/beacon_chain/deposit_contract.nim b/beacon_chain/deposit_contract.nim index 0d1d3d163..e3ee8da46 100644 --- a/beacon_chain/deposit_contract.nim +++ b/beacon_chain/deposit_contract.nim @@ -39,9 +39,6 @@ type contract(Deposit): proc drain() -proc getTransactionReceipt(web3: Web3, tx: TxHash): Future[ReceiptObject] {.async.} = - result = await web3.provider.eth_getTransactionReceipt(tx) - proc deployContract*(web3: Web3, code: string): Future[Address] {.async.} = var code = code if code[1] notin {'x', 'X'}: @@ -53,7 +50,7 @@ proc deployContract*(web3: Web3, code: string): Future[Address] {.async.} = gasPrice: 1.some) let r = await web3.send(tr) - let receipt = await web3.getTransactionReceipt(r) + let receipt = await web3.getMinedTransactionReceipt(r) result = receipt.contractAddress.get proc sendEth(web3: Web3, to: string, valueEth: int): Future[TxHash] = diff --git a/scripts/reset_testnet.sh b/scripts/reset_testnet.sh index a98e48f5e..c8204c37c 100755 --- a/scripts/reset_testnet.sh +++ b/scripts/reset_testnet.sh @@ -55,8 +55,10 @@ DOCKER_BEACON_NODE="docker run -v $DEPOSITS_DIR_ABS:/deposits_dir -v $NETWORK_DI make deposit_contract if [ "$ETH1_PRIVATE_KEY" != "" ]; then + echo "Deploying deposit contract..." DEPOSIT_CONTRACT_ADDRESS=$(./build/deposit_contract deploy $WEB3_URL_ARG --private-key=$ETH1_PRIVATE_KEY) DEPOSIT_CONTRACT_ADDRESS_ARG="--deposit-contract=$DEPOSIT_CONTRACT_ADDRESS" + echo "Done: $DEPOSIT_CONTRACT_ADDRESS" fi cd docker diff --git a/vendor/nim-web3 b/vendor/nim-web3 index ecd2fb45a..37fc46111 160000 --- a/vendor/nim-web3 +++ b/vendor/nim-web3 @@ -1 +1 @@ -Subproject commit ecd2fb45a63f105c026fa9a8515daf288a57c13d +Subproject commit 37fc46111489bc521731b59f52f42b6327fa7829