Skip to content

Commit 62afbac

Browse files
author
Alain Brenzikofer
committed
upgrade to substrate 2.0.0
1 parent 683dd51 commit 62afbac

File tree

8 files changed

+699
-541
lines changed

8 files changed

+699
-541
lines changed

Cargo.lock

Lines changed: 670 additions & 514 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "substrate-api-client"
3-
version = "0.4.8-sub2.0.0-rc5"
3+
version = "0.4.9-sub2.0.0"
44
authors = ["Supercomputing Systems AG <[email protected]>"]
55
edition = "2018"
66

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

1717
[dependencies.sp-core]
18-
version = '2.0.0-rc5'
18+
version = '2.0.0'
1919
package = "sp-core"
2020
default-features = false
2121
features = ["full_crypto"]
@@ -27,63 +27,63 @@ version = "1.3.1"
2727
default-features = false
2828

2929
[dependencies.runtime_io]
30-
version = '2.0.0-rc5'
30+
version = '2.0.0'
3131
package = "sp-io"
3232
default-features=false
3333

3434
[dependencies.metadata]
35-
version = '11.0.0-rc5'
35+
version = '12.0.0'
3636
package = "frame-metadata"
3737
default-features=false
3838

3939
[dependencies.sp-version]
40-
version = '2.0.0-rc5'
40+
version = '2.0.0'
4141
package = "sp-version"
4242
default-features=false
4343

4444
[dependencies.balances]
45-
version = '2.0.0-rc5'
45+
version = '2.0.0'
4646
package = "pallet-balances"
4747
default-features=false
4848

4949
[dependencies.system]
50-
version = '2.0.0-rc5'
50+
version = '2.0.0'
5151
package = "frame-system"
5252
default-features=false
5353

5454
[dependencies.sp-runtime]
55-
version = '2.0.0-rc5'
55+
version = '2.0.0'
5656
package = "sp-runtime"
5757
default-features=false
5858

5959
[dependencies.support]
60-
version = '2.0.0-rc5'
60+
version = '2.0.0'
6161
package = "frame-support"
6262
default-features=false
6363

6464
[dependencies.sp-std]
65-
version = '2.0.0-rc5'
65+
version = '2.0.0'
6666
package = "sp-std"
6767
default-features = false
6868

6969
[dependencies.sc-rpc-api]
70-
version = '0.8.0-rc5'
70+
version = '0.8.0'
7171
optional = true
7272

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

7878
[dev-dependencies]
7979
wabt = "0.9.0"
8080

8181
[dev-dependencies.contracts]
82-
version = '2.0.0-rc5'
82+
version = '2.0.0'
8383
package = "pallet-contracts"
8484

8585
[dev-dependencies.keyring]
86-
version = '2.0.0-rc5'
86+
version = '2.0.0'
8787
package = "sp-keyring"
8888

8989
[dev-dependencies.clap]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# substrate-api-client
22

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

55
<p align="center">
66
<img src=./web3_foundation_grants_badge_black.svg width = 400>

src/examples/example_event_callback.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ fn main() {
5151
for evr in &evts {
5252
println!("decoded: {:?} {:?}", 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) => {

src/node_metadata.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ impl Metadata {
199199

200200
#[derive(Clone, Debug)]
201201
pub struct ModuleMetadata {
202+
index: u8,
202203
name: String,
203204
storage: HashMap<String, StorageMetadata>,
204205
// constants
@@ -517,7 +518,7 @@ impl TryFrom<RuntimeMetadataPrefixed> for Metadata {
517518
return Err(ConversionError::InvalidPrefix.into());
518519
}
519520
let meta = match metadata.1 {
520-
RuntimeMetadata::V11(meta) => meta,
521+
RuntimeMetadata::V12(meta) => meta,
521522
_ => return Err(ConversionError::InvalidVersion.into()),
522523
};
523524
let mut modules = HashMap::new();
@@ -540,6 +541,7 @@ impl TryFrom<RuntimeMetadataPrefixed> for Metadata {
540541
modules.insert(
541542
module_name.clone(),
542543
ModuleMetadata {
544+
index: module.index,
543545
name: module_name.clone(),
544546
storage: storage_map,
545547
},
@@ -554,7 +556,7 @@ impl TryFrom<RuntimeMetadataPrefixed> for Metadata {
554556
modules_with_calls.insert(
555557
module_name.clone(),
556558
ModuleWithCalls {
557-
index: modules_with_calls.len() as u8,
559+
index: module.index,
558560
name: module_name.clone(),
559561
calls: call_map,
560562
},
@@ -568,7 +570,7 @@ impl TryFrom<RuntimeMetadataPrefixed> for Metadata {
568570
modules_with_events.insert(
569571
module_name.clone(),
570572
ModuleWithEvents {
571-
index: modules_with_events.len() as u8,
573+
index: module.index,
572574
name: module_name.clone(),
573575
events: event_map,
574576
},

src/rpc/client.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ pub fn on_extrinsic_msg_until_finalized(
101101
debug!("got msg {}", retstr);
102102
match parse_status(retstr) {
103103
(XtStatus::Finalized, val) => end_process(out, result, val),
104-
(XtStatus::Error, e) => panic!(e),
104+
(XtStatus::Error, e) => panic!(e.unwrap()),
105105
(XtStatus::Future, _) => {
106106
warn!("extrinsic has 'future' status. aborting");
107107
end_process(out, result, None);
@@ -122,7 +122,7 @@ pub fn on_extrinsic_msg_until_in_block(
122122
(XtStatus::Finalized, val) => end_process(out, result, val),
123123
(XtStatus::InBlock, val) => end_process(out, result, val),
124124
(XtStatus::Future, _) => end_process(out, result, None),
125-
(XtStatus::Error, e) => panic!(e),
125+
(XtStatus::Error, e) => panic!(e.unwrap()),
126126
_ => (),
127127
};
128128
Ok(())
@@ -139,7 +139,7 @@ pub fn on_extrinsic_msg_until_broadcast(
139139
(XtStatus::Finalized, val) => end_process(out, result, val),
140140
(XtStatus::Broadcast, _) => end_process(out, result, None),
141141
(XtStatus::Future, _) => end_process(out, result, None),
142-
(XtStatus::Error, e) => panic!(e),
142+
(XtStatus::Error, e) => panic!(e.unwrap()),
143143
_ => (),
144144
};
145145
Ok(())
@@ -156,7 +156,7 @@ pub fn on_extrinsic_msg_until_ready(
156156
(XtStatus::Finalized, val) => end_process(out, result, val),
157157
(XtStatus::Ready, _) => end_process(out, result, None),
158158
(XtStatus::Future, _) => end_process(out, result, None),
159-
(XtStatus::Error, e) => panic!(e),
159+
(XtStatus::Error, e) => panic!(e.unwrap()),
160160
_ => (),
161161
};
162162
Ok(())

test_no_std/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ default-features=false
2020
features=["full_crypto"]
2121

2222
[dependencies.application-crypto]
23-
version = '2.0.0-rc5'
23+
version = '2.0.0'
2424
package = "sp-application-crypto"
2525
default-features = false
2626
features = ["full_crypto"]
2727

2828
[dependencies.sp-io]
29-
version = '2.0.0-rc5'
29+
version = '2.0.0'
3030
default-features=false
3131
features = ["disable_oom", "disable_panic_handler"]
3232

tutorials/api-client-tutorial/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ substrate-api-client = { path = "../.." }
99
codec = { package = "parity-scale-codec", features = ["derive"], version = "1.0.0", default-features = false }
1010

1111
[dependencies.sp-core]
12-
version = '2.0.0-rc5'
12+
version = '2.0.0'
1313

1414
[dependencies.keyring]
15-
version = '2.0.0-rc5'
15+
version = '2.0.0'
1616
package = "sp-keyring"

0 commit comments

Comments
 (0)