-
Notifications
You must be signed in to change notification settings - Fork 113
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
Migrate the node project. #1126
Changes from 1 commit
519587e
13664bb
45657b9
15e1181
10fa8dd
fb9845b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,6 @@ include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); | |
|
||
mod constants; | ||
mod integration; | ||
mod migration; | ||
mod primitives; | ||
mod runtime_api; | ||
#[cfg(test)] | ||
|
@@ -30,14 +29,11 @@ use frame_support::{construct_runtime, parameter_types}; | |
use pallet_grandpa::{AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList}; | ||
use pallet_im_online::sr25519::AuthorityId as ImOnlineId; | ||
use pallet_session::historical as pallet_session_historical; | ||
use pallet_transaction_payment::Multiplier; | ||
use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; | ||
use sp_core::crypto::KeyTypeId; | ||
use sp_runtime::curve::PiecewiseLinear; | ||
use sp_runtime::traits::{BlakeTwo256, Block as BlockT, OpaqueKeys, Saturating}; | ||
use sp_runtime::{ | ||
create_runtime_str, generic, impl_opaque_keys, FixedPointNumber, Perbill, Perquintill, | ||
}; | ||
use sp_runtime::traits::{BlakeTwo256, Block as BlockT, IdentityLookup, OpaqueKeys, Saturating}; | ||
use sp_runtime::{create_runtime_str, generic, impl_opaque_keys, Perbill}; | ||
use sp_std::boxed::Box; | ||
use sp_std::vec::Vec; | ||
#[cfg(feature = "std")] | ||
|
@@ -110,7 +106,7 @@ impl system::Trait for Runtime { | |
type Hash = Hash; | ||
type Hashing = BlakeTwo256; | ||
type AccountId = AccountId; | ||
type Lookup = Indices; | ||
type Lookup = IdentityLookup<AccountId>; | ||
type Header = generic::Header<BlockNumber, BlakeTwo256>; | ||
type Event = Event; | ||
type BlockHashCount = BlockHashCount; | ||
|
@@ -190,17 +186,6 @@ where | |
type OverarchingCall = Call; | ||
} | ||
|
||
parameter_types! { | ||
pub const IndexDeposit: Balance = 0; // no minimum deposit | ||
} | ||
|
||
impl pallet_indices::Trait for Runtime { | ||
type AccountIndex = AccountIndex; | ||
type Currency = Balances; | ||
type Deposit = IndexDeposit; | ||
type Event = Event; | ||
} | ||
|
||
parameter_types! { | ||
pub const MinimumPeriod: Moment = SLOT_DURATION / 2; | ||
} | ||
|
@@ -228,9 +213,6 @@ impl pallet_balances::Trait for Runtime { | |
|
||
parameter_types! { | ||
pub const TransactionByteFee: Balance = 0; // TODO: adjust fee | ||
pub const TargetBlockFullness: Perquintill = Perquintill::from_percent(25); | ||
pub AdjustmentVariable: Multiplier = Multiplier::saturating_from_rational(1, 100_000); | ||
pub MinimumMultiplier: Multiplier = Multiplier::saturating_from_rational(1, 1_000_000_000u128); | ||
} | ||
|
||
impl pallet_transaction_payment::Trait for Runtime { | ||
|
@@ -487,9 +469,6 @@ impl forum::Trait for Runtime { | |
type PostId = PostId; | ||
} | ||
|
||
impl migration::Trait for Runtime { | ||
type Event = Event; | ||
} | ||
// The storage working group instance alias. | ||
pub type StorageWorkingGroupInstance = working_group::Instance2; | ||
|
||
|
@@ -618,7 +597,6 @@ construct_runtime!( | |
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::{Module, Call, Storage, Config<T>, Event<T>}, | ||
Balances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>}, | ||
TransactionPayment: pallet_transaction_payment::{Module, Storage}, | ||
Staking: pallet_staking::{Module, Call, Config<T>, Storage, Event<T>, ValidateUnsigned}, | ||
|
@@ -633,7 +611,6 @@ construct_runtime!( | |
Sudo: pallet_sudo::{Module, Call, Config<T>, Storage, Event<T>}, | ||
Contracts: pallet_contracts::{Module, Call, Config, Storage, Event<T>}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unless we are able to control who can deploy contracts, we should we keep the Contracts module out for now until we decide we need it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok. I'll remove all traces of the contracts pallet. |
||
// Joystream | ||
Migration: migration::{Module, Call, Storage, Event<T>, Config}, | ||
CouncilElection: election::{Module, Call, Storage, Event<T>, Config<T>}, | ||
Council: council::{Module, Call, Storage, Event<T>, Config<T>}, | ||
Memo: memo::{Module, Call, Storage, Event<T>}, | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ use pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo; | |
use sp_api::impl_runtime_apis; | ||
use sp_core::crypto::KeyTypeId; | ||
use sp_core::OpaqueMetadata; | ||
use sp_runtime::traits::{BlakeTwo256, Block as BlockT, NumberFor, StaticLookup}; | ||
use sp_runtime::traits::{BlakeTwo256, Block as BlockT, NumberFor}; | ||
use sp_runtime::{generic, ApplyExtrinsicResult}; | ||
use sp_std::vec::Vec; | ||
|
||
|
@@ -17,12 +17,10 @@ use crate::{ | |
GrandpaId, Hash, Index, RuntimeVersion, Signature, VERSION, | ||
}; | ||
use crate::{ | ||
AllModules, AuthorityDiscovery, Babe, Call, Contracts, Grandpa, Historical, Indices, | ||
InherentDataExt, RandomnessCollectiveFlip, Runtime, SessionKeys, System, TransactionPayment, | ||
AllModules, AuthorityDiscovery, Babe, Call, Contracts, Grandpa, Historical, InherentDataExt, | ||
RandomnessCollectiveFlip, Runtime, SessionKeys, System, TransactionPayment, | ||
}; | ||
|
||
/// The address format for describing accounts. | ||
pub type Address = <Indices as StaticLookup>::Source; | ||
/// The SignedExtension to the basic transaction logic. | ||
pub type SignedExtra = ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the contracts module is in the runtime, I think there needs to be a signed extension, something about checks on Gas? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll remove all traces of the contracts pallet. |
||
system::CheckSpecVersion<Runtime>, | ||
|
@@ -51,7 +49,7 @@ pub type SignedBlock = generic::SignedBlock<Block>; | |
pub type BlockId = generic::BlockId<Block>; | ||
|
||
/// Unchecked extrinsic type as expected by this runtime. | ||
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signature, SignedExtra>; | ||
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<AccountId, Call, Signature, SignedExtra>; | ||
|
||
/// Executive: handles dispatch to the various modules. | ||
pub type Executive = | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this change, as identified by @shamil-gadelshin we were required to add
"Address": "AccountId","LookupSource": "AccountId"
to the types registration in polkadot-js api, which isn't done automatically by the api library unless it detects thenode-template
specName in the runtime version.