Skip to content
This repository has been archived by the owner on Feb 28, 2021. It is now read-only.

Commit

Permalink
Update substrate
Browse files Browse the repository at this point in the history
  • Loading branch information
rockbmb committed Nov 30, 2019
1 parent 9f1d406 commit ad608a9
Show file tree
Hide file tree
Showing 19 changed files with 1,231 additions and 855 deletions.
1,726 changes: 1,051 additions & 675 deletions Cargo.lock

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@ log = "0.4"
parity-scale-codec = "1.0"
tokio = "0.1"

[dependencies.paint-system]
[dependencies.frame-system]
git = "https://github.com/paritytech/substrate"
rev = "dc4a8329b9c47790c25429a5df272b3648275c1b"
rev = "b41085293e28b699702519879a73349a1ddcc439"

[dependencies.paint-support]
[dependencies.frame-support]
git = "https://github.com/paritytech/substrate"
rev = "dc4a8329b9c47790c25429a5df272b3648275c1b"
rev = "b41085293e28b699702519879a73349a1ddcc439"

[dependencies.paint-transaction-payment]
[dependencies.pallet-transaction-payment]
git = "https://github.com/paritytech/substrate"
rev = "dc4a8329b9c47790c25429a5df272b3648275c1b"
rev = "b41085293e28b699702519879a73349a1ddcc439"

[dependencies.substrate-primitives]
git = "https://github.com/paritytech/substrate"
rev = "dc4a8329b9c47790c25429a5df272b3648275c1b"
rev = "b41085293e28b699702519879a73349a1ddcc439"

[dependencies.sr-primitives]
git = "https://github.com/paritytech/substrate"
rev = "dc4a8329b9c47790c25429a5df272b3648275c1b"
rev = "b41085293e28b699702519879a73349a1ddcc439"

