Skip to content
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

Updated to later version of substrate so that it compiles. #295

Merged
merged 2 commits into from
Sep 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 17 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ tokio1 = ["jsonrpsee-http-client/tokio1", "jsonrpsee-ws-client/tokio1"]

[dependencies]
async-trait = "0.1.49"
codec = { package = "parity-scale-codec", version = "2.1", default-features = false, features = ["derive", "full"] }
codec = { package = "parity-scale-codec", version = "2.1", default-features = false, features = [
"derive",
"full",
] }
dyn-clone = "1.0.4"
futures = "0.3.13"
hex = "0.4.3"
Expand All @@ -43,17 +46,17 @@ url = "2.2.1"
substrate-subxt-client = { version = "0.7.0", path = "client", optional = true }
substrate-subxt-proc-macro = { version = "0.15.0", path = "proc-macro" }

sp-application-crypto = "3.0.0"
sp-core = "3.0.0"
sp-rpc = "3.0.0"
sp-runtime = "3.0.0"
sp-std = "3.0.0"
sp-version = "3.0.0"
sp-application-crypto = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.10" }
sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.10" }
sp-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.10" }
sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.10" }
sp-std = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.10" }
sp-version = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.10" }

frame-metadata = "13.0.0"
frame-support = "3.0.0"
pallet-indices = "3.0.0"
pallet-staking = "3.0.0"
frame-metadata = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.10" }
frame-support = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.10" }
pallet-indices = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.10" }
pallet-staking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.10" }

[dev-dependencies]
assert_matches = "1.5.0"
Expand All @@ -62,6 +65,6 @@ env_logger = "0.8.3"
tempdir = "0.3.7"
wabt = "0.10.0"
which = "4.0.2"
sp-keyring = "3.0.0"
frame-system = "3.0.0"
pallet-balances = "3.0.0"
sp-keyring = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.10" }
frame-system = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.10" }
pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.10" }
17 changes: 11 additions & 6 deletions client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
[package]
name = "substrate-subxt-client"
version = "0.7.0"
authors = ["David Craven <[email protected]>", "Parity Technologies <[email protected]>"]
authors = [
"David Craven <[email protected]>",
"Parity Technologies <[email protected]>",
]
edition = "2018"

license = "GPL-3.0"
Expand All @@ -20,13 +23,15 @@ log = "0.4.13"
serde_json = "1.0.61"
thiserror = "1.0.23"

sc-client-db = "0.9.0"
sp-keyring = "3.0.0"
sc-network = { version = "0.9.0", default-features = false }
sc-service = { version = "0.9.0", default-features = false }
sc-client-db = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.10" }
sp-keyring = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.10" }
sc-network = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.10", default-features = false }
sc-service = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.10", default-features = false }

[target.'cfg(target_arch="x86_64")'.dependencies]
sc-service = { version = "0.9.0", default-features = false, features = ["wasmtime"] }
sc-service = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.10", default-features = false, features = [
"wasmtime",
] }

[dev-dependencies]
async-std = { version = "1.8.0", features = ["attributes"] }
Expand Down
11 changes: 8 additions & 3 deletions proc-macro/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
[package]
name = "substrate-subxt-proc-macro"
version = "0.15.0"
authors = ["David Craven <[email protected]>", "Parity Technologies <[email protected]>"]
authors = [
"David Craven <[email protected]>",
"Parity Technologies <[email protected]>",
]
edition = "2018"
autotests = false

Expand All @@ -26,13 +29,15 @@ synstructure = "0.12.4"

[dev-dependencies]
async-std = { version = "1.8.0", features = ["attributes"] }
codec = { package = "parity-scale-codec", version = "2.0.0", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "2.0.0", features = [
"derive",
] }
env_logger = "0.8.2"
pretty_assertions = "0.6.1"
substrate-subxt = { path = ".." }
trybuild = "1.0.38"

sp-keyring = "3.0.0"
sp-keyring = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.10" }

[[test]]
name = "balances"
Expand Down
6 changes: 5 additions & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ impl RuntimeError {
DispatchError::CannotLookup => Ok(Self::CannotLookup),
DispatchError::ConsumerRemaining => Ok(Self::ConsumerRemaining),
DispatchError::NoProviders => Ok(Self::NoProviders),
DispatchError::Other(msg) => Ok(Self::Other(msg.into())),
DispatchError::Arithmetic(_math_error) => {
Ok(Self::Other("math_error".into()))
}
DispatchError::Token(_token_error) => Ok(Self::Other("token error".into())),
DispatchError::Other(msg) => Ok(Self::Other(msg.to_string())),
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ mod tests {
ModuleMetadata,
RuntimeMetadata,
RuntimeMetadataPrefixed,
RuntimeMetadataV12,
RuntimeMetadataV13,
META_RESERVED,
};
use std::convert::TryFrom;
Expand Down Expand Up @@ -399,7 +399,7 @@ mod tests {
let decoder = EventsDecoder::<TestRuntime>::new(
Metadata::try_from(RuntimeMetadataPrefixed(
META_RESERVED,
RuntimeMetadata::V12(RuntimeMetadataV12 {
RuntimeMetadata::V13(RuntimeMetadataV13 {
modules: DecodeDifferent::Decoded(vec![ModuleMetadata {
name: DecodeDifferent::Decoded("System".to_string()),
storage: None,
Expand Down
2 changes: 1 addition & 1 deletion src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ impl TryFrom<RuntimeMetadataPrefixed> for Metadata {
return Err(ConversionError::InvalidPrefix.into())
}
let meta = match metadata.1 {
RuntimeMetadata::V12(meta) => meta,
RuntimeMetadata::V13(meta) => meta,
_ => return Err(ConversionError::InvalidVersion.into()),
};
let mut modules = HashMap::new();
Expand Down