Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

int to RLP mismatching with RLP to int #49

Closed
jolestar opened this issue Dec 13, 2018 · 3 comments
Closed

int to RLP mismatching with RLP to int #49

jolestar opened this issue Dec 13, 2018 · 3 comments
Labels

Comments

@jolestar
Copy link
Contributor

import org.kethereum.functions.rlp.toIntFromRLP
import org.kethereum.functions.rlp.toRLP

class RLPTest{

    @Test
    fun testIntRLP(){
        val int = 1838383984
        val rlp = int.toRLP()
        println(rlp.bytes.size)
        val int1 = rlp.toIntFromRLP()
        Assert.assertEquals(int, int1)
    }
}

output:

4

java.lang.AssertionError: 
Expected :1838383984
Actual   :1821541232
@ligi ligi added the bug label Dec 13, 2018
@ligi
Copy link
Member

ligi commented Dec 13, 2018

Thanks for the report! Will try to have a look today

@ligi
Copy link
Member

ligi commented Dec 13, 2018

I can confirm this bug and have a fix. Will add your int to the test-vectors. Thanks so much for reporting!!

ligi added a commit that referenced this issue Dec 13, 2018
Also extend text-vectors to cover this case
@ligi ligi closed this as completed in e9470ed Dec 13, 2018
@ligi
Copy link
Member

ligi commented Dec 13, 2018

Fixed in v0.66 - thanks so much for the quality bug report - love reports that contain a test!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants