Closed omarkilani closed 1 year ago
I'm thinking make them become pointers. if we remove omitempty
, we wouldn't use them individually. wdyt?
@yihau as far as I'm aware both fields should always be specified by the user in every RPC call, according to the Solana RPC docs.
oh... yeah. you're right. I got confused by the test result. I'll remove some test cases in this PR later.
Thank you for the patching!
@yihau any chance you could cut a release with this fix? For quality of life purposes. :)
offset
andlength
can both be0
in RPC calls (c.f. https://docs.solana.com/developing/clients/jsonrpc-api#results-27)The current code stops JSON from encoding the fields if they're
0
, thus breaking RPC calls with:{"code":-32602,"message":"Invalid params: missing field
offset
.","data":null}