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

Decouple randomness-collective-flip #3792

Merged
merged 6 commits into from
Oct 10, 2019
Merged

Decouple randomness-collective-flip #3792

merged 6 commits into from
Oct 10, 2019

Conversation

xlc
Copy link
Contributor

@xlc xlc commented Oct 10, 2019

Decouple randomness-collective-flip and other modules

@xlc xlc changed the title Randomness Decouple randomness-collective-flip Oct 10, 2019
Copy link
Contributor

@kianenigma kianenigma left a 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)?

Copy link
Member

@bkchr bkchr left a 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};
Copy link
Member

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?

Copy link
Contributor Author

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:

Copy link
Member

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}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same.

srml/contracts/src/exec.rs Outdated Show resolved Hide resolved
xlc and others added 2 commits October 10, 2019 23:10
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
@xlc
Copy link
Contributor Author

xlc commented Oct 10, 2019

@kianenigma No there isn't previous discussion about this. Just me want to write some code that doesn't involve too much thinking.

@bkchr bkchr merged commit f922df6 into paritytech:master Oct 10, 2019
@xlc xlc deleted the randomness branch October 10, 2019 10:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants