Skip to content

Commit

Permalink
upgrade to substrate 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Alain Brenzikofer committed Oct 13, 2020
1 parent 683dd51 commit 62afbac
Show file tree
Hide file tree
Showing 8 changed files with 699 additions and 541 deletions.
1,184 changes: 670 additions & 514 deletions Cargo.lock

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "substrate-api-client"
version = "0.4.8-sub2.0.0-rc5"
version = "0.4.9-sub2.0.0"
authors = ["Supercomputing Systems AG <[email protected]>"]
edition = "2018"

Expand All @@ -15,7 +15,7 @@ thiserror = { version = "1.0", optional =true }
primitive-types = { version = "0.6.1", optional = true, features = ["codec"] }

[dependencies.sp-core]
version = '2.0.0-rc5'
version = '2.0.0'
package = "sp-core"
default-features = false
features = ["full_crypto"]
Expand All @@ -27,63 +27,63 @@ version = "1.3.1"
default-features = false

[dependencies.runtime_io]
version = '2.0.0-rc5'
version = '2.0.0'
package = "sp-io"
default-features=false

[dependencies.metadata]
version = '11.0.0-rc5'
version = '12.0.0'
package = "frame-metadata"
default-features=false

[dependencies.sp-version]
version = '2.0.0-rc5'
version = '2.0.0'
package = "sp-version"
default-features=false

[dependencies.balances]
version = '2.0.0-rc5'
version = '2.0.0'
package = "pallet-balances"
default-features=false

[dependencies.system]
version = '2.0.0-rc5'
version = '2.0.0'
package = "frame-system"
default-features=false

[dependencies.sp-runtime]
version = '2.0.0-rc5'
version = '2.0.0'
package = "sp-runtime"
default-features=false

[dependencies.support]
version = '2.0.0-rc5'
version = '2.0.0'
package = "frame-support"
default-features=false

[dependencies.sp-std]
version = '2.0.0-rc5'
version = '2.0.0'
package = "sp-std"
default-features = false

[dependencies.sc-rpc-api]
version = '0.8.0-rc5'
version = '0.8.0'
optional = true

[dev-dependencies.node_template_runtime]
git = "https://github.com/scs/substrate-api-client-test-node"
tag = 'v2.0.0-rc5'
tag = 'v2.0.0'
package = "node-template-runtime"

[dev-dependencies]
wabt = "0.9.0"

[dev-dependencies.contracts]
version = '2.0.0-rc5'
version = '2.0.0'
package = "pallet-contracts"

[dev-dependencies.keyring]
version = '2.0.0-rc5'
version = '2.0.0'
package = "sp-keyring"

[dev-dependencies.clap]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# substrate-api-client

