Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
6bdf5e8
Initial Staking API
Demi-Marie Apr 30, 2020
10667e3
Merge branch 'master' of github.com:paritytech/substrate-subxt
Demi-Marie Apr 30, 2020
d4a085a
Add more staking types
Demi-Marie May 1, 2020
c08e22a
Reformat
Demi-Marie May 1, 2020
93c347c
Remove dead code
Demi-Marie May 1, 2020
fef1260
Fix missing documentation
Demi-Marie May 1, 2020
3d6e2ee
Reformat
Demi-Marie May 5, 2020
c0b1904
Merge branch 'master' into staking
Demi-Marie May 5, 2020
8721237
Merge branch 'master' into staking
Demi-Marie May 14, 2020
a28fb20
Staking: use proc macros
Demi-Marie May 15, 2020
cfabfe8
Add partial session support
Demi-Marie May 15, 2020
ff967e9
Reformat
Demi-Marie May 15, 2020
716dd13
Try to implement nomination
Demi-Marie May 17, 2020
88ac3cb
Use the #[module] macro
Demi-Marie May 17, 2020
122260f
Explain undefined method diagnostics
Demi-Marie May 17, 2020
ffbffd4
Use ‘#[module]’ and implement session for Kusama
Demi-Marie May 17, 2020
1b4dc07
Don’t impl ‘Staking’ for all ‘T: System’
Demi-Marie May 17, 2020
ebfdc17
Add staking payout support
Demi-Marie May 17, 2020
aaf190e
Fix compilation errors and remove useless lifetimes
Demi-Marie May 18, 2020
5ff1b17
Merge branch 'master' into staking
Demi-Marie May 24, 2020
58da217
Merge branch 'master' into staking
Demi-Marie May 27, 2020
ab9612b
Respond to code review
Demi-Marie May 27, 2020
193104c
Make signing fallable and asynchronous
Demi-Marie May 28, 2020
7868f2c
Merge branch 'async-signer' into staking
Demi-Marie May 28, 2020
c4942c4
Reformat
Demi-Marie May 28, 2020
c6ade8b
Refactor as suggested by Andrew Jones (@ascjones).
Demi-Marie May 28, 2020
36b124d
Reformat
Demi-Marie May 28, 2020
bc19991
Refactor as suggested by Andrew Jones (@ascjones).
Demi-Marie May 28, 2020
9fd2949
Merge branch 'async-signer' into staking
Demi-Marie May 28, 2020
e3e30cf
Trait cleanups
Demi-Marie May 29, 2020
ba4f90c
Merge branch 'master' into staking
Demi-Marie May 29, 2020
06aa7e2
Make the `Signer` impl require Send + Sync
Demi-Marie May 29, 2020
49b3b1e
Use the correct key for staking maps
Demi-Marie May 31, 2020
3314ea1
Implement set_payee call
Demi-Marie May 31, 2020
57e2390
Switch to associated types for Staking
Demi-Marie Jun 3, 2020
067c6f9
Implement `set_keys`
Demi-Marie Jun 3, 2020
83c6c61
Remove impl of Signer for Box<dyn Signer + Send + Sync>
Demi-Marie Jun 4, 2020
5bdeee4
Merge branch 'master' into staking
Demi-Marie Jun 7, 2020
7587469
Merge branch 'master' into staking
Demi-Marie Jun 8, 2020
06bc4ab
Fix Polkadot and Kusama ‘SessionKey’ structs
Demi-Marie Jun 9, 2020
6ccfc9c
Include a copy of `ValidatorId`
Demi-Marie Jun 9, 2020
d4d7b1d
Merge branch 'master' into staking
Demi-Marie Jun 16, 2020
c63b74c
Fix syntax error in Cargo.toml
Demi-Marie Jun 16, 2020
4d8ccab
Fix compile errors
Demi-Marie Jun 16, 2020
90e3b9b
Add Debug impls
Demi-Marie Jun 18, 2020
2bea59f
Fix return type of `BondedStore`
Demi-Marie Jun 18, 2020
a95fd8a
Use some upstream type definitions
Demi-Marie Jun 19, 2020
f15c5f6
Merge branch 'master' into staking
Demi-Marie Jun 25, 2020
d3df9ea
Bump deps and fix build
Demi-Marie Jun 26, 2020
ff8e37f
Remove last reference to Kusama feature
Demi-Marie Jun 30, 2020
fe20eb5
Merge remote-tracking branch 'origin/master' into staking
Demi-Marie Jul 8, 2020
e80ddd4
Merge branch 'master' into staking
Demi-Marie Jul 8, 2020
94ce5ce
Merge branch 'master' into staking
Demi-Marie Jul 18, 2020
ae676c9
Merge branch 'master' into staking
DemiMarie Aug 5, 2020
e829a46
Merge branch 'master' into staking
DemiMarie Aug 5, 2020
6bf960f
Fix compilation errors
DemiMarie Aug 8, 2020
528b218
Implement the `concat` in `twox_64_concat`
DemiMarie Aug 8, 2020
7bad6c6
Merge branch 'master' into staking
DemiMarie Aug 10, 2020
da36675
Expose properties and per-era preferences
DemiMarie Aug 12, 2020
d5b1138
Era rewards point support
DemiMarie Aug 12, 2020
28533f6
Expose clipped exposure
DemiMarie Aug 12, 2020
c330e68
Era reward points support
DemiMarie Aug 13, 2020
59decaf
Make `PayoutStakersCall` public
DemiMarie Aug 17, 2020
93fafcd
Merge remote-tracking branch 'origin/master' into staking
DemiMarie Aug 24, 2020
8bcde31
Merge branch 'master' into staking
DemiMarie Aug 28, 2020
b03b28b
Add in all default features for debugging
DemiMarie Aug 28, 2020
2744127
Chill support and update to latest Substrate
DemiMarie Aug 31, 2020
3efe16f
If property fetch fails, use dummy values
DemiMarie Sep 6, 2020
dd15f22
Merge branch 'master' into staking
DemiMarie Sep 9, 2020
773d43e
Merge branch 'master' into staking
dvdplm Sep 11, 2020
d3865a6
Fix tests
DemiMarie Sep 11, 2020
0084f87
Fix header
DemiMarie Sep 11, 2020
33f1710
Remove some code Ledgeracio does not need
DemiMarie Sep 11, 2020
9f34f76
More deletions
DemiMarie Sep 11, 2020
1df5a64
Remove more code not needed for Ledgeracio
DemiMarie Sep 12, 2020
c622641
Remove a pointless change in Cargo.toml
DemiMarie Sep 12, 2020
b253a7a
Remove more junk
DemiMarie Sep 12, 2020
1394bb9
Merge branch 'staking' of github.com:paritytech/substrate-subxt into …
dvdplm Sep 14, 2020
9a86802
Revert contracts put_code test to pure code (not using the macro)
ascjones Sep 14, 2020
0e7bc2d
Test contract instantiate
ascjones Sep 14, 2020
92bcd26
Fmt
ascjones Sep 14, 2020
95c8900
Merge remote-tracking branch 'origin/aj-contract-test' into staking
DemiMarie Sep 14, 2020
b3687af
Merge branch 'staking' of github.com:paritytech/substrate-subxt into …
dvdplm Sep 15, 2020
3020f32
Merge branch 'master' into staking
DemiMarie Sep 15, 2020
303c5f4
WIP
dvdplm Sep 15, 2020
2e74c1e
Merge branch 'master' into dp-testing-stasking-playground
DemiMarie Sep 15, 2020
f0a5f61
Add some more submission tests
DemiMarie Sep 15, 2020
e0b41af
Merge branch 'dp-testing-stasking-playground' into staking
DemiMarie Sep 15, 2020
0516987
Reformat
DemiMarie Sep 15, 2020
dffbba6
More tests
DemiMarie Sep 16, 2020
0860bad
Cleanup
dvdplm Sep 16, 2020
ec96a42
Hopefully fix CI
DemiMarie Sep 16, 2020
01869a7
Remove dead code
DemiMarie Sep 16, 2020
b54b1b9
Test chill
DemiMarie Sep 17, 2020
68ff645
Add missing docs
DemiMarie Sep 17, 2020
9c6c663
Merge remote-tracking branch 'origin/master' into staking
DemiMarie Sep 17, 2020
bc8bc36
Remove unnecessary use
DemiMarie Sep 17, 2020
dd4dce9
Revert "Remove unnecessary use"
DemiMarie Sep 17, 2020
1eb67d9
Retry on temporary failures
DemiMarie Sep 17, 2020
d63661f
Ignore the staking tests on CI
DemiMarie Sep 17, 2020
369cb88
Add separate tests for nomination, validation announcment and chilling
dvdplm Sep 18, 2020
24848b3
Obey the fmt
dvdplm Sep 18, 2020
e2862d8
Run CI with at most one test thread
DemiMarie Sep 18, 2020
8a79571
Implement tests for staking
DemiMarie Sep 19, 2020
f3da309
More tests
DemiMarie Sep 20, 2020
18e8029
Remove unhelpful println!
DemiMarie Sep 20, 2020
f7cda4a
Revert changes in contract tests
DemiMarie Sep 20, 2020
15c0206
Reformat
DemiMarie Sep 20, 2020
d659e91
Remove spurious diff
DemiMarie Sep 20, 2020
52960b7
More tests
DemiMarie Sep 21, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions src/frame/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
// Copyright 2019-2020 Parity Technologies (UK) Ltd.

