Skip to content

Commit c93ccd6

Browse files
authored
Merge pull request #51 from scs/upstream-upgrade-00a400f82539e2f78e8ddbcd98aea512c87c5f3c
upstream upgrade ** updated storage_key_hash computation ** replaced get_fee_balance with get_account_data examples work except for compose_exctrinsic_offline and example_contract, which is the status_quo from before.
2 parents 12a044c + c9aae8c commit c93ccd6

21 files changed

+131
-125
lines changed

Cargo.toml

Lines changed: 34 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ serde = { version = "1.0", optional = true, features = ["derive"] }
1313
serde_json = { version = "1.0", optional = true }
1414
primitive-types = { version = "0.6", default-features = false, features = ["codec"] }
1515

16-
[dependencies.primitives]
16+
[dependencies.sp-core]
1717
git = "https://github.com/paritytech/substrate"
18-
rev = "3bf9540e72df5ecb3955845764dfee7dcdbb26b5"
19-
package = "substrate-primitives"
18+
rev = "00a400f82539e2f78e8ddbcd98aea512c87c5f3c"
19+
package = "sp-core"
2020
default-features = false
2121
features = ["full_crypto"]
2222

@@ -28,81 +28,81 @@ default-features = false
2828

2929
[dependencies.indices]
3030
git = "https://github.com/paritytech/substrate"
31-
rev = "3bf9540e72df5ecb3955845764dfee7dcdbb26b5"
31+
rev = "00a400f82539e2f78e8ddbcd98aea512c87c5f3c"
3232
package = "pallet-indices"
3333
default-features=false
3434

3535
[dependencies.runtime_io]
3636
git = "https://github.com/paritytech/substrate"
37-
rev = "3bf9540e72df5ecb3955845764dfee7dcdbb26b5"
38-
package = "sr-io"
37+
rev = "00a400f82539e2f78e8ddbcd98aea512c87c5f3c"
38+
package = "sp-io"
3939
default-features=false
4040

4141
[dependencies.metadata]
4242
git = "https://github.com/paritytech/substrate"
43-
rev = "3bf9540e72df5ecb3955845764dfee7dcdbb26b5"
44-
package = "palette-metadata"
43+
rev = "00a400f82539e2f78e8ddbcd98aea512c87c5f3c"
44+
package = "frame-metadata"
4545
default-features=false
4646

47-
[dependencies.runtime_version]
47+
[dependencies.sp-version]
4848
git = "https://github.com/paritytech/substrate"
49-
rev = "3bf9540e72df5ecb3955845764dfee7dcdbb26b5"
50-
package = "sr-version"
49+
rev = "00a400f82539e2f78e8ddbcd98aea512c87c5f3c"
50+
package = "sp-version"
5151
default-features=false
5252

5353
[dependencies.balances]
5454
git = "https://github.com/paritytech/substrate"
55-
rev = "3bf9540e72df5ecb3955845764dfee7dcdbb26b5"
55+
rev = "00a400f82539e2f78e8ddbcd98aea512c87c5f3c"
5656
package = "pallet-balances"
5757
default-features=false
5858

5959
[dependencies.system]
6060
git = "https://github.com/paritytech/substrate"
61-
rev = "3bf9540e72df5ecb3955845764dfee7dcdbb26b5"
62-
package = "palette-system"
61+
rev = "00a400f82539e2f78e8ddbcd98aea512c87c5f3c"
62+
package = "frame-system"
6363
default-features=false
6464

65-
[dependencies.runtime_primitives]
65+
[dependencies.sp-runtime]
6666
git = "https://github.com/paritytech/substrate"
67-
rev = "3bf9540e72df5ecb3955845764dfee7dcdbb26b5"
68-
package = "sr-primitives"
67+
rev = "00a400f82539e2f78e8ddbcd98aea512c87c5f3c"
68+
package = "sp-runtime"
6969
default-features=false
7070

71-
[dependencies.runtime_support]
71+
[dependencies.support]
7272
git = "https://github.com/paritytech/substrate"
73-
rev = "3bf9540e72df5ecb3955845764dfee7dcdbb26b5"
74-
package = "palette-support"
73+
rev = "00a400f82539e2f78e8ddbcd98aea512c87c5f3c"
74+
package = "frame-support"
7575
default-features=false
7676

