Questions tagged [types]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
16 views

Multiple test mock runtimes with slightly different configs based off common base?

We have some custom pallet unit tests that use multiple mock runtimes that are configured slightly differently. The problem is that when we have to make changes to the runtime, we have to apply those ...
1 vote
1 answer
53 views

Add my custom chain types to Polkadot-js/apps

I want to add my chain types to the Polkadot-js/apps in order to reflect the changes on frontend. I've tried generating types using this tutorial, but I've no idea how can I use them in Polkadot-js/...
2 votes
1 answer
56 views

MultiLocation type polkadot js

I am trying to figure out correct way how to type MultiLocation type I thought that I would do import {MultiLocation} from "@polkadot/types/interfaces" const location: MultiLocation = { ...
0 votes
1 answer
78 views

Custom RPC sized array parameters

I have custom RPC, which looks like so #[rpc(client, server)] pub trait SomeRpcApi { #[method(name = "some_submitData")] async fn submit_data( &self, id: u64, ...
0 votes
1 answer
35 views

How can i resolve this weird error with StorageMap implementation?

I am trying to upgrade pallet-did to substrate v4 but i have an issue am facing with the StorageMap implementation. Below is the code for the storage map functions i am trying to implement: #[pallet::...
0 votes
1 answer
17 views

impl<T: Config> unconstrained type parameter

Struct #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Encode, Decode, TypeInfo)] #[cfg_attr(feature = "std", derive(Debug))] pub struct Post<PostId, AccountId> { pub id: PostId, ...
2 votes
0 answers
44 views

Updating AssetId when using pallet_assets

I am trying to use the pallet_asset, but the AssetId type is giving me some trouble. Try nbr.1: Create a storage value TokenId that takes a u32 Create the AssetId from the u32 inside the storage: ...
1 vote
0 answers
30 views

how to get type registry for substrate v4.0.0 parachain?

so i have a parachain upgraded to substrate 4.0.0 and i need the type registry of this chain in order to work with subscan-essentials normally with substrate-node-template subscan-essentials work ...
4 votes
2 answers
106 views

Correct way to use dynamic sized types in chain extension

I'm writing chain extensions for my pallets and I have a few functions that require dynamic sized types, for example Vec<u8> for metadata and Vec<u64> for a list of asset ids. The way I am ...
  • 105
2 votes
1 answer
86 views

How does typegen work with metadata v14?

In the new metadata v14, a types.json is no longer required for custom types. How does this affect the typegen procedure in the docs which require us to specify these types in the definition.ts for ...
  • 481
7 votes
1 answer
76 views

What are type bundles and versioned metadata?

I was exploring typegen for my node's custom types and came across these two concepts in the acala.js codebase in the type-definitions package (their use of a "types-bundle.json"), and ...
  • 481
1 vote
1 answer
88 views

Why can't we use `T::Call` in pallet like `T::AccountId` and `T::BlockNumber`?

I am trying to use T::Call (This type is defined in frame_system) in storage and pallet dispatchable functions but getting below error. error[E0277]: the trait bound `<T as frame_system::Config>:...
5 votes
1 answer
261 views

Cannot infer type for type parameter 'T'

I have a function using the following 2 types: pub type BalanceOf<T> = <<T as pallet::Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance; pub ...
0 votes
1 answer
32 views

Substrate Sidecar Custom Type Issue

I'm wiring up the substrate sidecar to a chain which has some custom type and some out of date types (as compared to current) such as AccountInfo. I've found that it uses the older ...