Updated web3 api usage
This commit is contained in:
parent
a897ab9c70
commit
e8ca67fc9a
|
@ -36,9 +36,8 @@ proc processDeposit(d: DepositCollector, web3: Web3): Future[BeaconState] {.asyn
|
|||
proc getGenesisFromEth1*(conf: BeaconNodeConf): Future[BeaconState] {.async.} =
|
||||
let web3 = await newWeb3(conf.depositWeb3Url)
|
||||
|
||||
var contractAddress = Address.fromHex(conf.depositContractAddress)
|
||||
var defaultAccount: Address
|
||||
var ns = web3.contractSender(DepositContract, contractAddress, defaultAccount)
|
||||
let contractAddress = Address.fromHex(conf.depositContractAddress)
|
||||
let ns = web3.contractSender(DepositContract, contractAddress)
|
||||
|
||||
var deposits = DepositCollector()
|
||||
deposits.queue = newAsyncQueue[QueueElement]()
|
||||
|
|
|
@ -62,9 +62,9 @@ proc main(totalValidators: int, outputDir: string, generateFakeKeys: bool, depos
|
|||
writeFile(depositFn, dp)
|
||||
|
||||
if not web3.isNil:
|
||||
let depositContract = web3.contractSender(DepositContract, contractAddress, eth1Addresses[i])
|
||||
depositContract.value = 32.u256.ethToWei
|
||||
let tx = await depositContract.deposit(Bytes48(pubKey.getBytes()), Bytes32(withdrawalCredentials.data), Bytes96(dp.data.signature.getBytes()))
|
||||
web3.defaultAccount = eth1Addresses[i]
|
||||
let depositContract = web3.contractSender(DepositContract, contractAddress)
|
||||
let tx = await depositContract.deposit(Bytes48(pubKey.getBytes()), Bytes32(withdrawalCredentials.data), Bytes96(dp.data.signature.getBytes())).send(value = 32.u256.ethToWei)
|
||||
|
||||
if generateFakeKeys:
|
||||
echo "Keys generated by this tool are only for testing!"
|
||||
|
|
Loading…
Reference in New Issue