Closed crossle closed 3 years ago
m := types.ScaleDecoder{}
m.Init(types.ScaleBytes{Data: util.HexToBytes(raw)}, types.ScaleDecoderOption{Metadata:Metadata})
m.ProcessAndUpdateData("OpaqueCall")
m := types.ScaleDecoder{} m.Init(types.ScaleBytes{Data: util.HexToBytes(raw)}, types.ScaleDecoderOption{Metadata:Metadata}) m.ProcessAndUpdateData("OpaqueCall")
get empty data. map[call_index: call_module: call_name: params:[]]
@crossle Can you paste your code?
m := types.ScaleDecoder{}
m.Init(types.ScaleBytes{Data: util.HexToBytes("05000061d0f165cc77b059f1ac1fe2598cd90f487ab60dc26c63d7633852d554ad1db50700e40b5402")}, &types.ScaleDecoderOption{Metadata: metadataRaw})
a := m.ProcessAndUpdateData("OpaqueCall")
metadata raw from state_getMetadata on the block 7329637
@crossle ok, this type is Call
, usetype
field
you can use this m.ProcessAndUpdateData("Call")
will get
{
"call_index": "0500",
"call_module": "Authorship",
"call_name": "set_uncles",
"params": [
{
"name": "new_uncles",
"type": "Vec\u003cHeader\u003e",
"value": null
}
]
}
Got it, Thanks.