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

Commit 6604f06

Browse files
committed
Update from parent 'origin/master' (no conflict)
Commit: 3f96ea8 Parent branch: origin/master Forked at: 2afecf8
2 parents 005a152 + 3f96ea8 commit 6604f06

File tree

12 files changed

+166
-52
lines changed

12 files changed

+166
-52
lines changed

bin/node-template/node/src/service.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ pub fn new_full(config: Configuration<GenesisConfig>)
154154
link: grandpa_link,
155155
network: service.network(),
156156
inherent_data_providers: inherent_data_providers.clone(),
157-
on_exit: service.on_exit(),
158157
telemetry_on_connect: Some(service.telemetry_on_connect_stream()),
159158
voting_rule: grandpa::VotingRulesBuilder::default().build(),
160159
prometheus_registry: service.prometheus_registry()

bin/node/cli/src/service.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,6 @@ macro_rules! new_full {
225225
link: grandpa_link,
226226
network: service.network(),
227227
inherent_data_providers: inherent_data_providers.clone(),
228-
on_exit: service.on_exit(),
229228
telemetry_on_connect: Some(service.telemetry_on_connect_stream()),
230229
voting_rule: grandpa::VotingRulesBuilder::default().build(),
231230
prometheus_registry: service.prometheus_registry(),

bin/node/runtime/src/lib.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
8282
// and set impl_version to 0. If only runtime
8383
// implementation changes and behavior does not, then leave spec_version as
8484
// is and increment impl_version.
85-
spec_version: 227,
86-
impl_version: 1,
85+
spec_version: 230,
86+
impl_version: 0,
8787
apis: RUNTIME_API_VERSIONS,
8888
};
8989

@@ -590,10 +590,15 @@ impl pallet_society::Trait for Runtime {
590590
type ChallengePeriod = ChallengePeriod;
591591
}
592592

593+
parameter_types! {
594+
pub const MinVestedTransfer: Balance = 100 * DOLLARS;
595+
}
596+
593597
impl pallet_vesting::Trait for Runtime {
594598
type Event = Event;
595599
type Currency = Balances;
596600
type BlockNumberToBalance = ConvertInto;
601+
type MinVestedTransfer = MinVestedTransfer;
597602
}
598603

