diff --git a/beacon_chain/eth1/eth1_monitor.nim b/beacon_chain/eth1/eth1_monitor.nim index de3cf9870..fe941dd6f 100644 --- a/beacon_chain/eth1/eth1_monitor.nim +++ b/beacon_chain/eth1/eth1_monitor.nim @@ -245,8 +245,6 @@ func asEth2Digest*(x: BlockHash): Eth2Digest = template asBlockHash*(x: Eth2Digest): BlockHash = BlockHash(x.data) -const weiInGwei = 1_000_000_000.u256 - from ../spec/datatypes/capella import ExecutionPayload, Withdrawal func asConsensusWithdrawal(w: WithdrawalV1): capella.Withdrawal = @@ -254,16 +252,14 @@ func asConsensusWithdrawal(w: WithdrawalV1): capella.Withdrawal = index: w.index.uint64, validator_index: w.validatorIndex.uint64, address: ExecutionAddress(data: w.address.distinctBase), - - # TODO spec doesn't mention non-even-multiples, also overflow - amount: (w.amount.u256 div weiInGwei).truncate(uint64)) + amount: w.amount.uint64) func asEngineWithdrawal(w: capella.Withdrawal): WithdrawalV1 = WithdrawalV1( index: Quantity(w.index), validatorIndex: Quantity(w.validator_index), address: Address(w.address.data), - amount: w.amount.u256 * weiInGwei) + amount: Quantity(w.amount)) func asConsensusExecutionPayload*(rpcExecutionPayload: ExecutionPayloadV1): bellatrix.ExecutionPayload = diff --git a/beacon_chain/spec/helpers.nim b/beacon_chain/spec/helpers.nim index 232b5174b..4b9e7fe32 100644 --- a/beacon_chain/spec/helpers.nim +++ b/beacon_chain/spec/helpers.nim @@ -391,16 +391,13 @@ proc computeTransactionsTrieRoot*( doAssert false, "HexaryTrie.put failed: " & $exc.msg tr.rootHash() -func gweiToWei*(gwei: Gwei): UInt256 = - gwei.u256 * 1_000_000_000.u256 - func toExecutionWithdrawal*( withdrawal: capella.Withdrawal): ExecutionWithdrawal = ExecutionWithdrawal( index: withdrawal.index, validatorIndex: withdrawal.validator_index, address: EthAddress withdrawal.address.data, - amount: gweiToWei withdrawal.amount) + amount: withdrawal.amount) # https://eips.ethereum.org/EIPS/eip-4895 proc computeWithdrawalsTrieRoot*( diff --git a/vendor/nim-eth b/vendor/nim-eth index 8f0ae5535..68f4c5382 160000 --- a/vendor/nim-eth +++ b/vendor/nim-eth @@ -1 +1 @@ -Subproject commit 8f0ae55353b95f888dce8a32bf810e58f7091b96 +Subproject commit 68f4c53828cec749e398864bcc6b0097c8d66c31 diff --git a/vendor/nim-web3 b/vendor/nim-web3 index 33586798e..b5188b067 160000 --- a/vendor/nim-web3 +++ b/vendor/nim-web3 @@ -1 +1 @@ -Subproject commit 33586798eae94f2c5bc543089b426769809549e1 +Subproject commit b5188b0679aa36ae54ea083bcd68349ef1b344e7