Skip to content

Allow removing requirement for TypeInfo bounds on type params #95

@ascjones

Description

@ascjones

Polkadot has the type Xcm<Call> which has an Order<Call> and an Order<()> which in turn has an Xcm<Call>. We get a overflow evaluating the requirement Vec<order::Order<()>>: TypeInfo

Since Call is not directly encoded, see double_encoded, this type parameter does not need to implement Encode/Decode/TypeInfo

To get around this for other derives they are just removing the bounds:

#[derivative(Clone(bound = ""), Eq(bound = ""), PartialEq(bound = ""), Debug(bound = ""))]
#[codec(encode_bound())]
#[codec(decode_bound())]

On the surface we should be able to add #[scale_info(bounds()))] from #88 to erase the bounds. Though that is not enough on its own because there is still TypeInfo requirement for adding to type_params.

So what we need to be able to do is control which type params are included in the type_params list, in addition to (or even instead of) the custom bounds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions