Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
17d7f63
Basic account composition.
gavofyork Feb 3, 2020
ae6f092
Add try_mutate_exists
gavofyork Feb 4, 2020
21e1565
De-duplicate
gavofyork Feb 4, 2020
c202dda
Refactor away the UpdateBalanceOutcome
gavofyork Feb 4, 2020
7aa6647
Expunge final UpdateBalanceOutcome refs
gavofyork Feb 4, 2020
b03d937
Refactor transfer
gavofyork Feb 4, 2020
1b74a2c
Refactor reservable currency stuff.
gavofyork Feb 4, 2020
74db69f
Test with the alternative setup.
gavofyork Feb 4, 2020
02d039d
Merge remote-tracking branch 'origin/master' into gav-composite-account
gavofyork Feb 4, 2020
d153672
Fixes
gavofyork Feb 4, 2020
459c30b
Test with both setups.
gavofyork Feb 5, 2020
f4ab417
Fixes
gavofyork Feb 5, 2020
35fcb32
Fix
gavofyork Feb 5, 2020
158863b
Fix macros
bkchr Feb 5, 2020
d7ce210
Make indices opt-in
gavofyork Feb 5, 2020
51ea88b
Remove CreationFee, and make indices opt-in.
gavofyork Feb 5, 2020
9c5539a
Fix construct_runtime
bkchr Feb 5, 2020
aed4da9
Fix last few bits
gavofyork Feb 6, 2020
21254ed
Fix tests
bkchr Feb 6, 2020
f929007
Update trait impls
gavofyork Feb 6, 2020
234ca8a
Don't hardcode the system event
bkchr Feb 6, 2020
c12175d
Make tests build and fix some stuff.
gavofyork Feb 6, 2020
ae0a7c6
Merge remote-tracking branch 'origin/master' into gav-composite-account
gavofyork Feb 6, 2020
133c060
Pointlessly bump runtime version
gavofyork Feb 6, 2020
5870f62
Fix benchmark
gavofyork Feb 6, 2020
2579ff7
Another fix
gavofyork Feb 6, 2020
571e209
Merge remote-tracking branch 'origin/master' into gav-composite-account
gavofyork Feb 6, 2020
f9adced
Whitespace
gavofyork Feb 6, 2020
2cc84bd
Make indices module economically safe
gavofyork Feb 7, 2020
06cd3a0
Migrations for indices.
gavofyork Feb 7, 2020
b656032
Fix
gavofyork Feb 7, 2020
6d02d1d
Whilespace
gavofyork Feb 7, 2020
091bf0e
Trim defunct migrations
gavofyork Feb 8, 2020
48a3450
Merge remote-tracking branch 'origin/master' into gav-composite-account
gavofyork Feb 8, 2020
ae75d69
Remove unused storage item
gavofyork Feb 8, 2020
10d28d2
Merge remote-tracking branch 'origin/master' into gav-composite-account
gavofyork Feb 9, 2020
02e67b7
Merge remote-tracking branch 'origin/master' into gav-composite-account
gavofyork Feb 9, 2020
e4a398a
More contains_key fixes
gavofyork Feb 9, 2020
9f01bf0
Merge remote-tracking branch 'origin/master' into gav-composite-account
gavofyork Feb 10, 2020
1a59997
Docs.
gavofyork Feb 10, 2020
fd6adae
Bump runtime
gavofyork Feb 10, 2020
29cefa1
Merge branch 'master' into gav-composite-account
gavofyork Feb 10, 2020
740e8a3
Merge branch 'master' into gav-composite-account
jacogr Feb 11, 2020
30cee70
Remove unneeded code
gavofyork Feb 11, 2020
6afee76
Merge branch 'gav-composite-account' of github.com:paritytech/substra…
gavofyork Feb 11, 2020
6444cc1
Merge remote-tracking branch 'origin/master' into gav-composite-account
gavofyork Feb 12, 2020
5890e24
Merge remote-tracking branch 'origin/master' into gav-composite-account
gavofyork Feb 12, 2020
411595d
Fix test
gavofyork Feb 12, 2020
a26c44d
Fix test
gavofyork Feb 12, 2020
bbacb94
Merge branch 'master' into gav-composite-account
gavofyork Feb 12, 2020
2f07990
Update frame/balances/src/lib.rs
gavofyork Feb 13, 2020
680c1f7
Fix ED logic
gavofyork Feb 13, 2020
446ace0
Merge branch 'gav-composite-account' of github.com:paritytech/substra…
gavofyork Feb 13, 2020
3c29022
Repatriate reserved logic
gavofyork Feb 13, 2020
cc6edb8
Typo
gavofyork Feb 13, 2020
df85e74
Fix typo
shawntabrizi Feb 13, 2020
db5c064
Merge branch 'gav-composite-account' of github.com:paritytech/substra…
gavofyork Feb 13, 2020
a7d2980
Update frame/system/src/lib.rs
gavofyork Feb 13, 2020
49bc2e0
Update frame/system/src/lib.rs
gavofyork Feb 13, 2020
c9e852c
Last few fixes
gavofyork Feb 13, 2020
86b132e
Merge branch 'gav-composite-account' of github.com:paritytech/substra…
gavofyork Feb 13, 2020
c472b53
Another fix
gavofyork Feb 13, 2020
dedc512
Merge remote-tracking branch 'origin/master' into gav-composite-account
gavofyork Feb 13, 2020
e424b22
Build fix
gavofyork Feb 13, 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
Prev Previous commit
Next Next commit
Fixes
  • Loading branch information
