Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extract reward module #49

Merged
merged 2 commits into from
Jul 29, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
23 changes: 23 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ members = [
"srml/support",
"srml/aura",
"srml/try",
"srml/reward",
]

exclude = ["node/runtime/wasm"]
Expand Down
10 changes: 8 additions & 2 deletions node/cli/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ use node_runtime::{
Perbill, SECS_PER_BLOCK, KtonConfig,
SessionConfig, SessionKeys, StakerStatus,
StakingConfig, SudoConfig, SystemConfig, TimestampConfig,
RewardConfig,
};
pub use node_runtime::GenesisConfig;
use primitives::{crypto::UncheckedInto, ed25519, Pair, sr25519};
Expand Down Expand Up @@ -114,7 +115,6 @@ fn staging_testnet_config_genesis() -> GenesisConfig {
.chain(initial_authorities.iter().map(|x| (x.0.clone(), ENDOWMENT)))
.collect(),
vesting: vec![],
sys_acc: hex!["984d592d15d930ac36e6716407fbed3f7d1e2e62bc11f8429345f8b8b0dfc107"].unchecked_into(),
}),
indices: Some(IndicesConfig {
ids: endowed_accounts.iter().cloned()
Expand Down Expand Up @@ -153,6 +153,10 @@ fn staging_testnet_config_genesis() -> GenesisConfig {
grandpa: Some(GrandpaConfig {
authorities: initial_authorities.iter().map(|x| (x.3.clone(), 1)).collect(),
}),
reward: Some(RewardConfig {
sys_acc: hex!["984d592d15d930ac36e6716407fbed3f7d1e2e62bc11f8429345f8b8b0dfc107"].unchecked_into(),
}),

}
}

Expand Down Expand Up @@ -247,7 +251,6 @@ pub fn testnet_genesis(
.chain(initial_authorities.iter().map(|x| (x.0.clone(), ENDOWMENT)))
.collect(),
vesting: vec![],
sys_acc: hex!["984d592d15d930ac36e6716407fbed3f7d1e2e62bc11f8429345f8b8b0dfc107"].unchecked_into(),
}),
session: Some(SessionConfig {
validators: initial_authorities.iter().map(|x| x.1.clone()).collect(),
Expand Down Expand Up @@ -285,6 +288,9 @@ pub fn testnet_genesis(
grandpa: Some(GrandpaConfig {
authorities: initial_authorities.iter().map(|x| (x.3.clone(), 1)).collect(),
}),
reward: Some(RewardConfig {
sys_acc: hex!["984d592d15d930ac36e6716407fbed3f7d1e2e62bc11f8429345f8b8b0dfc107"].unchecked_into(),
}),
}
}

Expand Down
3 changes: 2 additions & 1 deletion node/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ substrate-keyring = { git = 'https://github.com/paritytech/substrate.git', optio
kton = { package = "evo-kton", path = '../../srml/kton', default-features = false}
staking = { package = "evo-staking", path = "../../srml/staking", default-features = false}
aura = { package = "srml-aura", path = "../../srml/aura", default-features = false }
#aura = { package = "srml-aura", path = "../../srml/aura", default-features = false}
reward = { package = "evo-reward", path = "../../srml/reward", default-features = false}

[features]
default = ["std"]
Expand Down Expand Up @@ -80,4 +80,5 @@ std = [
"substrate-keyring",
"offchain-primitives/std",
"kton/std",
"reward/std",
]
13 changes: 9 additions & 4 deletions node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,17 @@ impl balances::Trait for Runtime {

impl kton::Trait for Runtime {
type Balance = Balance;
type Currency = Balances;
type Event = Event;
type OnMinted = ();
type OnRemoval = ();
type SystemRefund = ();
type OnAccountBalanceChanged = Reward;
}

impl reward::Trait for Runtime {
type Kton = Kton;
type Ring = Balances;
type Event = Event;
}

impl timestamp::Trait for Runtime {
type Moment = u64;
Expand Down Expand Up @@ -244,10 +248,10 @@ impl staking::Trait for Runtime {
type Currency = Kton;
type RewardCurrency = Balances;
type CurrencyToVote = CurrencyToVoteHandler;
type OnRewardMinted = ();
type OnRewardMinted = Reward;
type Event = Event;
type Reward = ();
type Slash = ();
type Reward = ();
type SessionsPerEra = SessionsPerEra;
type BondingDuration = BondingDuration;
// customed
Expand Down Expand Up @@ -337,6 +341,7 @@ construct_runtime!(
Contracts: contracts,
Sudo: sudo,
Kton: kton,
Reward: reward,
}
);

Expand Down
21 changes: 21 additions & 0 deletions node/runtime/wasm/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion srml/kton/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ timestamp = { package = "srml-timestamp", git = 'https://github.com/paritytech/s
substrate-primitives = { git = 'https://github.com/paritytech/substrate.git', default-features = false }
dsupport = { package = "evo-support", path = "../support", default-features = false }


[dev-dependencies]
runtime_io = { package = "sr-io", git = 'https://github.com/paritytech/substrate.git' }
substrate-primitives = { git = 'https://github.com/paritytech/substrate.git' }
Expand Down
Loading