Skip to main content

Questions tagged [scale-codec]

12 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7 votes
0 answers
94 views

Why do clients have to hardcode the extra types in the registry?

Context: I'm experimenting with an H160-address based substrate and I'm doing it from scratch (it's not a moon* or frontier template fork). It's reasonably trivial to make changes to the substrate ...
Farcaller's user avatar
  • 158
5 votes
0 answers
95 views

I want to use Parity SCALE codec in Solidity? Is there any implementation of scale codec to decode bytes?

I want to decode bytes on the Solidity side that was decoded with scale codec. Is the any implementation of scale codec (decode) on the Solidity side?
rust.dev's user avatar
  • 539
3 votes
0 answers
35 views

Why is the index of a pallet a u32(usize) instead of u8 when queried?

I'm implementing a flow where I first ask what index a pallet has with the QueryPallet xcm instruction, and then construct a call to use with Transact. I see that to construct manually an encoded call ...
Juan Ignacio Rios's user avatar
3 votes
0 answers
50 views

After using set_code_hash to upgrade contract, when decode on the new Storage,why there wont has error of "Not enough data to fill buffer"

I'm learning how to upgrade ink! contract,and have some question: Eg:old contractA, storage define is #[ink(storage) pub struct MyContract { a: u32, } new contractB,storage define is #[ink(...
ruarua's user avatar
  • 31
1 vote
1 answer
25 views

How to check the ordering of extrinsic payload for SCALE encoding in polkadot-sdk?

Below is something which I found in the polkadot-js api code describe('ExtrinsicPayload', (): void => { it('has a sane inspect', (): void => { // we don't expect this to fail, however it ...
muddlebee's user avatar
1 vote
0 answers
27 views

DOT, KSM transfer sign payload order

I want to know the scale codec order for sign payload cause currently I can't transfer WND, KSM right now currently my codec order is method call -> era -> nonce -> tip -> specVer -> ...
Bomax Chen's user avatar
1 vote
0 answers
50 views

How to decode contract storage returned data

How do i decode this Hex string to String. It is storage data returned from a contract, using Polkadot-JS. { Ok: { flags: [], data: '...
Woodfish's user avatar
  • 121
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, ...
Jeremy Boetticher's user avatar
0 votes
2 answers
14 views

SCALE encoding how to get 29 bits in 4 bytes

i am trying to understand the SCALE encoding spec in the jam spec, where it says you can fit 29 bits plus a prefix. 2^21 ≤ x < 2^29, where the prefix is 0b1110, and takes up the left most 4 bits, ...
Ramsey - Decentration's user avatar
0 votes
1 answer
25 views

KSM, WND transfer transaction fail, but DOT success

I used the same program, the same fullnode version, and the same Substrate API sidecar version to submit transfer transactions for DOT, KSM, and WND. Only DOT was successful. Two months ago, DOT, KSM, ...
Bomax Chen's user avatar
0 votes
0 answers
21 views

What is the usecase of `PassBy` trait bound

While working on types between Runtime and Host functions, types going from Runtime to host function requires a PassBy trait bound while types going from Host function to Runtime does not need that ...
vedhavyas's user avatar
  • 155
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 ...
cboo's user avatar
  • 1