599604
construct_runtime!(

client/finality-grandpa/src/lib.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ fn register_finality_tracker_inherent_data_provider<Block: BlockT, Client>(
536536
}
537537

538538
/// Parameters used to run Grandpa.
539-
pub struct GrandpaParams<Block: BlockT, C, N, SC, VR, X> {
539+
pub struct GrandpaParams<Block: BlockT, C, N, SC, VR> {
540540
/// Configuration for the GRANDPA service.
541541
pub config: Config,
542542
/// A link to the block import worker.
@@ -545,8 +545,6 @@ pub struct GrandpaParams<Block: BlockT, C, N, SC, VR, X> {
545545
pub network: N,
546546
/// The inherent data providers.
547547
pub inherent_data_providers: InherentDataProviders,
548-
/// Handle to a future that will resolve on exit.
549-
pub on_exit: X,
550548
/// If supplied, can be used to hook on telemetry connection established events.
551549
pub telemetry_on_connect: Option<futures::channel::mpsc::UnboundedReceiver<()>>,
552550
/// A voting rule used to potentially restrict target votes.
@@ -557,8 +555,8 @@ pub struct GrandpaParams<Block: BlockT, C, N, SC, VR, X> {
557555

558556
/// Run a GRANDPA voter as a task. Provide configuration and a link to a
559557
/// block import worker that has already been instantiated with `block_import`.
560-
pub fn run_grandpa_voter<Block: BlockT, BE: 'static, C, N, SC, VR, X>(
561-
grandpa_params: GrandpaParams<Block, C, N, SC, VR, X>,
558+
pub fn run_grandpa_voter<Block: BlockT, BE: 'static, C, N, SC, VR>(
559+
grandpa_params: GrandpaParams<Block, C, N, SC, VR>,
562560
) -> sp_blockchain::Result<impl Future<Output = ()> + Unpin + Send + 'static> where
563561
Block::Hash: Ord,
564562
BE: Backend<Block> + 'static,
@@ -567,15 +565,13 @@ pub fn run_grandpa_voter<Block: BlockT, BE: 'static, C, N, SC, VR, X>(
567565
VR: VotingRule<Block, C> + Clone + 'static,
568566
NumberFor<Block>: BlockNumberOps,
569567
DigestFor<Block>: Encode,
570-
X: futures::Future<Output=()> + Clone + Send + Unpin + 'static,
571568
C: ClientForGrandpa<Block, BE> + 'static,
572569
{
573570
let GrandpaParams {
574571
mut config,
575572
link,
576573
network,
577574
inherent_data_providers,
578-
on_exit,
579575
telemetry_on_connect,
580576
voting_rule,
581577
prometheus_registry,
@@ -647,7 +643,7 @@ pub fn run_grandpa_voter<Block: BlockT, BE: 'static, C, N, SC, VR, X>(
647643
let telemetry_task = telemetry_task
648644
.then(|_| future::pending::<()>());
649645

650-
Ok(future::select(future::select(voter_work, on_exit), telemetry_task).map(drop))
646+
Ok(future::select(voter_work, telemetry_task).map(drop))
651647
}
652648

653649
/// Future that powers the voter.

client/finality-grandpa/src/observer.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ pub fn run_grandpa_observer<BE, Block: BlockT, Client, N, SC>(
159159
config: Config,
160160
link: LinkHalf<Block, Client, SC>,
161161
network: N,
162-
on_exit: impl futures::Future<Output=()> + Clone + Send + Unpin + 'static,
163-
) -> sp_blockchain::Result<impl Future<Output = ()> + Unpin + Send + 'static> where
162+
) -> sp_blockchain::Result<impl Future<Output = ()> + Unpin + Send + 'static>
163+
where
164164
BE: Backend<Block> + Unpin + 'static,
165165
N: NetworkT<Block> + Send + Clone + 'static,
166166
SC: SelectChain<Block> + 'static,
@@ -194,7 +194,7 @@ pub fn run_grandpa_observer<BE, Block: BlockT, Client, N, SC>(
194194
warn!("GRANDPA Observer failed: {:?}", e);
195195
});
196196

197-
Ok(future::select(observer_work, on_exit).map(drop))
197+
Ok(observer_work.map(drop))
198198
}
199199

200200
/// Future that powers the observer.

client/finality-grandpa/src/tests.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -190,17 +190,6 @@ impl TestNetFactory for GrandpaTestNet {
190190
}
191191
}
192192

193-
#[derive(Clone)]
194-
struct Exit;
195-
196-
impl futures::Future for Exit {
197-
type Output = ();
198-
199-
fn poll(self: Pin<&mut Self>, _: &mut task::Context) -> task::Poll<()> {
200-
task::Poll::Pending
201-
}
202-
}
203-
204193
#[derive(Default, Clone)]
205194
pub(crate) struct TestApi {
206195
genesis_authorities: AuthorityList,
@@ -444,7 +433,6 @@ fn run_to_completion_with<F>(
444433
link: link,
445434
network: net_service,
446435
inherent_data_providers: InherentDataProviders::new(),
447-
on_exit: Exit,
448436
telemetry_on_connect: None,
449437
voting_rule: (),
450438
prometheus_registry: None,
@@ -576,7 +564,6 @@ fn finalize_3_voters_1_full_observer() {
576564
link: link,
577565
network: net_service,
578566
inherent_data_providers: InherentDataProviders::new(),
579-
on_exit: Exit,
580567
telemetry_on_connect: None,
581568
voting_rule: (),
582569
prometheus_registry: None,
@@ -740,7 +727,6 @@ fn transition_3_voters_twice_1_full_observer() {
740727
link: link,
741728
network: net_service,
742729
inherent_data_providers: InherentDataProviders::new(),
743-
on_exit: Exit,
744730
telemetry_on_connect: None,
745731
voting_rule: (),
746732
prometheus_registry: None,
@@ -1166,7 +1152,6 @@ fn voter_persists_its_votes() {
11661152
link,
11671153
network: this.net.lock().peers[0].network_service().clone(),
11681154
inherent_data_providers: InherentDataProviders::new(),
1169-
on_exit: Exit,
11701155
telemetry_on_connect: None,
11711156
voting_rule: VotingRulesBuilder::default().build(),
11721157
prometheus_registry: None,
@@ -1382,7 +1367,6 @@ fn finalize_3_voters_1_light_observer() {
13821367
},
13831368
link,
13841369
net.lock().peers[3].network_service().clone(),
1385-
Exit,
13861370
).unwrap()
13871371
);
13881372

@@ -1512,7 +1496,6 @@ fn voter_catches_up_to_latest_round_when_behind() {
15121496
link,
15131497
network: net.lock().peer(peer_id).network_service().clone(),
15141498
inherent_data_providers: InherentDataProviders::new(),
1515-
on_exit: Exit,
15161499
telemetry_on_connect: None,
15171500
voting_rule: (),
15181501
prometheus_registry: None,

frame/executive/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ impl<
118118
where
119119
Block::Extrinsic: Checkable<Context> + Codec,
120120
CheckedOf<Block::Extrinsic, Context>:
121-
Applyable<AccountId=System::AccountId, DispatchInfo=DispatchInfo> +
121+
Applyable<DispatchInfo=DispatchInfo> +
122122
GetDispatchInfo,
123123
CallOf<Block::Extrinsic, Context>: Dispatchable,
124124
OriginOf<Block::Extrinsic, Context>: From<Option<System::AccountId>>,
@@ -143,7 +143,7 @@ impl<
143143
where
144144
Block::Extrinsic: Checkable<Context> + Codec,
145145
CheckedOf<Block::Extrinsic, Context>:
146-
Applyable<AccountId=System::AccountId, DispatchInfo=DispatchInfo> +
146+
Applyable<DispatchInfo=DispatchInfo> +
147147
GetDispatchInfo,
148148
CallOf<Block::Extrinsic, Context>: Dispatchable,
149149
OriginOf<Block::Extrinsic, Context>: From<Option<System::AccountId>>,

frame/session/src/historical.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
2828
use sp_std::prelude::*;
2929
use codec::{Encode, Decode};
30-
use sp_runtime::KeyTypeId;
30+
use sp_runtime::{KeyTypeId, RuntimeDebug};
3131
use sp_runtime::traits::{Convert, OpaqueKeys};
3232
use frame_support::{decl_module, decl_storage};
3333
use frame_support::{Parameter, print};
@@ -258,12 +258,19 @@ impl<T: Trait> ProvingTrie<T> {
258258
}
259259

260260
/// Proof of ownership of a specific key.
261-
#[derive(Encode, Decode, Clone)]
261+
#[derive(Encode, Decode, Clone, Eq, PartialEq, RuntimeDebug)]
262262
pub struct Proof {
263263
session: SessionIndex,
264264
trie_nodes: Vec<Vec<u8>>,
265265
}
266266

267+
impl Proof {
268+
/// Returns a session this proof was generated for.
269+
pub fn session(&self) -> SessionIndex {
270+
self.session
271+
}
272+
}
273+
267274
impl<T: Trait, D: AsRef<[u8]>> frame_support::traits::KeyOwnerProofSystem<(KeyTypeId, D)>
268275
for Module<T>
269276
{

0 commit comments

Comments
 (0)