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

decoding extrinsic panics. #405

Open
georlav opened this issue Oct 17, 2024 · 0 comments
Open

decoding extrinsic panics. #405

georlav opened this issue Oct 17, 2024 · 0 comments

Comments

@georlav
Copy link

georlav commented Oct 17, 2024

Every time I try to use codec.Decode or codec.DecodeFromHex on an extrinsic I previously created using the codec, the codec panics. I can broadcast these extrinsics without any issues, so they are valid.

In the following example, I'm using codec.DecodeFromHex for simplicity, but the same problem occurs if I use codec.Decode or even if I try to use the Marshaler.

encodedExt  = "0x450284005cd06e12b185738b6c25feb5ce37d522ef887faed480ccd4bf970fff094b3a5c01e4cdece2479208010bd5dbfc0851261a16bc9c7d3e63d69a3d148f31bd9a3f6ed0ae5d36ea1905dfcb64e98f8ff09e5576da86428ab27947a9c27ab05ca4628c00740000003208a6e9010000a01dd0d5a5e69b7f8f569e2fedb722c13254d7d5775a3474878e1d0190f35807d1cf"

var ext extrinsic.Extrinsic
err := codec.DecodeFromHex(encodedExt, &ext)
if err != nil {
    log.Fatal(err)
}

However, I receive the following panic:

panic: reflect: call of reflect.Value.Type on zero Value

The extrinsic can be decoded successfully using this tool: https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fasset-hub-westend-rpc.dwellir.com#/extrinsics/decode

I am using the latest master branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant