Browse Source

council - can_release_vote_stake -> can_unlock_vote_stake rename

ondratra 4 years ago
parent
commit
8ec04ef869

+ 3 - 3
runtime-modules/council/src/lib.rs

@@ -34,7 +34,7 @@
 //! ## Important functions
 //! These functions have to be called by the runtime for the council to work properly.
 //! - [recieve_referendum_results](./trait.ReferendumConnection.html#method.recieve_referendum_results)
-//! - [can_release_vote_stake](./trait.ReferendumConnection.html#method.can_release_vote_stake)
+//! - [can_unlock_vote_stake](./trait.ReferendumConnection.html#method.can_unlock_vote_stake)
 //!
 //! ## Dependencies:
 //! - [referendum](../referendum/index.html)
@@ -214,7 +214,7 @@ pub trait ReferendumConnection<T: Trait> {
         -> Result<(), Error<T>>;
 
     /// Process referendum results. This function MUST be called in runtime's implementation of referendum's `can_release_voting_stake()`.
-    fn can_release_vote_stake(
+    fn can_unlock_vote_stake(
         vote: &CastVoteOf<T>,
         current_voting_cycle_id: &u64,
     ) -> Result<(), Error<T>>;
@@ -557,7 +557,7 @@ impl<T: Trait> ReferendumConnection<T> for Module<T> {
     }
 
     /// Check that it is a proper time to release stake.
-    fn can_release_vote_stake(
+    fn can_unlock_vote_stake(
         vote: &CastVoteOf<T>,
         current_voting_cycle_id: &u64,
     ) -> Result<(), Error<T>> {

+ 2 - 2
runtime-modules/council/src/mock.rs

@@ -202,7 +202,7 @@ impl referendum::Trait<ReferendumInstance> for RuntimeReferendum {
         stake
     }
 
-    fn can_release_vote_stake(
+    fn can_unlock_vote_stake(
         vote: &CastVote<Self::Hash, BalanceReferendum<Self, ReferendumInstance>>,
         current_voting_cycle_id: &u64,
     ) -> bool {
@@ -211,7 +211,7 @@ impl referendum::Trait<ReferendumInstance> for RuntimeReferendum {
             return false;
         }
 
-        <Module<Runtime> as ReferendumConnection<Runtime>>::can_release_vote_stake(
+        <Module<Runtime> as ReferendumConnection<Runtime>>::can_unlock_vote_stake(
             vote,
             current_voting_cycle_id,
         )

+ 2 - 2
runtime-modules/referendum/src/lib.rs

@@ -194,7 +194,7 @@ pub trait Trait<I: Instance>: system::Trait {
 
     /// Checks if user can unlock his stake from the given vote.
     /// Gives runtime an ability to penalize user for not revealing stake, etc.
-    fn can_release_vote_stake(
+    fn can_unlock_vote_stake(
         vote: &CastVote<Self::Hash, Balance<Self, I>>,
         current_voting_cycle_id: &u64,
     ) -> bool;
@@ -837,7 +837,7 @@ impl<T: Trait<I>, I: Instance> EnsureChecks<T, I> {
         }
 
         // ask runtime if stake can be released
-        if !T::can_release_vote_stake(&cast_vote, &cycle_id) {
+        if !T::can_unlock_vote_stake(&cast_vote, &cycle_id) {
             return Err(Error::UnstakingForbidden);
         }
 

+ 1 - 1
runtime-modules/referendum/src/mock.rs

@@ -91,7 +91,7 @@ impl Trait<Instance0> for Runtime {
         stake
     }
 
-    fn can_release_vote_stake(
+    fn can_unlock_vote_stake(
         _vote: &CastVote<Self::Hash, Balance<Self, Instance0>>,
         _current_voting_cycle_id: &u64,
     ) -> bool {