![badge](https://img.shields.io/badge/substrate-2.0.0--rc5-success)
![badge](https://img.shields.io/badge/substrate-2.0.0-success)

<p align="center">
<img src=./web3_foundation_grants_badge_black.svg width = 400>
Expand Down
2 changes: 1 addition & 1 deletion src/examples/example_event_callback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fn main() {
for evr in &evts {
println!("decoded: {:?} {:?}", evr.phase, evr.event);
match &evr.event {
Event::balances(be) => {
Event::pallet_balances(be) => {
println!(">>>>>>>>>> balances event: {:?}", be);
match &be {
balances::RawEvent::Transfer(transactor, dest, value) => {
Expand Down
8 changes: 5 additions & 3 deletions src/node_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ impl Metadata {

#[derive(Clone, Debug)]
pub struct ModuleMetadata {
index: u8,
name: String,
storage: HashMap<String, StorageMetadata>,
// constants
Expand Down Expand Up @@ -517,7 +518,7 @@ impl TryFrom<RuntimeMetadataPrefixed> for Metadata {
return Err(ConversionError::InvalidPrefix.into());
}
let meta = match metadata.1 {
RuntimeMetadata::V11(meta) => meta,
RuntimeMetadata::V12(meta) => meta,
_ => return Err(ConversionError::InvalidVersion.into()),
};
let mut modules = HashMap::new();
Expand All @@ -540,6 +541,7 @@ impl TryFrom<RuntimeMetadataPrefixed> for Metadata {
modules.insert(
module_name.clone(),
ModuleMetadata {
index: module.index,
name: module_name.clone(),
storage: storage_map,
},
Expand All @@ -554,7 +556,7 @@ impl TryFrom<RuntimeMetadataPrefixed> for Metadata {
modules_with_calls.insert(
module_name.clone(),
ModuleWithCalls {
index: modules_with_calls.len() as u8,
index: module.index,
name: module_name.clone(),
calls: call_map,
},
Expand All @@ -568,7 +570,7 @@ impl TryFrom<RuntimeMetadataPrefixed> for Metadata {
modules_with_events.insert(
module_name.clone(),
ModuleWithEvents {
index: modules_with_events.len() as u8,
index: module.index,
name: module_name.clone(),
events: event_map,
},
Expand Down
8 changes: 4 additions & 4 deletions src/rpc/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ pub fn on_extrinsic_msg_until_finalized(
debug!("got msg {}", retstr);
match parse_status(retstr) {
(XtStatus::Finalized, val) => end_process(out, result, val),
(XtStatus::Error, e) => panic!(e),
(XtStatus::Error, e) => panic!(e.unwrap()),
(XtStatus::Future, _) => {
warn!("extrinsic has 'future' status. aborting");
end_process(out, result, None);
Expand All @@ -122,7 +122,7 @@ pub fn on_extrinsic_msg_until_in_block(
(XtStatus::Finalized, val) => end_process(out, result, val),
(XtStatus::InBlock, val) => end_process(out, result, val),
(XtStatus::Future, _) => end_process(out, result, None),
(XtStatus::Error, e) => panic!(e),
(XtStatus::Error, e) => panic!(e.unwrap()),
_ => (),
};
Ok(())
Expand All @@ -139,7 +139,7 @@ pub fn on_extrinsic_msg_until_broadcast(
(XtStatus::Finalized, val) => end_process(out, result, val),
(XtStatus::Broadcast, _) => end_process(out, result, None),
(XtStatus::Future, _) => end_process(out, result, None),
(XtStatus::Error, e) => panic!(e),
(XtStatus::Error, e) => panic!(e.unwrap()),
_ => (),
};
Ok(())
Expand All @@ -156,7 +156,7 @@ pub fn on_extrinsic_msg_until_ready(
(XtStatus::Finalized, val) => end_process(out, result, val),
(XtStatus::Ready, _) => end_process(out, result, None),
(XtStatus::Future, _) => end_process(out, result, None),
(XtStatus::Error, e) => panic!(e),
(XtStatus::Error, e) => panic!(e.unwrap()),
_ => (),
};
Ok(())
Expand Down
4 changes: 2 additions & 2 deletions test_no_std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ default-features=false
features=["full_crypto"]

[dependencies.application-crypto]
version = '2.0.0-rc5'
version = '2.0.0'
package = "sp-application-crypto"
default-features = false
features = ["full_crypto"]

[dependencies.sp-io]
version = '2.0.0-rc5'
version = '2.0.0'
default-features=false
features = ["disable_oom", "disable_panic_handler"]

Expand Down
4 changes: 2 additions & 2 deletions tutorials/api-client-tutorial/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ substrate-api-client = { path = "../.." }
codec = { package = "parity-scale-codec", features = ["derive"], version = "1.0.0", default-features = false }

[dependencies.sp-core]
version = '2.0.0-rc5'
version = '2.0.0'

[dependencies.keyring]
version = '2.0.0-rc5'
version = '2.0.0'
package = "sp-keyring"

0 comments on commit 62afbac

Please sign in to comment.