Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

DigestItem decl should be part of macro #926

@gavofyork

Description

@gavofyork

In node/runtime/src/lib.rs, we currently have a piece of module-routing boilerplate; this should be auto-generated from the construct_runtime macro.

impl DigestItem for Log {
	type Hash = Hash;
	type AuthorityId = SessionKey;

	fn as_authorities_change(&self) -> Option<&[Self::AuthorityId]> {
		match self.0 {
			InternalLog::consensus(ref item) => item.as_authorities_change(),
			_ => None,
		}
	}

	fn as_changes_trie_root(&self) -> Option<&Self::Hash> {
		match self.0 {
			InternalLog::system(ref item) => item.as_changes_trie_root(),
			_ => None,
		}
	}
}

Metadata

Metadata

Assignees

Labels

I7-refactorCode needs refactoring.Z2-mediumCan be fixed by a coder with good Rust knowledge but little knowledge of the codebase.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions