Skip to content

Commit

Permalink
clean up tomls (#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
haerdib authored Nov 19, 2022
1 parent c75038a commit bd8abf8
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 49 deletions.
53 changes: 27 additions & 26 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand All @@ -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]
Expand Down
9 changes: 5 additions & 4 deletions compose-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,27 @@ 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" }

# 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]
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",
]
5 changes: 3 additions & 2 deletions examples/example_event_callback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,15 @@ fn main() {

let _unhex = Vec::from_hex(event_str).unwrap();
let mut _er_enc = _unhex.as_slice();
let events = Vec::<system::EventRecord<RuntimeEvent, Hash>>::decode(&mut _er_enc).unwrap();
let events =
Vec::<frame_system::EventRecord<RuntimeEvent, Hash>>::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);
Expand Down
4 changes: 2 additions & 2 deletions examples/example_get_account_identity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ use substrate_api_client::{
XtStatus,
};

use support::traits::Currency;
use frame_support::traits::Currency;

type BalanceOf<T> = <<T as pallet_identity::Config>::Currency as Currency<
<T as system::Config>::AccountId,
<T as frame_system::Config>::AccountId,
>>::Balance;
type MaxRegistrarsOf<T> = <T as pallet_identity::Config>::MaxRegistrars;
type MaxAdditionalFieldsOf<T> = <T as pallet_identity::Config>::MaxAdditionalFields;
Expand Down
21 changes: 10 additions & 11 deletions node-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand All @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand All @@ -18,6 +19,7 @@ default = ["std"]
std = [
"codec/std",
"hex/std",
# substrate
"sp-core/std",
"sp-runtime/std",
"sp-std/std",
Expand Down
2 changes: 1 addition & 1 deletion primitives/src/extrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
6 changes: 3 additions & 3 deletions src/std/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand All @@ -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;
Expand All @@ -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;

Expand Down

0 comments on commit bd8abf8

Please sign in to comment.