runtime: Account nicknames (#3930)

* Add Nicknames module for accounts.

* Integrate into node.

* Fix build

* Update srml/nicks/src/lib.rs

Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Bump runtime

* Improve weight docs

* Docs.

* Apply suggestions from code review

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Gavin Wood
2019-10-27 12:53:41 +01:00
committed by GitHub
parent ae95d05621
commit 3d6127ade0
6 changed files with 400 additions and 3 deletions
+20 -3
View File
@@ -83,8 +83,8 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// and set impl_version to equal spec_version. If only runtime
// implementation changes and behavior does not, then leave spec_version as
// is and increment impl_version.
spec_version: 185,
impl_version: 185,
spec_version: 186,
impl_version: 186,
apis: RUNTIME_API_VERSIONS,
};
@@ -440,7 +440,7 @@ impl offences::Trait for Runtime {
}
impl authority_discovery::Trait for Runtime {
type AuthorityId = BabeId;
type AuthorityId = BabeId;
}
impl grandpa::Trait for Runtime {
@@ -458,6 +458,22 @@ impl finality_tracker::Trait for Runtime {
type ReportLatency = ReportLatency;
}
parameter_types! {
pub const ReservationFee: Balance = 1 * DOLLARS;
pub const MinLength: usize = 3;
pub const MaxLength: usize = 16;
}
impl nicks::Trait for Runtime {
type Event = Event;
type Currency = Balances;
type ReservationFee = ReservationFee;
type Slashed = Treasury;
type KillOrigin = collective::EnsureMember<AccountId, CouncilCollective>;
type MinLength = MinLength;
type MaxLength = MaxLength;
}
impl system::offchain::CreateTransaction<Runtime, UncheckedExtrinsic> for Runtime {
type Public = <Signature as traits::Verify>::Signer;
type Signature = Signature;
@@ -518,6 +534,7 @@ construct_runtime!(
AuthorityDiscovery: authority_discovery::{Module, Call, Config<T>},
Offences: offences::{Module, Call, Storage, Event},
RandomnessCollectiveFlip: randomness_collective_flip::{Module, Call, Storage},
Nicks: nicks::{Module, Call, Storage, Event<T>},
}
);