[dependencies.sr-io]
git = "https://github.com/paritytech/substrate"
rev = "dc4a8329b9c47790c25429a5df272b3648275c1b"
rev = "b41085293e28b699702519879a73349a1ddcc439"
4 changes: 2 additions & 2 deletions client/src/base.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use frame_support::storage::generator::{StorageMap, StorageValue};
use futures01::future::Future;
use paint_support::storage::generator::{StorageMap, StorageValue};
use parity_scale_codec::FullCodec;
use sr_primitives::traits::Hash as _;
use substrate_primitives::ed25519;
Expand Down Expand Up @@ -134,7 +134,7 @@ fn extract_events(block: OpaqueBlock, ext_success: ExtrinsicSuccess) -> Option<V
.events
.iter()
.filter_map(|event_record| match event_record.phase {
paint_system::Phase::ApplyExtrinsic(i) if i == xt_index as u32 => {
frame_system::Phase::ApplyExtrinsic(i) if i == xt_index as u32 => {
Some(event_record.event.clone())
}
_ => None,
Expand Down
8 changes: 4 additions & 4 deletions client/src/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,17 @@ impl Call for registry::TransferFromProjectParams {

/// Extract the dispatch result of an extrinsic from the extrinsic events.
///
/// Looks for the [paint_system::Event] in the list of events and returns the inner result based on
/// Looks for the [frame_system::Event] in the list of events and returns the inner result based on
/// the event.
///
/// Returns an outer [EventParseError] if no [paint_system::Event] was present in `events`.
/// Returns an outer [EventParseError] if no [frame_system::Event] was present in `events`.
///
/// Because of an issue with substrate the `message` field of [DispatchError] will always be `None`
fn get_dispatch_result(events: &[Event]) -> Result<Result<(), DispatchError>, EventParseError> {
find_event(events, "System", |event| match event {
Event::system(system_event) => match system_event {
paint_system::Event::ExtrinsicSuccess => Some(Ok(())),
paint_system::Event::ExtrinsicFailed(ref dispatch_error) => Some(Err(*dispatch_error)),
frame_system::Event::ExtrinsicSuccess => Some(Ok(())),
frame_system::Event::ExtrinsicFailed(ref dispatch_error) => Some(Err(*dispatch_error)),
},
_ => None,
})
Expand Down
22 changes: 11 additions & 11 deletions client/src/extrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ fn transaction_extra_to_runtime_extra(
SignedExtra,
<SignedExtra as SignedExtension>::AdditionalSigned,
) {
let check_version = paint_system::CheckVersion::new();
let check_genesis = paint_system::CheckGenesis::new();
let check_era = paint_system::CheckEra::from(Era::Immortal);
let check_nonce = paint_system::CheckNonce::from(extra.nonce);
let check_weight = paint_system::CheckWeight::new();
let charge_transaction_payment = paint_transaction_payment::ChargeTransactionPayment::from(0);
let check_version = frame_system::CheckVersion::new();
let check_genesis = frame_system::CheckGenesis::new();
let check_era = frame_system::CheckEra::from(Era::Immortal);
let check_nonce = frame_system::CheckNonce::from(extra.nonce);
let check_weight = frame_system::CheckWeight::new();
let charge_transaction_payment = frame_transaction_payment::ChargeTransactionPayment::from(0);

let additional_signed = (
check_version
Expand Down Expand Up @@ -94,15 +94,15 @@ mod test {
/// Assert that extrinsics created with [create_and_sign] are validated by the runtime.
fn check_extrinsic() {
let genesis_config = GenesisConfig {
paint_aura: None,
paint_balances: None,
paint_sudo: None,
frame_aura: None,
frame_balances: None,
frame_sudo: None,
system: None,
};
let mut test_ext = sr_io::TestExternalities::new(genesis_config.build_storage().unwrap());
let (key_pair, _) = ed25519::Pair::generate();

type System = paint_system::Module<Runtime>;
type System = frame_system::Module<Runtime>;
let genesis_hash = test_ext.execute_with(|| {
System::initialize(
&1,
Expand All @@ -115,7 +115,7 @@ mod test {

let xt = signed_extrinsic(
&key_pair,
paint_system::Call::fill_block().into(),
frame_system::Call::fill_block().into(),
0,
genesis_hash,
);
Expand Down
18 changes: 9 additions & 9 deletions client/src/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use futures01::{future, prelude::*};
use std::sync::{Arc, Mutex};

use paint_support::storage::generator::{StorageMap, StorageValue};
use frame_support::storage::generator::{StorageMap, StorageValue};
use parity_scale_codec::{Decode, FullCodec};
use sr_primitives::{traits::Hash as _, BuildStorage as _};

Expand Down Expand Up @@ -31,8 +31,8 @@ pub struct MemoryClient {
impl MemoryClient {
pub fn new() -> Self {
let genesis_config = GenesisConfig {
paint_aura: None,
paint_balances: Some(BalancesConfig {
frame_aura: None,
frame_balances: Some(BalancesConfig {
balances: vec![(
ed25519::Pair::from_string("//Alice", None)
.unwrap()
Expand All @@ -41,18 +41,18 @@ impl MemoryClient {
)],
vesting: vec![],
}),
paint_sudo: None,
frame_sudo: None,
system: None,
};
let mut test_ext = sr_io::TestExternalities::new(genesis_config.build_storage().unwrap());
let genesis_hash = test_ext.execute_with(|| {
paint_system::Module::<Runtime>::initialize(
frame_system::Module::<Runtime>::initialize(
&1,
&[0u8; 32].into(),
&[0u8; 32].into(),
&Default::default(),
);
paint_system::Module::<Runtime>::block_hash(0)
frame_system::Module::<Runtime>::block_hash(0)
});
MemoryClient {
test_ext: Arc::new(Mutex::new(test_ext)),
Expand Down Expand Up @@ -113,9 +113,9 @@ impl Client for MemoryClient {
let tx_hash = Hashing::hash_of(&extrinsic);
let test_ext = &mut client.test_ext.lock().unwrap();
let events = test_ext.execute_with(move || {
let event_start_index = paint_system::Module::<Runtime>::event_count();
let event_start_index = frame_system::Module::<Runtime>::event_count();
let _apply_outcome = Executive::apply_extrinsic(extrinsic).unwrap();
paint_system::Module::<Runtime>::events()
frame_system::Module::<Runtime>::events()
.into_iter()
.skip(event_start_index as usize)
.map(|event_record| event_record.event)
Expand All @@ -135,7 +135,7 @@ impl Client for MemoryClient {
fn get_transaction_extra(&self, account_id: &AccountId) -> Response<TransactionExtra, Error> {
let test_ext = &mut self.test_ext.lock().unwrap();
let nonce =
test_ext.execute_with(|| paint_system::Module::<Runtime>::account_nonce(account_id));
test_ext.execute_with(|| frame_system::Module::<Runtime>::account_nonce(account_id));
Box::new(future::ok(TransactionExtra {
nonce,
genesis_hash: self.genesis_hash,
Expand Down
26 changes: 13 additions & 13 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,55 +26,55 @@ path = "../runtime"

[dependencies.aura]
git = "https://github.com/paritytech/substrate"
rev = "dc4a8329b9c47790c25429a5df272b3648275c1b"
rev = "b41085293e28b699702519879a73349a1ddcc439"
package = "substrate-consensus-aura"

[dependencies.aura-primitives]
git = "https://github.com/paritytech/substrate"
rev = "dc4a8329b9c47790c25429a5df272b3648275c1b"
rev = "b41085293e28b699702519879a73349a1ddcc439"
package = "substrate-consensus-aura-primitives"

[dependencies.basic-authorship]
git = "https://github.com/paritytech/substrate"
rev = "dc4a8329b9c47790c25429a5df272b3648275c1b"
rev = "b41085293e28b699702519879a73349a1ddcc439"
package = "substrate-basic-authorship"

[dependencies.inherents]
git = "https://github.com/paritytech/substrate"
rev = "dc4a8329b9c47790c25429a5df272b3648275c1b"
rev = "b41085293e28b699702519879a73349a1ddcc439"
package = "substrate-inherents"

[dependencies.network]
git = "https://github.com/paritytech/substrate"
rev = "dc4a8329b9c47790c25429a5df272b3648275c1b"
rev = "b41085293e28b699702519879a73349a1ddcc439"
package = "substrate-network"

[dependencies.primitives]
git = "https://github.com/paritytech/substrate"
rev = "dc4a8329b9c47790c25429a5df272b3648275c1b"
rev = "b41085293e28b699702519879a73349a1ddcc439"
package = "substrate-primitives"

[dependencies.sr-io]
git = "https://github.com/paritytech/substrate"
rev = "dc4a8329b9c47790c25429a5df272b3648275c1b"
rev = "b41085293e28b699702519879a73349a1ddcc439"

[dependencies.substrate-cli]
git = "https://github.com/paritytech/substrate"
rev = "dc4a8329b9c47790c25429a5df272b3648275c1b"
rev = "b41085293e28b699702519879a73349a1ddcc439"

[dependencies.substrate-client]
git = "https://github.com/paritytech/substrate"
rev = "dc4a8329b9c47790c25429a5df272b3648275c1b"
rev = "b41085293e28b699702519879a73349a1ddcc439"

[dependencies.substrate-executor]
git = "https://github.com/paritytech/substrate"
rev = "dc4a8329b9c47790c25429a5df272b3648275c1b"
rev = "b41085293e28b699702519879a73349a1ddcc439"

[dependencies.substrate-service]
git = "https://github.com/paritytech/substrate"
rev = "dc4a8329b9c47790c25429a5df272b3648275c1b"
rev = "b41085293e28b699702519879a73349a1ddcc439"

[dependencies.transaction-pool]
git = "https://github.com/paritytech/substrate"
rev = "dc4a8329b9c47790c25429a5df272b3648275c1b"
package = "substrate-transaction-pool"
rev = "b41085293e28b699702519879a73349a1ddcc439"
package = "sc-transaction-pool"
6 changes: 3 additions & 3 deletions node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ fn dev_genesis_config() -> GenesisConfig {
code: WASM_BINARY.to_vec(),
changes_trie_config: Default::default(),
}),
paint_balances: Some(BalancesConfig {
frame_balances: Some(BalancesConfig {
balances: endowed_accounts
.iter()
.cloned()
.map(|k| (k, 1 << 60))
.collect(),
vesting: vec![],
}),
paint_sudo: Some(SudoConfig { key: root_key }),
paint_aura: Some(AuraConfig { authorities }),
frame_sudo: Some(SudoConfig { key: root_key }),
frame_aura: Some(AuraConfig { authorities }),
}
}
Loading

0 comments on commit ad608a9

Please sign in to comment.