mirror of https://github.com/status-im/nim-eth.git
Convert GasInt to uint64 (#713)
This commit is contained in:
parent
d8fda55c79
commit
ebfe63b9b6
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue