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.

Introduce FromEntropy trait to replace dummy values #10465

@gavofyork

Description

@gavofyork

Introduce a new trait available in std only:

#[cfg(feature = "std")]
pub trait FromEntropy {
  fn from_entropy(entropy: impl Encode) -> Self;
}

And implement it for AccountIds, Addresss, Signatures and everything for which it is useful to be able to generate dummy values deterministically.

This can replace dummy_ functions, Defaults and helpers such as fn account() used in tests and benchmarking.

Metadata

Metadata

Assignees

Labels

I7-refactorCode needs refactoring.T1-runtimeThis PR/Issue is related to the topic “runtime”.U3-nice_to_haveIssue is worth doing eventually.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions