diff --git a/beacon_chain/el/deposit_contract.nim b/beacon_chain/el/deposit_contract.nim index 42c739bab..445a3c579 100644 --- a/beacon_chain/el/deposit_contract.nim +++ b/beacon_chain/el/deposit_contract.nim @@ -122,9 +122,9 @@ contract(DepositContract): deposit_data_root: FixedBytes[32]) proc deployContract*(web3: Web3, code: seq[byte]): Future[ReceiptObject] {.async.} = - let tr = EthSend( - `from`: web3.defaultAccount, - data: code, + let tr = TransactionArgs( + `from`: web3.defaultAccount.some, + data: code.some, gas: Quantity(3000000).some, gasPrice: Quantity(1).some) @@ -132,8 +132,12 @@ proc deployContract*(web3: Web3, code: seq[byte]): Future[ReceiptObject] {.async result = await web3.getMinedTransactionReceipt(r) proc sendEth(web3: Web3, to: Eth1Address, valueEth: int): Future[TxHash] = - let tr = EthSend( - `from`: web3.defaultAccount, + let tr = TransactionArgs( + `from`: web3.defaultAccount.some, + # TODO: Force json-rpc to generate 'data' field + # should not be needed anymore, new execution-api schema + # is using `input` field + data: some(newSeq[byte]()), gas: Quantity(3000000).some, gasPrice: Quantity(1).some, value: some(valueEth.u256 * 1000000000000000000.u256), diff --git a/ncli/ncli_testnet.nim b/ncli/ncli_testnet.nim index 9f61a8412..8e3017e8b 100644 --- a/ncli/ncli_testnet.nim +++ b/ncli/ncli_testnet.nim @@ -504,9 +504,9 @@ proc doCreateTestnet*(config: CliConfig, echo "Wrote ", bootstrapFile proc deployContract(web3: Web3, code: seq[byte]): Future[ReceiptObject] {.async.} = - let tr = EthSend( - `from`: web3.defaultAccount, - data: code, + let tr = TransactionArgs( + `from`: web3.defaultAccount.some, + data: code.some, gas: Quantity(3000000).some, gasPrice: Quantity(1).some) @@ -514,8 +514,12 @@ proc deployContract(web3: Web3, code: seq[byte]): Future[ReceiptObject] {.async. result = await web3.getMinedTransactionReceipt(r) proc sendEth(web3: Web3, to: Eth1Address, valueEth: int): Future[TxHash] = - let tr = EthSend( - `from`: web3.defaultAccount, + let tr = TransactionArgs( + `from`: web3.defaultAccount.some, + # TODO: Force json-rpc to generate 'data' field + # should not be needed anymore, new execution-api schema + # is using `input` field + data: some(newSeq[byte]()), gas: Quantity(3000000).some, gasPrice: Quantity(1).some, value: some(valueEth.u256 * 1000000000000000000.u256), diff --git a/vendor/nim-web3 b/vendor/nim-web3 index 80c7aa6de..285d97c2b 160000 --- a/vendor/nim-web3 +++ b/vendor/nim-web3 @@ -1 +1 @@ -Subproject commit 80c7aa6de2a26c57fa1f06ad47f3ac6058e6545b +Subproject commit 285d97c2b05bbe2a13dab4b52ea878157fb1a1a1