Questions tagged [decode]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
25 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')...
not 0x12's user avatar
  • 355
1 vote
0 answers
26 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, ...
Jeremy Boetticher's user avatar
5 votes
4 answers
169 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 ...
Szymig's user avatar
  • 225
4 votes
1 answer
71 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&...
Aramik M's user avatar
  • 139
0 votes
2 answers
92 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 ...
Tbaut's user avatar
  • 253
2 votes
2 answers
117 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&...
Oleg Kalenik's user avatar
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 ...
pmikolajczyk41's user avatar
0 votes
1 answer
102 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: ...
Rusty Pythonic Script's user avatar
0 votes
0 answers
169 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 ...
cboo's user avatar
  • 1
5 votes
1 answer
170 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<...
William Freudenberger's user avatar
3 votes
2 answers
213 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 ...
Guantong's user avatar
  • 1,823
4 votes
1 answer
242 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 ...
Squirrel's user avatar
  • 3,839
3 votes
1 answer
84 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 ...
PaperFrog's user avatar
  • 495
2 votes
3 answers
155 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://...
PaperFrog's user avatar
  • 495
1 vote
1 answer
123 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::{ ...
PaperFrog's user avatar
  • 495
5 votes
2 answers
819 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": ...
PaperFrog's user avatar
  • 495