77-
[dependencies.rstd]
77+
[dependencies.sp-std]
7878
git = "https://github.com/paritytech/substrate"
79-
rev = "3bf9540e72df5ecb3955845764dfee7dcdbb26b5"
80-
package = "sr-std"
79+
rev = "00a400f82539e2f78e8ddbcd98aea512c87c5f3c"
80+
package = "sp-std"
8181
default-features = false
8282

8383
[dev-dependencies.node_runtime]
8484
git = "https://github.com/paritytech/substrate"
85-
rev = "3bf9540e72df5ecb3955845764dfee7dcdbb26b5"
85+
rev = "00a400f82539e2f78e8ddbcd98aea512c87c5f3c"
8686
package = "node-runtime"
8787

8888
[dependencies.node_primitives]
8989
git = "https://github.com/paritytech/substrate"
90-
rev = "3bf9540e72df5ecb3955845764dfee7dcdbb26b5"
90+
rev = "00a400f82539e2f78e8ddbcd98aea512c87c5f3c"
9191
package = "node-primitives"
9292
default-features=false
9393

9494
[dev-dependencies.contracts]
9595
git = "https://github.com/paritytech/substrate"
96-
rev = "3bf9540e72df5ecb3955845764dfee7dcdbb26b5"
96+
rev = "00a400f82539e2f78e8ddbcd98aea512c87c5f3c"
9797
package = "pallet-contracts"
9898

9999
[dev-dependencies]
100100
wabt = "0.9.0"
101101

102102
[dev-dependencies.keyring]
103103
git = "https://github.com/paritytech/substrate"
104-
rev = "3bf9540e72df5ecb3955845764dfee7dcdbb26b5"
105-
package = "substrate-keyring"
104+
rev = "00a400f82539e2f78e8ddbcd98aea512c87c5f3c"
105+
package = "sp-keyring"
106106

