Closed yxf closed 4 years ago
That happens when the client version doesn't match the node version. Update your node to rc3 and the error should disappear
@dvc94ch Thanks for your reply. I use kusama runtime, but still error.
[dev-dependencies]
async-std = { version = "1.5.0", features = ["attributes"] }
env_logger = "0.7"
wabt = "0.9"
frame-system = { version = "2.0.0-rc2", package = "frame-system" }
pallet-balances = { version = "2.0.0-rc2", package = "pallet-balances" }
sp-keyring = { version = "2.0.0-rc2", package = "sp-keyring" }
kusama-runtime = {path = "../polkadot/runtime/kusama" }
let uncheck_extrinsic = kusama_runtime::UncheckedExtrinsic::decode(&mut input);
The block data at height 2852995 is:
SignedBlock {
block: Block {
header: Header {
parent_hash: 0x9685770bfbc3b213b63e59dec3d518b6dab61849cb944b066644b56d94eda6c1,
number: 2852995,
state_root: 0x458ef43522540efc0b4a7be7f2aef470d229bdf4bad31f0bc38e6c67668f5a46,
extrinsics_root: 0xc1d6f1f1216393b81bc155cf9f8163c11b51e3225df5a68febd6d1e9096f409b,
digest: Digest { logs: [DigestItem::PreRuntime([66, 65, 66, 69], [2, 121, 0, 0, 0, 244, 178, 210, 15, 0, 0, 0, 0]), DigestItem::Seal([66, 65, 66, 69], [90, 217, 174, 195, 252, 86, 236, 170, 4, 204, 232, 209, 46, 172, 53, 117, 143, 194, 177, 184, 203, 42, 251, 157, 120, 136, 50, 141, 133, 137, 240, 90, 3, 229, 135, 210, 32, 181, 154, 216, 14, 61, 108, 141, 218, 110, 63, 172, 113, 128, 209, 228, 180, 66, 218, 161, 136, 38, 94, 73, 62, 160, 102, 137])] }
},
extrinsics: [
0402000bc03642da7201,
04140000,
84fe56be5933800b45a21ee8e9817eae9f49099fdf4a20076718497092ed43c62b019a7261d479c4b495cfd1fcffcf9daf35600c391e752e99c805e7951388fb17663a8ab4f9c2241835599c1df443630f0c218b3bdc3e83f5e0390cfced7e580b8ef50374000400a8070648f6e43b7d8a8f10418b696130d2046c10645f10085de80e6098b85f0902286bee
]
},
justification: None
}
Got error: Err(Error("Invalid transaction version"))
I found the extrinsic is missing prefix length encode bytes,so UncheckedExtrinsic
can not decode the raw bytes array. Why the rpc returns extrinsic is different with the generated extrinsic?
I want extract extrinsic from rpc result, but got
invalid transaction version
error, please help.Outputs: