kinghodor / ethereum-rlp Goto Github PK
View Code? Open in Web Editor NEWC Ethereum RLP library
C Ethereum RLP library
Below two lines in RLP.c must be changed.
Your code just can create right RLP only when chain ID is small number.
Line 37 in 434eb4f
Line 80 in 434eb4f
Add below function and fix your code.
(I know this function is not great but can solve facing problem.)
int calculateLengOfV(uint32_t v) {
// 1byte
if ((v & 0xFF) == v) {
return 1;
// 2byte
} else if ((v & 0xFFFF) == v) {
return 2;
// 3byte
} else if ((v & 0xFFFFFF) == v) {
return 3;
// 4byte
} else if ((v & 0xFFFFFFFF) == v) {
return 4;
} else {
return -1;
}
}
And fix the code right.
totalLength += calculateLengOfV(new_tx->signature_v);
...
copyPos = wallet_copy_rpl(data + copyPos, &new_tx->signature_v, calculateLengOfV(new_tx->signature_v), copyPos);
free(pbytes) is not always called because the conditional scoping which can result in memory issues.
i use the example result to broadcast:
f86c008504a817c80082520894e0defb92145fef3c3a945637705fafd3aa74a241880de0b6b3a7640000001ba009ebb6ca057a0535d6186462bc0b465b561c94a295bdb0621fc19208ab149a9ca0440ffd775ce91a833ab410777204d5341a6f9fa91216a6f3ee2c051fea6a0428
the error message is:
Error: rlp: non-canonical integer (leading zero bytes) for uint64, decoding into (types.Transaction)(types.txdata).AccountNonce
Hi,
Great lib! What is the license in order to use it? Can I assume it's MIT?
Cheers,
Ben
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.