komputing / KEthereum

Kotlin library for Ethereum
MIT License
350 stars 73 forks source link

RLP encode and decode zero bytes bug #53

Closed jolestar closed 5 years ago

jolestar commented 5 years ago
@Test
    val zeroBytes = ByteArray(1){0.toByte()}
        val rlp = zeroBytes.toRLP()
        val bytes = rlp.encode()
        val rlp1 = bytes.decodeRLP()
        Assert.assertEquals(rlp, rlp1)
java.lang.AssertionError: expected:<RLPElement(bytes=[0])> but was:<RLPElement(bytes=[])>
Expected :RLPElement(bytes=[0])
Actual   :RLPElement(bytes=[])