Skip to content
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

"unmarshaling params for 'state.BalanceForAddress' (param: *types.Address): json: cannot unmarshal string into Go value of type types.Address" #2322

Closed
jcstein opened this issue Jun 5, 2023 · 0 comments · Fixed by #2348
Assignees
Labels
bug Something isn't working external Issues created by non node team members

Comments

@jcstein
Copy link
Member

jcstein commented Jun 5, 2023

Celestia Node version

v0.11.0-rc2

OS

macOS

Install tools

https://docs.celestia.org/nodes/celestia-node/ for Mac (Apple) x Arabica

Others

No response

Steps to reproduce it

celestia rpc state BalanceForAddress celestia10rtd9lhel2cuh6c659l25yncl6atcyt37umard

Expected result

balance of address

Actual result

message": "unmarshaling params for 'state.BalanceForAddress' (param: *types.Address): json: cannot unmarshal string into Go value of type types.Address"

Relevant log output

{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32700,
    "message": "unmarshaling params for 'state.BalanceForAddress' (param: *types.Address): json: cannot unmarshal string into Go value of type types.Address"
  }
}

Notes

No response

@jcstein jcstein added the bug Something isn't working label Jun 5, 2023
@github-actions github-actions bot added the external Issues created by non node team members label Jun 5, 2023
distractedm1nd added a commit that referenced this issue Jun 14, 2023
While debugging #2322 , I noticed that it is not only an RPC issue, but
also a broken API one. All RPC methods that used the type
`state.Address` were unusable, both via the client and via raw JSON
calls. This is because the server was unable to marshal the address
string value back into the interface type.

To circumvent this, I have embedded the sdk.Address type in the same way
that we embed the fraud proof type, to allow us to unmarshal it back
into a concrete type. I have also added unit tests to fix this.

In addition, it fixes the RPC parsing - so it closes #2322 .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working external Issues created by non node team members
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants