diff --git a/Cargo.toml b/Cargo.toml index fb205d2a7..9ad5f17f7 100755 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,31 +15,30 @@ members = [ ] [dependencies] -hex = { version = "0.4.3", default-features = false, features = ["alloc"] } -log = { version = "0.4.14", optional = true } -#TODO get from parity when our changes are accepted -metadata = { version = "15.0.0", default-features = false, git = "https://github.com/integritee-network/frame-metadata", package = "frame-metadata", features = ["v14", "full_derive"] } -#metadata = { version = "15.0.0", default-features = false, package = "frame-metadata", features = ["v14"] } codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ['derive'] } +hex = { version = "0.4.3", default-features = false, features = ["alloc"] } +log = { version = "0.4.14", default-features = false } primitive-types = { version = "0.12.1", optional = true, features = ["codec"] } serde = { version = "1.0.136", optional = true, features = ["derive"] } serde_json = { version = "1.0.79", optional = true } thiserror = { version = "1.0.30", optional = true } ws = { version = "0.9.2", optional = true, features = ["ssl"] } +#TODO get from parity when our changes are accepted +frame-metadata = { version = "15.0.0", default-features = false, git = "https://github.com/integritee-network/frame-metadata", features = ["v14", "full_derive"] } +#frame-metadata = { version = "15.0.0", default-features = false, features = ["v14"] } # Substrate dependencies -balances = { version = "4.0.0-dev", optional = true, git = "https://github.com/paritytech/substrate.git", package = "pallet-balances", branch = "master" } +frame-support = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "master" } +frame-system = { version = "4.0.0-dev", optional = true, git = "https://github.com/paritytech/substrate.git", branch = "master" } +pallet-balances = { version = "4.0.0-dev", optional = true, git = "https://github.com/paritytech/substrate.git", branch = "master" } +pallet-staking = { version = "4.0.0-dev", optional = true, git = "https://github.com/paritytech/substrate.git", branch = "master" } +pallet-transaction-payment = { version = "4.0.0-dev", optional = true, git = "https://github.com/paritytech/substrate.git", branch = "master" } sp-core = { version = "6.0.0", default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "master" } sp-rpc = { version = "6.0.0", optional = true, git = "https://github.com/paritytech/substrate.git", branch = "master" } sp-runtime = { version = "6.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "master" } -sp-std = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "master" } -sp-version = { version = "5.0.0-dev", optional = true, git = "https://github.com/paritytech/substrate.git", package = "sp-version", branch = "master" } -staking = { version = "4.0.0-dev", optional = true, git = "https://github.com/paritytech/substrate.git", package = "pallet-staking", branch = "master" } -support = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", package = "frame-support", branch = "master" } -system = { version = "4.0.0-dev", optional = true, git = "https://github.com/paritytech/substrate.git", package = "frame-system", branch = "master" } -transaction-payment = { version = "4.0.0-dev", optional = true, git = "https://github.com/paritytech/substrate.git", package = "pallet-transaction-payment", branch = "master" } - sp-runtime-interface = { version = "6.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "master" } +sp-std = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "master" } +sp-version = { version = "5.0.0-dev", optional = true, git = "https://github.com/paritytech/substrate.git", branch = "master" } # local deps ac-compose-macros = { path = "compose-macros", default-features = false } @@ -61,31 +60,33 @@ disable_target_static_assertions = [ "sp-runtime-interface/disable_target_static_assertions", ] std = [ - "sp-core/std", + #crate io "codec/std", - "metadata/std", - "sp-version", - "balances", - "system", - "sp-runtime/std", - "support/std", - "sp-std/std", - "serde/std", - "serde_json", - "log", "hex/std", + "log/std", "primitive-types", + "serde/std", + "serde_json", "thiserror", + "frame-metadata/std", + # substrate + "frame-support/std", + "frame-system", + "pallet-balances", + "pallet-transaction-payment/std", + "sp-core/std", "sp-rpc", + "sp-runtime/std", "sp-runtime-interface/std", - "transaction-payment/std", + "sp-std/std", + "sp-version", # local deps "ac-compose-macros/std", "ac-node-api/std", "ac-primitives/std", ] ws-client = ["ws"] -staking-xt = ["std", "staking"] +staking-xt = ["std", "pallet-staking"] # Remove when fixed: https://github.com/scs/substrate-api-client/issues/286 [patch.crates-io] diff --git a/compose-macros/Cargo.toml b/compose-macros/Cargo.toml index 694d1d927..694fc4328 100644 --- a/compose-macros/Cargo.toml +++ b/compose-macros/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ['derive'] } log = { version = "0.4.14", default-features = false } -# substrate dependencies +# substrate sp-core = { version = "6.0.0", default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "master" } sp-runtime = { version = "6.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "master" } sp-std = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "master" } @@ -17,7 +17,7 @@ sp-std = { version = "4.0.0-dev", default-features = false, git = "https://githu # need to add this for the app_crypto macro sp-application-crypto = { version = "6.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", features = ["full_crypto"], branch = "master" } -# local deps +# local ac-primitives = { path = "../primitives", default-features = false } [features] @@ -25,10 +25,11 @@ default = ["std"] std = [ "codec/std", "log/std", - "sp-application-crypto/std", + # substrate "sp-core/std", "sp-runtime/std", "sp-std/std", - # local crates + "sp-application-crypto/std", + # local "ac-primitives/std", ] diff --git a/examples/example_event_callback.rs b/examples/example_event_callback.rs index 008093129..999ae5ae3 100644 --- a/examples/example_event_callback.rs +++ b/examples/example_event_callback.rs @@ -44,14 +44,15 @@ fn main() { let _unhex = Vec::from_hex(event_str).unwrap(); let mut _er_enc = _unhex.as_slice(); - let events = Vec::>::decode(&mut _er_enc).unwrap(); + let events = + Vec::>::decode(&mut _er_enc).unwrap(); for evr in &events { println!("decoded: {:?} {:?}", evr.phase, evr.event); match &evr.event { RuntimeEvent::Balances(be) => { println!(">>>>>>>>>> balances event: {:?}", be); match &be { - balances::Event::Transfer { from, to, amount } => { + pallet_balances::Event::Transfer { from, to, amount } => { println!("Transactor: {:?}", from); println!("Destination: {:?}", to); println!("Value: {:?}", amount); diff --git a/examples/example_get_account_identity.rs b/examples/example_get_account_identity.rs index 47188d7e9..d62245c85 100644 --- a/examples/example_get_account_identity.rs +++ b/examples/example_get_account_identity.rs @@ -24,10 +24,10 @@ use substrate_api_client::{ XtStatus, }; -use support::traits::Currency; +use frame_support::traits::Currency; type BalanceOf = <::Currency as Currency< - ::AccountId, + ::AccountId, >>::Balance; type MaxRegistrarsOf = ::MaxRegistrars; type MaxAdditionalFieldsOf = ::MaxAdditionalFields; diff --git a/node-api/Cargo.toml b/node-api/Cargo.toml index 37ee90c38..0751ed4e9 100644 --- a/node-api/Cargo.toml +++ b/node-api/Cargo.toml @@ -4,26 +4,25 @@ version = "0.1.0" license = "Apache-2.0" edition = "2021" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [dependencies] bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] } codec = { package = "parity-scale-codec", version = "3.2.1", features = ["derive", "bit-vec"], default-features = false } derive_more = { version = "0.99.17" } either = { version = "1.6.1", default-features = false } -#TODO get from parity when our changes are accepted https://github.com/scs/substrate-api-client/issues/304 -frame-metadata = { version = "15.0.0", default-features = false, git = "https://github.com/integritee-network/frame-metadata", features = ["v14", "full_derive"] } -#frame-metadata = { version = "15.0.0", features = ["v14"], default-features = false } hex = { version = "0.4.3", default-features = false } log = { version = "0.4.14", default-features = false } scale-info = { version = "2.0.1", features = ["derive", "decode", "bitvec"], default-features = false } serde = { version = "1.0.136", features = ["derive"], default-features = false } serde_json = { version = "1.0.79", default-features = false, features = ["alloc"] } -# local deps +#TODO get from parity when our changes are accepted https://github.com/scs/substrate-api-client/issues/304 +frame-metadata = { version = "15.0.0", default-features = false, git = "https://github.com/integritee-network/frame-metadata", features = ["v14", "full_derive"] } +#frame-metadata = { version = "15.0.0", features = ["v14"], default-features = false } + +# local ac-primitives = { path = "../primitives", default-features = false } -# substrate deps +# substrate frame-support = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "master" } frame-system = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "master" } sp-core = { version = "6.0.0", default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "master" } @@ -44,20 +43,20 @@ std = [ "bitvec/std", "codec/std", "either/default", - "frame-metadata/std", "hex/std", "log/std", "scale-info/std", "serde/std", "serde_json/std", - # local deps + "frame-metadata/std", + # local "ac-primitives/std", - # substrate-deps + # substrate "frame-support/std", "frame-system/std", "sp-core/std", - "sp-std/std", "sp-runtime/std", + "sp-std/std", # no_std support "sp-application-crypto/std", "sp-runtime-interface/std", diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index a4d84446c..eb341f9ba 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -9,6 +9,7 @@ edition = "2021" codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ['derive'] } hex = { version = "0.4.3", default-features = false, features = ["alloc"] } +# substrate sp-core = { version = "6.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "master" } sp-runtime = { version = "6.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "master" } sp-std = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "master" } @@ -18,6 +19,7 @@ default = ["std"] std = [ "codec/std", "hex/std", + # substrate "sp-core/std", "sp-runtime/std", "sp-std/std", diff --git a/primitives/src/extrinsics.rs b/primitives/src/extrinsics.rs index f996fb673..87956fcdf 100644 --- a/primitives/src/extrinsics.rs +++ b/primitives/src/extrinsics.rs @@ -159,7 +159,7 @@ mod tests { fn encode_decode_roundtrip_works() { let msg = &b"test-message"[..]; let (pair, _) = sr25519::Pair::generate(); - let signature = pair.sign(&msg); + let signature = pair.sign(msg); let multi_sig = MultiSignature::from(signature); let account: AccountId = pair.public().into(); let tx_params = diff --git a/src/std/mod.rs b/src/std/mod.rs index c2f6a3a20..f2dcfaa9c 100644 --- a/src/std/mod.rs +++ b/src/std/mod.rs @@ -7,7 +7,8 @@ pub use crate::{ }; use ac_node_api::metadata::{Metadata, MetadataError}; use ac_primitives::{AccountData, AccountInfo, Balance, ExtrinsicParams}; -pub use metadata::RuntimeMetadataPrefixed; +pub use frame_metadata::RuntimeMetadataPrefixed; +pub use pallet_transaction_payment::FeeDetails; pub use serde_json::Value; use sp_core::H256 as Hash; pub use sp_core::{crypto::Pair, storage::StorageKey}; @@ -18,7 +19,6 @@ pub use sp_runtime::{ }; pub use sp_std::prelude::*; pub use sp_version::RuntimeVersion; -pub use transaction_payment::FeeDetails; pub mod error; pub mod rpc; @@ -27,9 +27,9 @@ use std::convert::{TryFrom, TryInto}; use codec::{Decode, Encode}; use log::{debug, info}; +use pallet_transaction_payment::{InclusionFee, RuntimeDispatchInfo}; use serde::de::DeserializeOwned; use sp_rpc::number::NumberOrHex; -use transaction_payment::{InclusionFee, RuntimeDispatchInfo}; use crate::rpc::json_req;