gavofyork committed Feb 4, 2020
commit d153672c08704f4d88b30aeee8e5d653b49d6cea
15 changes: 9 additions & 6 deletions bin/node-template/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@ impl system::Trait for Runtime {
///
/// This type is being generated by `construct_runtime!`.
type ModuleToIndex = ModuleToIndex;
/// What to do if a new account is created.
type OnNewAccount = Indices;
/// What to do if an account is fully reaped from the system.
type OnReapAccount = System;
/// The data to be stored in an account.
type AccountData = balances::AccountData<Balance>;
}

impl aura::Trait for Runtime {
Expand Down Expand Up @@ -202,16 +208,13 @@ parameter_types! {
impl balances::Trait for Runtime {
/// The type for recording an account's balance.
type Balance = Balance;
/// What to do if an account is fully reaped from the system.
type OnReapAccount = System;
/// What to do if a new account is created.
type OnNewAccount = Indices;
/// The ubiquitous event type.
type Event = Event;
type DustRemoval = ();
type TransferPayment = ();
type ExistentialDeposit = ExistentialDeposit;
type CreationFee = CreationFee;
type AccountStore = System;
}

parameter_types! {
Expand Down Expand Up @@ -244,12 +247,12 @@ construct_runtime!(
NodeBlock = opaque::Block,
UncheckedExtrinsic = UncheckedExtrinsic
{
System: system::{Module, Call, Storage, Config, Event},
System: system::{Module, Call, Storage, Config<T>, Event<T>},
Timestamp: timestamp::{Module, Call, Storage, Inherent},
Aura: aura::{Module, Config<T>, Inherent(Timestamp)},
Grandpa: grandpa::{Module, Call, Storage, Config, Event},
Indices: indices,
Balances: balances,
Balances: balances::{Module, Call, Storage, Config<T>, Event<T>},
TransactionPayment: transaction_payment::{Module, Storage},
Sudo: sudo,
// Used for the module template in `./template.rs`
Expand Down
50 changes: 26 additions & 24 deletions bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ impl frame_system::Trait for Runtime {
type AvailableBlockRatio = AvailableBlockRatio;
type Version = Version;
type ModuleToIndex = ModuleToIndex;
type AccountData = pallet_balances::AccountData<Balance>;
type OnNewAccount = Indices;
type OnReapAccount = (System, Staking, Contracts, Session, Recovery);
}

parameter_types! {
Expand Down Expand Up @@ -171,13 +174,12 @@ parameter_types! {

impl pallet_balances::Trait for Runtime {
type Balance = Balance;
type OnReapAccount = ((((System, Staking), Contracts), Session), Recovery);
type OnNewAccount = Indices;
type Event = Event;
type DustRemoval = ();
type TransferPayment = ();
type DustRemoval = ();
type Event = Event;
type ExistentialDeposit = ExistentialDeposit;
type CreationFee = CreationFee;
type AccountStore = frame_system::Module<Runtime>;
}

parameter_types! {
Expand Down Expand Up @@ -232,13 +234,13 @@ parameter_types! {
}

impl pallet_session::Trait for Runtime {
type SessionManager = Staking;
type SessionHandler = <SessionKeys as OpaqueKeys>::KeyTypeIdProviders;
type ShouldEndSession = Babe;
type Event = Event;
type Keys = SessionKeys;
type ValidatorId = <Self as frame_system::Trait>::AccountId;
type ValidatorIdOf = pallet_staking::StashOf<Self>;
type ShouldEndSession = Babe;
type SessionManager = Staking;
type SessionHandler = <SessionKeys as OpaqueKeys>::KeyTypeIdProviders;
type Keys = SessionKeys;
type DisabledValidatorsThreshold = DisabledValidatorsThreshold;
}

Expand Down Expand Up @@ -300,7 +302,6 @@ impl pallet_democracy::Trait for Runtime {
type EnactmentPeriod = EnactmentPeriod;
type LaunchPeriod = LaunchPeriod;
type VotingPeriod = VotingPeriod;
type EmergencyVotingPeriod = EmergencyVotingPeriod;
type MinimumDeposit = MinimumDeposit;
/// A straight majority of the council can decide what their next motion is.
type ExternalOrigin = pallet_collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective>;
Expand All @@ -312,6 +313,7 @@ impl pallet_democracy::Trait for Runtime {
/// Two thirds of the technical committee can have an ExternalMajority/ExternalDefault vote
/// be tabled immediately and with a shorter voting/enactment period.
type FastTrackOrigin = pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, TechnicalCollective>;
type EmergencyVotingPeriod = EmergencyVotingPeriod;
// To cancel a proposal which has been passed, 2/3 of the council must agree to it.
type CancellationOrigin = pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, CouncilCollective>;
// Any single technical committee member may veto a coming council proposal, however they can
Expand Down Expand Up @@ -340,16 +342,16 @@ parameter_types! {
impl pallet_elections_phragmen::Trait for Runtime {
type Event = Event;
type Currency = Balances;
type ChangeMembers = Council;
type CurrencyToVote = CurrencyToVoteHandler;
type CandidacyBond = CandidacyBond;
type VotingBond = VotingBond;
type TermDuration = TermDuration;
type DesiredMembers = DesiredMembers;
type DesiredRunnersUp = DesiredRunnersUp;
type LoserCandidate = ();
type BadReport = ();
type KickedMember = ();
type ChangeMembers = Council;
type DesiredMembers = DesiredMembers;
type DesiredRunnersUp = DesiredRunnersUp;
type TermDuration = TermDuration;
}

type TechnicalCollective = pallet_collective::Instance2;
Expand Down Expand Up @@ -384,17 +386,17 @@ impl pallet_treasury::Trait for Runtime {
type Currency = Balances;
type ApproveOrigin = pallet_collective::EnsureMembers<_4, AccountId, CouncilCollective>;
type RejectOrigin = pallet_collective::EnsureMembers<_2, AccountId, CouncilCollective>;
type Tippers = Elections;
type TipCountdown = TipCountdown;
type TipFindersFee = TipFindersFee;
type TipReportDepositBase = TipReportDepositBase;
type TipReportDepositPerByte = TipReportDepositPerByte;
type Event = Event;
type ProposalRejection = ();
type ProposalBond = ProposalBond;
type ProposalBondMinimum = ProposalBondMinimum;
type SpendPeriod = SpendPeriod;
type Burn = Burn;
type Tippers = Elections;
type TipCountdown = TipCountdown;
type TipFindersFee = TipFindersFee;
type TipReportDepositBase = TipReportDepositBase;
type TipReportDepositPerByte = TipReportDepositPerByte;
}

parameter_types! {
Expand Down Expand Up @@ -451,11 +453,11 @@ parameter_types! {

impl pallet_im_online::Trait for Runtime {
type AuthorityId = ImOnlineId;
type Call = Call;
type Event = Event;
type Call = Call;
type SubmitTransaction = SubmitTransaction;
type ReportUnresponsiveness = Offences;
type SessionDuration = SessionDuration;
type ReportUnresponsiveness = Offences;
}

impl pallet_offences::Trait for Runtime {
Expand Down Expand Up @@ -492,14 +494,14 @@ parameter_types! {
impl pallet_identity::Trait for Runtime {
type Event = Event;
type Currency = Balances;
type Slashed = Treasury;
type BasicDeposit = BasicDeposit;
type FieldDeposit = FieldDeposit;
type SubAccountDeposit = SubAccountDeposit;
type MaxSubAccounts = MaxSubAccounts;
type MaxAdditionalFields = MaxAdditionalFields;
type RegistrarOrigin = pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>;
type Slashed = Treasury;
type ForceOrigin = pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>;
type RegistrarOrigin = pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>;
}

impl frame_system::offchain::CreateTransaction<Runtime, UncheckedExtrinsic> for Runtime {
Expand Down Expand Up @@ -597,13 +599,13 @@ construct_runtime!(
NodeBlock = node_primitives::Block,
UncheckedExtrinsic = UncheckedExtrinsic
{
System: frame_system::{Module, Call, Storage, Config, Event},
System: frame_system::{Module, Call, Storage, Config<T>, Event<T>},
Utility: pallet_utility::{Module, Call, Storage, Event<T>},
Babe: pallet_babe::{Module, Call, Storage, Config, Inherent(Timestamp)},
Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent},
Authorship: pallet_authorship::{Module, Call, Storage, Inherent},
Indices: pallet_indices,
Balances: pallet_balances,
Balances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>},
TransactionPayment: pallet_transaction_payment::{Module, Storage},
Staking: pallet_staking,
Session: pallet_session::{Module, Call, Storage, Event, Config<T>},
Expand Down
1 change: 1 addition & 0 deletions client/cli/src/node_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ where
net_config_dir.as_ref().map(|d| d.as_ref().join(name))
}

#[cfg(test)]
mod tests {
use super::*;
use sc_network::config::identity::ed25519;
Expand Down
2 changes: 1 addition & 1 deletion client/network/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use libp2p::core::{Multiaddr, PeerId, PublicKey};
use libp2p::kad::record;
use libp2p::swarm::{NetworkBehaviourAction, NetworkBehaviourEventProcess};
use libp2p::core::{nodes::Substream, muxing::StreamMuxerBox};
use log::{debug, warn};
use log::debug;
use sp_consensus::{BlockOrigin, import_queue::{IncomingBlock, Origin}};
use sp_runtime::{traits::{Block as BlockT, NumberFor}, Justification};
use std::{iter, task::Context, task::Poll};
Expand Down
5 changes: 4 additions & 1 deletion frame/generic-asset/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1106,12 +1106,15 @@ impl<T: Subtrait> frame_system::Trait for ElevatedTrait<T> {
type Lookup = T::Lookup;
type Header = T::Header;
type Event = ();
type BlockHashCount = T::BlockHashCount;
type MaximumBlockWeight = T::MaximumBlockWeight;
type MaximumBlockLength = T::MaximumBlockLength;
type AvailableBlockRatio = T::AvailableBlockRatio;
type BlockHashCount = T::BlockHashCount;
type Version = T::Version;
type ModuleToIndex = ();
type AccountData = ();
type OnNewAccount = ();
type OnReapAccount = ();
}
impl<T: Subtrait> Trait for ElevatedTrait<T> {
type Balance = T::Balance;
Expand Down
4 changes: 2 additions & 2 deletions frame/indices/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

use sp_std::{prelude::*, marker::PhantomData, convert::TryInto};
use codec::{Encode, Codec};
use frame_support::{Parameter, decl_module, decl_event, decl_storage};
use sp_runtime::traits::{One, SimpleArithmetic, StaticLookup, Member, LookupError};
use frame_system::{IsDeadAccount, OnNewAccount};
use frame_support::{Parameter, decl_module, decl_event, decl_storage};
use frame_support::traits::{IsDeadAccount, OnNewAccount};

use self::address::Address as RawAddress;

Expand Down
3 changes: 2 additions & 1 deletion frame/vesting/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ use sp_std::prelude::*;
use sp_std::fmt::Debug;
use codec::{Encode, Decode};
use sp_runtime::{DispatchResult, RuntimeDebug, traits::{
StaticLookup, Zero, SimpleArithmetic, MaybeSerializeDeserialize, Saturating, Convert
StaticLookup, Zero, SimpleArithmetic, MaybeSerializeDeserialize, Convert
}};
use frame_support::{decl_module, decl_event, decl_storage, ensure, decl_error};
use frame_support::traits::{
Expand Down Expand Up @@ -115,6 +115,7 @@ decl_storage! {
add_extra_genesis {
config(vesting): Vec<(T::AccountId, T::BlockNumber, T::BlockNumber, BalanceOf<T>)>;
build(|config: &GenesisConfig<T>| {
use sp_runtime::traits::Saturating;
// Generate initial vesting configuration
// * who - Account which we are generating vesting configuration for
// * begin - Block when the account will start to vest
Expand Down