Skip to content

Should SubstrateType more consistent with RustTypeMarker ? #36

Description

@yjhmelody

I noticed that SubstrateType is a stateful version of RustTypeMarker. And I think them should keep similiar as possible.

I think the following common types should be defined in a new enum type.

pub enum SubstrateType {
	/// 512-bit hash type
	H512(primitives::H512),
	/// 256-bit hash type
	H256(primitives::H256),

	/// Recursive Call Type
	Call(Vec<(String, SubstrateType)>),
	/// Era
	Era(runtime_primitives::generic::Era),

	/// Vote
	#[serde(with = "RemoteVote")]
	GenericVote(pallet_democracy::Vote),
 ...

And SubstrateType should be:

pub enum SubstrateType<T> {
     Common(T),
 ...

Other people can compose their own implementations more easily.
And can ensure that the core changes as little as possible

How about your thinking?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions