Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
shawntabrizi committed Mar 10, 2020
1 parent 971cdc3 commit 0af13d7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

5 changes: 4 additions & 1 deletion bin/node-template/node/src/chain_spec.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use sp_core::{Pair, Public, sr25519};
use node_template_runtime::{
AccountId, AuraConfig, BalancesConfig, GenesisConfig, GrandpaConfig,
SudoConfig, SystemConfig, WASM_BINARY, Signature
IndicesConfig, SudoConfig, SystemConfig, WASM_BINARY, Signature
};
use sp_consensus_aura::sr25519::{AuthorityId as AuraId};
use grandpa_primitives::{AuthorityId as GrandpaId};
Expand Down Expand Up @@ -127,6 +127,9 @@ fn testnet_genesis(initial_authorities: Vec<(AuraId, GrandpaId)>,
code: WASM_BINARY.to_vec(),
changes_trie_config: Default::default(),
}),
indices: Some(IndicesConfig {
indices: vec![],
}),
balances: Some(BalancesConfig {
balances: endowed_accounts.iter().cloned().map(|k|(k, 1 << 60)).collect(),
}),
Expand Down
2 changes: 2 additions & 0 deletions bin/node-template/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ aura = { version = "2.0.0-alpha.2", default-features = false, package = "pallet-
balances = { version = "2.0.0-alpha.2", default-features = false, package = "pallet-balances", path = "../../../frame/balances" }
frame-support = { version = "2.0.0-alpha.2", default-features = false, path = "../../../frame/support" }
grandpa = { version = "2.0.0-alpha.2", default-features = false, package = "pallet-grandpa", path = "../../../frame/grandpa" }
indices = { version = "2.0.0-alpha.2", default-features = false, package = "pallet-indices", path = "../../../frame/indices" }
randomness-collective-flip = { version = "2.0.0-alpha.2", default-features = false, package = "pallet-randomness-collective-flip", path = "../../../frame/randomness-collective-flip" }
sudo = { version = "2.0.0-alpha.2", default-features = false, package = "pallet-sudo", path = "../../../frame/sudo" }
system = { version = "2.0.0-alpha.2", default-features = false, package = "frame-system", path = "../../../frame/system" }
Expand Down Expand Up @@ -48,6 +49,7 @@ std = [
"frame-executive/std",
"frame-support/std",
"grandpa/std",
"indices/std",
"randomness-collective-flip/std",
"serde",
"sp-api/std",
Expand Down
7 changes: 4 additions & 3 deletions bin/node-template/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use sp_runtime::{
impl_opaque_keys, MultiSignature,
};
use sp_runtime::traits::{
BlakeTwo256, Block as BlockT, IdentityLookup, Verify, ConvertInto, IdentifyAccount
BlakeTwo256, Block as BlockT, StaticLookup, Verify, ConvertInto, IdentifyAccount
};
use sp_api::impl_runtime_apis;
use sp_consensus_aura::sr25519::AuthorityId as AuraId;
Expand Down Expand Up @@ -132,7 +132,7 @@ impl system::Trait for Runtime {
/// The aggregated dispatch type that is available for extrinsics.
type Call = Call;
/// The lookup mechanism to get account ID from whatever is passed in dispatchers.
type Lookup = IdentityLookup<AccountId>;
type Lookup = Indices;
/// The index type for storing how many extrinsics an account has signed.
type Index = Index;
/// The index type for blocks.
Expand Down Expand Up @@ -237,6 +237,7 @@ construct_runtime!(
Timestamp: timestamp::{Module, Call, Storage, Inherent},
Aura: aura::{Module, Config<T>, Inherent(Timestamp)},
Grandpa: grandpa::{Module, Call, Storage, Config, Event},
Indices: indices::{Module, Call, Storage, Event<T>, Config<T>},
Balances: balances::{Module, Call, Storage, Config<T>, Event<T>},
TransactionPayment: transaction_payment::{Module, Storage},
Sudo: sudo::{Module, Call, Config<T>, Storage, Event<T>},
Expand All @@ -246,7 +247,7 @@ construct_runtime!(
);

/// The address format for describing accounts.
pub type Address = AccountId;
pub type Address = <Indices as StaticLookup>::Source;
/// Block header type as expected by this runtime.
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
/// Block type as expected by this runtime.
Expand Down

0 comments on commit 0af13d7

Please sign in to comment.