//! Session support
use crate::frame::system::System;
use crate::frame::system::{
System,
SystemEventsDecoder as _,
};
use codec::Encode;
use frame_support::Parameter;
use std::{
Expand All @@ -26,15 +29,15 @@ use std::{
use substrate_subxt_proc_macro::Store;

/// The trait needed for this module.
#[module]
pub trait Session: System {
/// The validator account identifier type for the runtime.
type ValidatorId: Parameter + Debug + Ord + Default;
type ValidatorId: Parameter + Debug + Ord + Default + Send + Sync + 'static;

/// The validator account identifier type for the runtime.
type SessionIndex: Parameter + Debug + Ord + Default;
type SessionIndex: Parameter + Debug + Ord + Default + Send + Sync + 'static;
}

const MODULE: &str = "Session";

/// The current set of validators.
#[derive(Encode, Store)]
pub struct ValidatorsStore<T: Session> {
Expand Down
6 changes: 5 additions & 1 deletion src/frame/staking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@

//! Implements support for the frame_staking module.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
//! Implements support for the frame_staking module.
//! Implements support for the pallet_staking module.


use super::system::{System, SystemEventsDecoder as _};
use super::system::{
System,
SystemEventsDecoder as _,
};
use codec::{
Decode,
Encode,
Expand Down Expand Up @@ -111,6 +114,7 @@ impl Default for ValidatorPrefs {
/// The subset of the `frame::Trait` that a client must implement.
#[module]
pub trait Staking: System {}
impl<T: System> Staking for T {}

/// Just a Balance/BlockNumber tuple to encode when a chunk of funds will be unlocked.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// Just a Balance/BlockNumber tuple to encode when a chunk of funds will be unlocked.
/// A Balance/BlockNumber tuple to encode when a chunk of funds will be unlocked.

#[derive(PartialEq, Eq, Clone, Encode, Decode)]
Expand Down
6 changes: 6 additions & 0 deletions src/runtimes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ use crate::frame::{
Balances,
},
contracts::Contracts,
session::Session,
system::System,
};

Expand Down Expand Up @@ -82,6 +83,11 @@ impl System for KusamaRuntime {
type AccountData = AccountData<<Self as Balances>::Balance>;
}

impl Session for KusamaRuntime {
type SessionIndex = u32;
type ValidatorId = <Self as System>::AccountId;
}

impl Balances for KusamaRuntime {
type Balance = u128;
}