Skip to content

conflict between custom-types from different metadatas #74

@mission-liao

Description

@mission-liao

Hi, I encounter an issue on Kusama when regsitering custom types from different metadatas, specifically, one is spec "9151" and another one is "9300". The type:[sp_runtime:DispatchError] in these two metadata are different

The one in 9151

sp_runtime:DispatchError {Type:enum TypeString: TypeMapping:[[Other empty] [CannotLookup empty] [BadOrigin empty] [Module [["index","U8"],["error","U8"]]] [ConsumerRemaining empty] [NoProviders empty] [Token sp_runtime:TokenError] [Arithmetic sp_runtime:ArithmeticError]] ValueList:[] BitLength:0 V14:true SpecVec:0}

The one in 9300

sp_runtime:DispatchError {Type:enum TypeString: TypeMapping:[[Other empty] [CannotLookup empty] [BadOrigin empty] [Module sp_runtime:ModuleError] [ConsumerRemaining empty] [NoProviders empty] [TooManyConsumers empty] [Token sp_runtime:TokenError] [Arithmetic sp_runtime:ArithmeticError] [Transactional sp_runtime:TransactionalError]] ValueList:[] BitLength:0 V14:true SpecVec:0}

sp_runtime:ModuleError {Type:struct TypeString: TypeMapping:[[index U8] [error [U8; 4]]] ValueList:[] BitLength:0 V14:true SpecVec:0}

The type of error field is different, it's U8 in 9151 and [U8; 4] in 9300, their length in bytes are different. The sp_runtime:DispatchError in 9330 won't get registered if I register metadata from 9151 first.

It seems better to separate those type registries (currenctly in global) for different spec-versions (even different chain, for example, using this library for DOT and KSM simultaneously). Do I miss anything?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions