nim-json-rpc/tests/testutils.nim
2018-04-11 14:48:34 +03:00

16 lines
424 B
Nim

import strutils, eth-rpc/server/private/transportutils, unittest
suite "Encoding":
test "Encode quantity":
check 0.encodeQuantity == "0x0"
check 0x1000.encodeQuantity == "0x1000"
test "Encode data":
var i = 0
for b in bytes(0x07_06_05_04_03_02_01_00'u64):
check b == i.byte
i.inc
test "Encode data pairs":
for i, b in bytePairs(0x07_06_05_04_03_02_01_00'u64):
check b == i.byte