Use correct gasprice for deposit contract test

This commit is contained in:
Mark Spanbroek 2021-12-07 12:45:50 +01:00 committed by markspanbroek
parent cfb02e19d3
commit 2c02c3d770
1 changed files with 3 additions and 1 deletions

View File

@ -15,8 +15,10 @@ suite "Deposit contract":
proc test() {.async.} =
let web3 = await newWeb3("ws://127.0.0.1:8545/")
let accounts = await web3.provider.eth_accounts()
let gasPrice = int(await web3.provider.eth_gasPrice())
web3.defaultAccount = accounts[0]
let receipt = await web3.deployContract(DepositContractCode, gasPrice=gasPrice)
let receipt = await web3.deployContract(DepositContractCode)
let contractAddress = receipt.contractAddress.get
echo "Deployed Deposit contract: ", contractAddress
@ -51,7 +53,7 @@ suite "Deposit contract":
do (err: CatchableError):
echo "Error from DepositEvent subscription: ", err.msg
discard await ns.deposit(pk, cr, sig, dataRoot).send(value = 32.u256.ethToWei)
discard await ns.deposit(pk, cr, sig, dataRoot).send(value = 32.u256.ethToWei, gasPrice=gasPrice)
await fut
echo "hash_tree_root: ", await ns.get_deposit_root().call()