You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
API's like QueryStorage uses StateStorageQueryRangeRequest as request params but it should parse unstructured JSON to RPC request struct. The issue is with the Gorilla RPC library.
commmon.Hash should have custom marshaling and unmarshalling.
Current Behavior
For 1: It fails to parse unstructured JSON RPC request params struct and an unmarshalling error is returned.
For 2: Any RPC returning commmon.Hash would convert the byte to string and return the underlying bytes instead of expected hash value.
Example: It should format hash like this 0xe99c87d6efab57a98706c10fa4bc4d39feaf51ca62ac3bae7a67bf17c8c305ec but it returns the bytes directly(e99c87d6efab57a98706c10fa4bc4d39feaf51ca62ac3bae7a67bf17c8c305ec in bytes).
Possible Solution
Fix the CodecRequest implementation for JSON RPC v2 in the RPC gorilla library.
Add custom marshaling and unmarshalling for commmon.Hash.
Expected Behavior
QueryStorage
usesStateStorageQueryRangeRequest
as request params but it should parse unstructured JSON to RPC request struct. The issue is with the Gorilla RPC library.commmon.Hash
should have custom marshaling and unmarshalling.Current Behavior
commmon.Hash
would convert the byte to string and return the underlying bytes instead of expected hash value.Example: It should format hash like this
0xe99c87d6efab57a98706c10fa4bc4d39feaf51ca62ac3bae7a67bf17c8c305ec
but it returns the bytes directly(e99c87d6efab57a98706c10fa4bc4d39feaf51ca62ac3bae7a67bf17c8c305ec
in bytes).Possible Solution
CodecRequest
implementation for JSON RPC v2 in the RPC gorilla library.commmon.Hash
.Steps to Reproduce
QueryStorage
.common.Hash
Specification
Checklist
The text was updated successfully, but these errors were encountered: