Bump nim-web3 to 285d97c2b05bbe2a13dab4b52ea878157fb1a1a1 (#6106)

Unify EthCall/EthSend into TransactionArgs (#138)
This commit is contained in:
andri lim 2024-03-20 14:39:12 +07:00 committed by GitHub
parent 032b91c631
commit 1fe6efcf53
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 19 additions and 11 deletions

View File

@ -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),

View File

@ -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),

2
vendor/nim-web3 vendored

@ -1 +1 @@
Subproject commit 80c7aa6de2a26c57fa1f06ad47f3ac6058e6545b
Subproject commit 285d97c2b05bbe2a13dab4b52ea878157fb1a1a1