-
Notifications
You must be signed in to change notification settings - Fork 107
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
[email protected] Block.toBuffer().toString('hex') not equal to rpc getblock(blockhash, 0) #175
Comments
Confirmed that this is happening. I rewrote the test using the tools used inside bsv and using a file instead of an rpc connection: it.only('create block from hex and then serialize as hex returns the original hex', async () => {
// const height = 147056
// const blockHash = '00000000000007a678f2e1316e0f7f7acf2b967d998558aed8dadcd4430fd5f1'
const blockHexRpc = await new Promise(resolve => {
fs.readFile('test/block.txt', 'utf-8', (err, data) => {
if (err) {
throw err
}
resolve(data)
})
})
const block = Block.fromBuffer(Buffer.from(blockHexRpc, 'hex'))
const blockHexFromParsed = block.toBuffer().toString('hex')
should(blockHexFromParsed).be.eql(blockHexRpc)
}) This test fails exactly as described by @86chenjie. I'm looking for the cause. |
@hojarasca thanks for the response. Looking forward the fix. This issue really block my progress. Thanks again. |
any progress? |
@ryanxcharles can you help to check? Thanks! |
Workaround is here : 86chenjie@fe41812 |
@86chenjie thanks for the amazing job. I'm going to check your solution next week. |
test code:
After hex compared, hex from bsv lib has extra '00000000', the result hex should be equal to rpc result.
The text was updated successfully, but these errors were encountered: