Questions tagged [serialization]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers

subxt: How to derive serialize trait for runtime type?

I want to define a struct serializeable to json #[derive(Serialize)] struct Struct { item: SomeRuntimeType, } but I get this error: error[E0277]: the trait bound `pallet_pallet::types::...
Hugo Trentesaux's user avatar
2 votes
1 answer

The trait Deserialize is not implemented for a Get<u32> constant

I am implementing the MaxEncodedLen trait for my pallet. I have this struct in a separate crate. I use this struct as my GenesisConfig, which is why it derives serde::Serialize and serde::Deserialize :...
Clara van Staden's user avatar
2 votes
1 answer

Scale codec: Is there a way to extract an enum's arm's codec index value?

Using scale, an enum can be written like this: #[derive(Debug, Clone, PartialEq, Eq, Encode, Decode)] pub enum Block { #[codec(index = 101)] V1(BlockV1), } The #[codec(index = 101)], the 101 ...
The Quantum Physicist's user avatar
8 votes
1 answer

How to setup and RPC call that accepts a u128 input?

I cannot seem to setup a RPC call that accepts a u128 param. I can input the following let u128Input = new BN("10") let output = await api.rpc.template.testRpc(u128Input); but get an error ...
drbh's user avatar
  • 83