107107
[dev-dependencies.clap]
108108
version = "2.33"
@@ -111,18 +111,18 @@ features = ["yaml"]
111111
[features]
112112
default = ["std"]
113113
std = [
114-
"primitives/std",
114+
"sp-core/std",
115115
"codec/std",
116-
"runtime_primitives/std",
117-
"runtime_support/std",
118-
"runtime_primitives/std",
116+
"sp-runtime/std",
117+
"support/std",
118+
"sp-runtime/std",
119119
"system/std",
120120
"balances/std",
121-
"runtime_version/std",
121+
"sp-version/std",
122122
"metadata/std",
123123
"runtime_io/std",
124124
"indices/std",
125-
"primitives/std",
125+
"sp-core/std",
126126
"serde/std",
127127
"serde_json",
128128
"env_logger",
@@ -168,6 +168,3 @@ path = "src/examples/example_compose_extrinsic_offline.rs"
168168
[[example]]
169169
name = "example_sudo"
170170
path = "src/examples/example_sudo.rs"
171-
172-
[patch.crates-io]
173-
ed25519-dalek = { git = "https://github.com/scs/ed25519-dalek.git", branch = "no_std_sgx"}

ci/install_rust.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ source $HOME/.cargo/env
1414

1515
# Install nightly that supports clippy
1616
# Overview: https://rust-lang.github.io/rustup-components-history/index.html
17-
rustup default nightly-2019-11-17
17+
rustup default nightly-2020-02-06
1818

1919
# Install aux components, clippy for linter, rustfmt for formatting
2020
rustup component add clippy

src/examples/example_compose_extrinsic_offline.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use clap::{load_yaml, App};
2020

2121
use keyring::AccountKeyring;
2222
use node_runtime::{BalancesCall, Call};
23-
use primitives::crypto::Pair;
23+
use sp_core::crypto::Pair;
2424

2525
use substrate_api_client::{
2626
compose_extrinsic_offline, extrinsic::xt_primitives::UncheckedExtrinsicV4, Api,

src/examples/example_contract.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ use clap::{load_yaml, App};
2727
use codec::Decode;
2828
use keyring::AccountKeyring;
2929
use log::*;
30-
use primitives::H256 as Hash;
31-
use rstd::prelude::*;
30+
use sp_core::H256 as Hash;
31+
use sp_std::prelude::*;
3232

3333
// FIXME: this type doesn't include contract events -> example broken (would rely on test-node-runtime which we try
3434
// to avoid because of a cargo issue https://github.com/rust-lang/cargo/issues/6571)
@@ -122,7 +122,7 @@ fn subcribe_to_code_stored_event(events_out: &Receiver<String>) -> Hash {
122122
if let Ok(evts) = _events {
123123
for evr in &evts {
124124
debug!("decoded: phase {:?} event {:?}", evr.phase, evr.event);
125-
if let Event::contracts(ce) = &evr.event {
125+
if let Event::pallet_contracts(ce) = &evr.event {
126126
if let contracts::RawEvent::CodeStored(code_hash) = &ce {
127127
info!("Received Contract.CodeStored event");
128128
info!("Codehash: {:?}", code_hash);
@@ -144,7 +144,7 @@ fn subscribe_to_code_instantiated_event(events_out: &Receiver<String>) -> Generi
144144
if let Ok(evts) = _events {
145145
for evr in &evts {
146146
debug!("decoded: phase {:?} event {:?}", evr.phase, evr.event);
147-
if let Event::contracts(ce) = &evr.event {
147+
if let Event::pallet_contracts(ce) = &evr.event {
148148
if let contracts::RawEvent::Instantiated(from, deployed_at) = &ce {
149149
info!("Received Contract.Instantiated Event");
150150
info!("From: {:?}", from);

src/examples/example_custom_storage_struct.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use clap::{load_yaml, App};
2323
use codec::{Decode, Encode};
2424
use keyring::AccountKeyring;
2525
use log::*;
26-
use primitives::{crypto::Pair, H256};
26+
use sp_core::{crypto::Pair, H256};
2727

2828
use substrate_api_client::{
2929
compose_extrinsic, extrinsic::xt_primitives::UncheckedExtrinsicV4, utils::*, Api,

src/examples/example_event_callback.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ use std::sync::mpsc::channel;
1919
use clap::{load_yaml, App};
2020
use codec::Decode;
2121
use log::{debug, error};
22-
use primitives::sr25519;
23-
use primitives::H256 as Hash;
22+
use sp_core::sr25519;
23+
use sp_core::H256 as Hash;
2424

2525
// This module depends on node_runtime.
2626
// To avoid dependency collisions, node_runtime has been removed from the substrate-api-client library.
@@ -51,7 +51,7 @@ fn main() {
5151
for evr in &evts {
5252
println!("decoded: phase {:?} event {:?}", evr.phase, evr.event);
5353
match &evr.event {
54-
Event::balances(be) => {
54+
Event::pallet_balances(be) => {
5555
println!(">>>>>>>>>> balances event: {:?}", be);
5656
match &be {
5757
balances::RawEvent::Transfer(transactor, dest, value, fee) => {

src/examples/example_generic_extrinsic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
1919
use clap::{load_yaml, App};
2020
use keyring::AccountKeyring;
21-
use primitives::crypto::Pair;
21+
use sp_core::crypto::Pair;
2222

2323
use substrate_api_client::{
2424
compose_extrinsic, extrinsic::xt_primitives::UncheckedExtrinsicV4, Api,

src/examples/example_get_storage.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use clap::{load_yaml, App};
1818
use codec::Encode;
1919
use keyring::AccountKeyring;
2020

21-
use primitives::crypto::Pair;
21+
use sp_core::crypto::Pair;
2222
use substrate_api_client::{utils::hexstr_to_u256, Api};
2323

2424
fn main() {

src/examples/example_print_metadata.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ extern crate clap;
2121

2222
use clap::App;
2323

24-
use primitives::sr25519;
24+
use sp_core::sr25519;
2525

2626
use substrate_api_client::node_metadata;
2727
use substrate_api_client::Api;

src/examples/example_sudo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
use clap::{load_yaml, App};
2020
use codec::Compact;
2121
use keyring::AccountKeyring;
22-
use primitives::crypto::Pair;
22+
use sp_core::crypto::Pair;
2323
use substrate_api_client::{
2424
compose_call, compose_extrinsic,
2525
extrinsic::xt_primitives::{GenericAddress, UncheckedExtrinsicV4},

0 commit comments

Comments
 (0)