-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very neat :) 👍 I personally agree with decoupling modules and using more traits. But to get the context, was it explicitly discussed somewhere to make this change (recalling the recent PR on randomness refactoring)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nitpicks, otherwise it looks good
@@ -33,7 +33,7 @@ pub use sr_primitives::BuildStorage; | |||
pub use timestamp::Call as TimestampCall; | |||
pub use balances::Call as BalancesCall; | |||
pub use sr_primitives::{Permill, Perbill}; | |||
pub use support::{StorageValue, construct_runtime, parameter_types}; | |||
pub use support::{StorageValue, construct_runtime, parameter_types, traits::Randomness}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need the trait here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise have this error
error[E0599]: no function or associated item named `random_seed` found for type `srml_randomness_collective_flip::Module<Runtime>` in the current scope
--> node/runtime/src/lib.rs:594:30
|
594 | RandomnessCollectiveFlip::random_seed()
| ^^^^^^^^^^^ function or associated item not found in `srml_randomness_collective_flip::Module<Runtime>`
|
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope, perhaps add a `use` for it:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh it is used there. Okay :)
@@ -22,7 +22,7 @@ | |||
|
|||
use rstd::prelude::*; | |||
use support::{ | |||
construct_runtime, parameter_types, traits::{SplitTwoWays, Currency} | |||
construct_runtime, parameter_types, traits::{SplitTwoWays, Currency, Randomness} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same.
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com> Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
@kianenigma No there isn't previous discussion about this. Just me want to write some code that doesn't involve too much thinking. |
Decouple randomness-collective-flip and other modules