Skip to main content

Questions tagged [decode]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
1 answer
41 views

how to decode extrinsic data inside a pallet | Frontier

i have a pallet that prints extrinsic data (bytes and hex) of every extrinsic inside every block, how can i print it like an human readable object ("from", "to" ecc..)? that's my ...
1 vote
1 answer
20 views

Remove undecodable storage keys from StorageDoubleMap

I want to remove keys from the storage which cannot be decoded by using unhashed. I know there are undecodable keys because when counting the number of storage keys via MyStorage::<T>::iter_keys(...
0 votes
1 answer
26 views

How to construct the data structure with correct values for their attributes within a Pallet for data submitted by a polkadotJS app

Client App creates an Input as follows using polkadotJS to submit to Substrate Module as follows import { ApiPromise, WsProvider } from '@polkadot/api'; const { Keyring } = require('@polkadot/keyring')...
1 vote
0 answers
29 views

How do I scale decode a Vec<u8> within an ink smart contract?

This is within my smart contract's module: // THIS IS BEING USED: use ink::prelude::vec::Vec; #[ink(message)] pub fn test_encoding(&mut self) -> Result<u32, ...
5 votes
4 answers
199 views

Decoding Polkadot/Kusama transactions in Rust

I would like to inspect transactions (extrinsics) in a given block to potentially: Find different types of transactions and their parameters Look through all transactions included in the block and ...
4 votes
1 answer
75 views

Implications of invalid encoded extrinsic calls

We are seeing the following error whenever an invalidly encoded but properly signed extrinsic is submitted in our substrate based chain. { "jsonrpc": "2.0", "error&...
2 votes
2 answers
135 views

Decode preimages Bounded Dispatchable Call on a client side

I'm using Bounded trait from preimages frame that allows to store dispatchable calls, e.g. similar to the one that is used in pallet-democracy: pub type CallOf<T> = <T as frame_system::Config&...
0 votes
2 answers
101 views

How to decode an error that happened in a proxy.proxy call

I'd like to show my users if an error occurred while doing a proxy.proxy call. While I know how to decode a system.ExtrinsicFailed, as this is well documented, I have difficulties finding the correct ...
2 votes
1 answer
71 views

Reading arguments in chain extension

I have a question about reading data in a chain extension. To be precise, I'm concerned about methods Environment<_,_,_,S: BufIn>::read*. Do I understand correctly, that every such function ...
0 votes
1 answer
109 views

Decoding extrinsic hex into readable form in Rust

I am running the substrate-dev node. Made a transaction using Polkadot-explorer. After fetching the block using subxt I am getting extrinsic hex as: ...
3 votes
2 answers
220 views

How does the encoded transaction in `Transact` turn into decoded transaction `call` when executing instructions in XCM?

let message_call = call.take_decoded().map_err(|_| XcmError::FailedToDecode)?; https://github.com/paritytech/polkadot/blob/master/xcm/xcm-executor/src/lib.rs#L342 I got this code above and tried to ...
0 votes
0 answers
177 views

Polkadot Explorer: decode storage system.events

I was doing some testing and sent a transaction on a custom substrate chain. On the polkadot explorer, the block which held the transaction had an error. The transaction completed; however, the ...
5 votes
1 answer
179 views

Migrate keytype of StorageMap without breakin API

Assume we have a StorageMap MyMap of which we want to extend the type of the decoded keys from KeyTypeOld to an enum including the old type as well as a new one. Before pub type MyMap = StorageMap<...
4 votes
1 answer
263 views

How can I decode an extrinsic or event dynamically in rust?

How can I decode an extrinsic or event dynamically in rust? (I want to be able to decode across all parachains) A lot of the heavy lifting seems to be frame-metadata and scale-info. There's a desub ...
3 votes
1 answer
88 views

Is there a way to know what event it is without decoding the encoded extinsisc?

We are manually decoding the encoded extrinsic. [ex 0x510284.. -> TransactionInfo{value=AccountID{address=14pT17...)] It was confirmed that polkadot-js is well decoded through the toHuman method ...
2 votes
3 answers
160 views

What is the difference between check_extrinsic and uncheck_extrinsic?

I want to decode the polkadot's extrinsics I received through json-rpc (at rust or java). But every time I leave a question here, there's no clear answer. First, I'm using subxt. (subxt : https://...
1 vote
1 answer
132 views

How to solve 'Invalid transaction version'?

use std::any::Any; use std::io; use subxt::*; use subxt::{ClientBuilder,DefaultConfig, DefaultExtra}; use subxt::codec::Decode; use crate::sp_runtime::OpaqueExtrinsic; use sp_runtime::{ generic::{ ...
5 votes
2 answers
877 views

How to decode extrinsic at json-RPC call's data(byte code)

I call json-RPC through the terminal and get the data as below. extrinsics is raw byte, but I'm using polkadot-js(SCALE codec?) to decode it. But I don't know which method to call. "block": ...