Skip to content

Commit 67a3cf6

Browse files
authored
favor imports from api-client-types crate & fix api-client features; remove unused jsonrpsee dependency (#1271)
* update api-client feature flags to remove unused jsonrpsee dependency. * update enclave Cargo.lock * [itp-api-client-types] re-export extrinsic params trait. * [itp-node-api-metadata] use Metadata from itp-api-client-types instead of from api-client * [enclave-runtime] remove unnecessary dependency on the substrate-api-client * [itc-rpc-client] uses now the types from itp-api-client-types * [enclave-runtime] fix api-client dependencies in tests.
1 parent 5fe663b commit 67a3cf6

20 files changed

Lines changed: 45 additions & 237 deletions

File tree

Cargo.lock

Lines changed: 19 additions & 201 deletions
Large diffs are not rendered by default.

cli/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ ws = { version = "0.9.1", features = ["ssl"] }
2828
my-node-runtime = { package = "integritee-node-runtime", git = "https://github.com/integritee-network/integritee-node.git", branch = "polkadot-v0.9.39" }
2929
pallet-evm = { optional = true, git = "https://github.com/integritee-network/frontier.git", branch = "polkadot-v0.9.39" }
3030
pallet-teerex = { git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v0.9.39" }
31-
substrate-api-client = { features = ["ws-client"], git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.39" }
31+
# `default-features = false` to remove the jsonrpsee dependency.
32+
substrate-api-client = { default-features = false, features = ["std", "ws-client"], git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.39" }
3233
substrate-client-keystore = { git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.39" }
3334
teerex-primitives = { git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v0.9.39" }
3435

core-primitives/node-api/api-client-extensions/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ sp-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", bra
1515
sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" }
1616

1717
# scs
18-
substrate-api-client = { git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.39" }
18+
# `default-features = false` to remove the jsonrpsee dependency.
19+
substrate-api-client = { default-features = false, features = ["std"], git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.39" }
1920

2021
# local deps
2122
itp-api-client-types = { path = "../api-client-types" }

core-primitives/node-api/api-client-types/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ pub use itp_types::parentchain::{
2626
AccountId, Address, Balance, Hash, Index, Signature as PairSignature,
2727
};
2828
pub use substrate_api_client::{
29-
AssetTip, CallIndex, GenericAdditionalParams, GenericExtrinsicParams, GenericSignedExtra,
29+
storage_key, AssetTip, CallIndex, ExtrinsicParams, GenericAdditionalParams,
30+
GenericExtrinsicParams, GenericSignedExtra, InvalidMetadataError, Metadata, MetadataError,
3031
PlainTip, StaticExtrinsicSigner, UncheckedExtrinsicV4,
3132
};
3233

core-primitives/node-api/metadata/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ edition = "2021"
99
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
1010
derive_more = { version = "0.99.5" }
1111

12+
# local
13+
itp-api-client-types = { default-features = false, path = "../api-client-types" }
14+
1215
# substrate
1316
sp-core = { git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "polkadot-v0.9.39" }
1417

15-
# scs
16-
substrate-api-client = { default-features = false, git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.39" }
17-
1818
[features]
1919
default = ["std"]
2020
std = [
2121
"codec/std",
22+
"itp-api-client-types/std",
2223
"sp-core/std",
23-
"substrate-api-client/std",
2424
]
2525

2626
# used for unit testing only!

core-primitives/node-api/metadata/src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub enum Error {
2121
/// Metadata has not been set
2222
MetadataNotSet,
2323
/// Api-client metadata error
24-
NodeMetadata(substrate_api_client::MetadataError),
24+
NodeMetadata(itp_api_client_types::MetadataError),
2525
}
2626

2727
pub type Result<T> = core::result::Result<T, Error>;

core-primitives/node-api/metadata/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ use crate::{
2323
error::Result, pallet_sidechain::SidechainCallIndexes, pallet_teerex::TeerexCallIndexes,
2424
};
2525
use codec::{Decode, Encode};
26+
use itp_api_client_types::{Metadata, MetadataError};
2627
use sp_core::storage::StorageKey;
27-
use substrate_api_client::{Metadata, MetadataError};
2828

2929
pub use crate::error::Error;
3030

core-primitives/stf-executor/Cargo.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ itp-time-utils = { path = "../time-utils", default-features = false }
2525
itp-top-pool-author = { path = "../top-pool-author", default-features = false }
2626
itp-types = { path = "../types", default-features = false }
2727

28-
# scs
29-
substrate-api-client = { default-features = false, git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.39" }
30-
3128
# sgx enabled external libraries
3229
thiserror_sgx = { optional = true, package = "thiserror", git = "https://github.com/mesalock-linux/thiserror-sgx", tag = "sgx_1.1.3" }
3330

@@ -69,8 +66,6 @@ std = [
6966
# crates.io
7067
"log/std",
7168
"codec/std",
72-
# scs
73-
"substrate-api-client/std",
7469
# substrate
7570
"sp-core/std",
7671
"sp-runtime/std",

core/parentchain/indirect-calls-executor/Cargo.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ binary-merkle-tree = { default-features = false, git = "https://github.com/parit
3737
sp-core = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" }
3838
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" }
3939

40-
# scs/integritee
41-
substrate-api-client = { git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.39", default-features = false }
42-
4340
[dev-dependencies]
4441
env_logger = "0.9.0"
4542
itp-node-api = { path = "../../../core-primitives/node-api", features = ["mocks"] }
@@ -67,7 +64,6 @@ std = [
6764
"binary-merkle-tree/std",
6865
"sp-core/std",
6966
"sp-runtime/std",
70-
"substrate-api-client/std",
7167
"thiserror",
7268
]
7369
sgx = [

core/parentchain/indirect-calls-executor/src/executor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,8 @@ mod test {
235235
use itc_parentchain_test::parentchain_block_builder::ParentchainBlockBuilder;
236236
use itp_node_api::{
237237
api_client::{
238-
ParentchainAdditionalParams, ParentchainExtrinsicParams, ParentchainUncheckedExtrinsic,
238+
ExtrinsicParams, ParentchainAdditionalParams, ParentchainExtrinsicParams,
239+
ParentchainUncheckedExtrinsic,
239240
},
240241
metadata::{metadata_mocks::NodeMetadataMock, provider::NodeMetadataRepository},
241242
};
@@ -250,7 +251,6 @@ mod test {
250251
use sp_core::{ed25519, Pair};
251252
use sp_runtime::{MultiSignature, OpaqueExtrinsic};
252253
use std::assert_matches::assert_matches;
253-
use substrate_api_client::ExtrinsicParams;
254254

255255
type TestShieldingKeyRepo = KeyRepositoryMock<ShieldingCryptoMock>;
256256
type TestStfEnclaveSigner = StfEnclaveSignerMock;

0 commit comments

Comments
 (0)