Convert GasInt to uint64 (#713)

This commit is contained in:
andri lim 2024-07-06 20:24:14 +07:00 committed by GitHub
parent d8fda55c79
commit ebfe63b9b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 13 deletions

View File

@ -39,7 +39,7 @@ type
EthAddress* = array[20, byte]
DifficultyInt* = UInt256
GasInt* = int64
GasInt* = uint64
## Type alias used for gas computation
# For reference - https://github.com/status-im/nimbus/issues/35#issuecomment-391726518

View File

@ -70,18 +70,6 @@ proc append*[T](w: var RlpWriter, val: Opt[T]) =
else:
w.append("")
proc read*(rlp: var Rlp, T: type GasInt): T {.inline.} =
var res: uint64
rlp.read(res)
if res > GasInt.high.uint64:
raise (ref MalformedRlpError)(msg:
"GasInt value too large: " & $res)
res.GasInt
proc append*(w: var RlpWriter, value: GasInt) =
doAssert value >= 0
w.append(value.uint64)
proc appendTxLegacy(w: var RlpWriter, tx: Transaction) =
w.startList(9)
w.append(tx.nonce)