-
Notifications
You must be signed in to change notification settings - Fork 673
Conversation
I'm not very experienced with TypeScript, so please let me know of any coding style or other issues and I'll be happy to fix them. |
At a quick glance this looks really great! We've got a busy week this week putting out a new alpha release, but hopefully we can review further and merge this next week! |
Hey y'all! Wonder if this mr will address a similar issue I am runnig into when using web3.py & a local ganache node.
yields this error
|
@L-F-Escobar yes, this addresses |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, @domob1812! Really great work.
I've left a few small suggestions, and there are a some merge conflicts that need to be resolved. Please let me or @davidmurdoch know if you have any questions or if you won't have time for this. We could get this past the finish line for you if you needed.
Thanks again, this is a huge help to us and those in the community wanting this RPC method.
3d2b84e
to
aadec27
Compare
Thanks for the suggestions! I've applied them and then rebased onto latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really great!
I have a few suggestions and a request for extending the tests a little bit.
Thanks again for putting this together!
This adds support for the txpool_content RPC method, which is a Geth extension to the JSON-RPC API. For more details, see the specification at https://geth.ethereum.org/docs/rpc/ns-txpool.
732e189
to
b1de189
Compare
Thanks again for the valuable feedback! I've applied all suggestions and tried to address the other comments now. |
const processMap = (map: Map<string, Heap<TypedTransaction>>) => { | ||
let res = new Map<string, Map<string, TypedTransactionJSON>>(); | ||
for (let [_, transactions] of map) { | ||
const arr = transactions.array; | ||
for (let i = 0; i < transactions.length; ++i) { | ||
const tx = arr[i]; | ||
const from = tx.from.toString(); | ||
if (res[from] === undefined) { | ||
res[from] = {}; | ||
} | ||
// The nonce keys are actual decimal numbers (as strings) and not | ||
// hex literals (based on what geth returns). | ||
const nonce = tx.nonce.toBigInt().toString(); | ||
res[from][nonce] = tx.toJSON(common); | ||
} | ||
} | ||
return res; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding to #763
Can this be shifted to a separate utility? since other txpool_*
methods might need it. If yes, which place is most suitable?
This adds support for the
txpool_content
RPC method, which is a Geth extension to the JSON-RPC API. For more details, see the specification at https://geth.ethereum.org/docs/rpc/ns-txpool.This implements a part of #763.