I'm writing a custom BlockImport
and I need to decode the transactions within the block,as we know a transaction is simply a pallet method call for example store_value(value)
, but at the point where I'm verifying a block all I got is OpaqueExtrinsic
which is the transaction encoded.
How can I take that extrinsic and retrieve the parameter value
that was passed when the user called my pallet extrinsic store_value(value)
?
Extra: in the following code I'm just iterating over all the block extrinsics:
if let Some(block_extrinsics) = &block.body {
let mut block_extrinsics = block_extrinsics.iter();
block_extrinsics.next();
for extrinsic in block_extrinsics {
// what to do next ¯\_(ツ)_/¯
}
}