Skip to content

Commit

Permalink
fix compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
haerdib committed May 4, 2023
1 parent 29a0376 commit 69a39e7
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 23 deletions.
10 changes: 6 additions & 4 deletions primitives/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ use core::{fmt::Debug, marker::PhantomData};
use codec::{Decode, Encode, FullCodec};
use serde::{de::DeserializeOwned, Serialize};
use sp_core::Pair;
use sp_runtime::traits::{AtLeast32Bit, AtLeast32BitUnsigned, MaybeSerializeDeserialize};
use sp_runtime::traits::{
AtLeast32Bit, AtLeast32BitUnsigned, Block, Hash as HashTrait, Header, MaybeSerializeDeserialize,
};

use crate::{extrinsic_params, Block, Hasher, Header, SignExtrinsic};
use crate::{extrinsic_params, SignExtrinsic};

pub use polkadot::*;
pub use substrate_kitchensink::*;
Expand Down Expand Up @@ -72,11 +74,11 @@ pub trait Config {
type Signature: Debug + Encode + From<<Self::CryptoKey as Pair>::Signature>;

/// The hashing system (algorithm) being used in the runtime (e.g. Blake2).
type Hasher: Debug + Hasher<Output = Self::Hash>;
type Hasher: Debug + HashTrait<Output = Self::Hash>;

/// The block header.
type Header: Debug
+ Header<Number = Self::BlockNumber, Hasher = Self::Hasher>
+ Header<Number = Self::BlockNumber, Hashing = Self::Hasher>
+ Send
+ DeserializeOwned;

Expand Down
9 changes: 6 additions & 3 deletions primitives/src/config/substrate_kitchensink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@
//! https://github.com/paritytech/subxt/blob/ce0a82e3227efb0eae131f025da5f839d9623e15/subxt/src/config/substrate.rs

use crate::{
config::Config, types::AccountData, AssetTip, BlakeTwo256, ExtrinsicSigner,
GenericExtrinsicParams, SubstrateBlock, SubstrateHeader, SubstrateOpaqueExtrinsic,
config::Config, types::AccountData, AssetTip, ExtrinsicSigner, GenericExtrinsicParams,
};
use codec::{Decode, Encode};
use core::fmt::Debug;
pub use primitive_types::{H256, U256};
use sp_core::sr25519;
use sp_runtime::{AccountId32, MultiAddress, MultiSignature};
use sp_runtime::{
generic::{Block as SubstrateBlock, Header as SubstrateHeader},
traits::BlakeTwo256,
AccountId32, MultiAddress, MultiSignature, OpaqueExtrinsic as SubstrateOpaqueExtrinsic,
};

/// Default set of commonly used types by Substrate kitchensink runtime.
#[derive(Decode, Encode, Clone, Eq, PartialEq, Debug)]
Expand Down
1 change: 0 additions & 1 deletion primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,5 @@ pub use types::*;
pub mod config;
pub mod extrinsics;
pub mod rpc_params;
pub mod rpc_params;
pub mod traits;
pub mod types;
2 changes: 1 addition & 1 deletion primitives/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ impl<Balance: AtLeast32BitUnsigned + Copy> FeeDetails<Balance> {
#[serde(rename_all = "camelCase")]
#[serde(bound(serialize = "Balance: core::fmt::Display, Weight: Serialize"))]
#[serde(bound(deserialize = "Balance: core::str::FromStr, Weight: Deserialize<'de>"))]
pub struct RuntimeDispatchInfo<Balance, Weight = sp_weight::Weight> {
pub struct RuntimeDispatchInfo<Balance, Weight = sp_weights::Weight> {
/// Weight of this dispatch.
pub weight: Weight,
/// Class of this dispatch.
Expand Down
7 changes: 1 addition & 6 deletions src/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
*/

use ac_node_api::EventDetails;
use ac_primitives::Bytes;
use alloc::{string::String, vec::Vec};
use serde::{Deserialize, Serialize};
use sp_core::Bytes;

pub use api_client::Api;
pub use error::{Error, Result};
Expand All @@ -32,11 +32,6 @@ pub mod api_client;
pub mod error;
pub mod rpc_api;

use ac_node_api::EventDetails;
use alloc::{string::String, vec::Vec};
use serde::{Deserialize, Serialize};
use sp_core::Bytes;

/// Extrinsic report returned upon a submit_and_watch request.
/// Holds as much information as available.
#[derive(Debug, Clone)]
Expand Down
4 changes: 2 additions & 2 deletions src/api/rpc_api/author.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ use crate::{
Api, ExtrinsicReport, TransactionStatus, XtStatus,
};
use ac_compose_macros::rpc_params;
use ac_primitives::{config::Config, ExtrinsicParams};
use ac_primitives::{config::Config, ExtrinsicParams, UncheckedExtrinsicV4};
use codec::Encode;
use log::*;
use serde::de::DeserializeOwned;
use sp_core::Bytes;
use sp_runtime::traits::{Block as BlockTrait, GetRuntimeBlockType, Hash as HashTrait};
use sp_runtime::traits::Hash as HashTrait;

pub type TransactionSubscriptionFor<Client, Hash> =
<Client as Subscribe>::Subscription<TransactionStatus<Hash, Hash>>;
Expand Down
4 changes: 2 additions & 2 deletions src/api/rpc_api/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ use crate::{
Error,
};
use ac_compose_macros::rpc_params;
use ac_primitives::{config::Config, ExtrinsicParams};
use ac_primitives::config::Config;
use log::*;
use serde::de::DeserializeOwned;
use sp_runtime::{generic::SignedBlock, traits::GetRuntimeBlockType};
use sp_runtime::generic::SignedBlock;

#[maybe_async::maybe_async(?Send)]
pub trait GetChainInfo {
Expand Down
5 changes: 3 additions & 2 deletions src/api/rpc_api/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ use crate::{
};
use ac_compose_macros::rpc_params;
use ac_node_api::{metadata::Metadata, EventDetails, EventRecord, Events, Phase};
use ac_primitives::{config::Config, Block, Hasher};
use ac_primitives::config::Config;
use alloc::{vec, vec::Vec};
use codec::{Decode, Encode};
use core::marker::PhantomData;
use log::*;
use serde::de::DeserializeOwned;
use sp_runtime::traits::{Block, Hash};
use sp_storage::StorageChangeSet;

pub type EventSubscriptionFor<Client, Hash> =
Expand Down Expand Up @@ -229,7 +230,7 @@ mod tests {
use frame_metadata::RuntimeMetadataPrefixed;
use kitchensink_runtime::{BalancesCall, RuntimeCall, UncheckedExtrinsic};
use scale_info::TypeInfo;
use sp_core::{crypto::Ss58Codec, sr25519, sr25519::Pair, Bytes, H256};
use sp_core::{crypto::Ss58Codec, sr25519, Bytes, H256};
use sp_runtime::{
generic::{Block, SignedBlock},
AccountId32, MultiAddress,
Expand Down
3 changes: 1 addition & 2 deletions src/extrinsic/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ use crate::{api::Api, rpc::Request};
use ac_compose_macros::compose_extrinsic;
#[cfg(feature = "std")]
use ac_primitives::{
config::Config, extrinsic_params::ExtrinsicParams, extrinsics::CallIndex, SignExtrinsic,
UncheckedExtrinsicV4,
config::Config, extrinsic_params::ExtrinsicParams, SignExtrinsic, UncheckedExtrinsicV4,
};
#[cfg(feature = "std")]
use alloc::vec::Vec;
Expand Down

0 comments on commit 69a39e7

Please sign in to comment.