Skip to content

Commit

Permalink
add traits
Browse files Browse the repository at this point in the history
add missing file

make clippy happier

cargo fmt

redo compose_extrinsic macro. Did not work before

fix doc

Bump secp256k1 from 0.24.0 to 0.24.2 (#364)

Bumps [secp256k1](https://github.com/rust-bitcoin/rust-secp256k1) from 0.24.0 to 0.24.2.
- [Release notes](https://github.com/rust-bitcoin/rust-secp256k1/releases)
- [Changelog](https://github.com/rust-bitcoin/rust-secp256k1/blob/secp256k1-0.24.2/CHANGELOG.md)
- [Commits](rust-bitcoin/rust-secp256k1@secp256k1-0.24.0...secp256k1-0.24.2)

---
updated-dependencies:
- dependency-name: secp256k1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

add submitextrinsic trait

Added Polkadex in substrate-api-client readme (#365)
  • Loading branch information
haerdib committed Dec 9, 2022
1 parent 7bc714f commit cd501f8
Show file tree
Hide file tree
Showing 30 changed files with 772 additions and 472 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ serde = { version = "1.0.136", default-features = false, features = ["derive"] }
serde_json = { version = "1.0.79", default-features = false }
thiserror = { version = "1.0.30", optional = true }
tungstenite = { version = "0.18.0", optional = true, features = ["native-tls"] }
url = { verson = "2.0.0", optional = true }
url = { version = "2.0.0", optional = true }
ws = { version = "0.9.2", optional = true, features = ["ssl"] }


Expand Down
2 changes: 1 addition & 1 deletion compose-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ macro_rules! compose_extrinsic_offline {
$params: expr) => {{
use $crate::{
primitives::{ExtrinsicParams, GenericAddress, SignedPayload, UncheckedExtrinsicV4},
sp_core::crypto::Pair,
sp_core::{crypto::Pair, Public},
sp_runtime::{generic::Era, traits::IdentifyAccount, MultiSigner},
};

Expand Down
2 changes: 1 addition & 1 deletion examples/benchmark_bulk_xt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
use kitchensink_runtime::{BalancesCall, Runtime, RuntimeCall};
use sp_keyring::AccountKeyring;
use substrate_api_client::{
compose_extrinsic_offline, Api, AssetTipExtrinsicParams, JsonrpseeClient, UncheckedExtrinsicV4,
compose_extrinsic_offline, Api, AssetTipExtrinsicParams, JsonrpseeClient, UncheckedExtrinsicV4, SubmitExtrinsic
};

#[tokio::main]
Expand Down
4 changes: 2 additions & 2 deletions examples/compose_extrinsic_offline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ use kitchensink_runtime::{BalancesCall, Header, Runtime, RuntimeCall};
use sp_keyring::AccountKeyring;
use sp_runtime::{generic::Era, MultiAddress};
use substrate_api_client::{
compose_extrinsic_offline, rpc::JsonrpseeClient, Api, AssetTipExtrinsicParams,
UncheckedExtrinsicV4, XtStatus,
compose_extrinsic_offline, rpc::JsonrpseeClient, Api, AssetTipExtrinsicParams, GetHeader,
NodeSubscription, UncheckedExtrinsicV4, XtStatus,
};

#[tokio::main]
Expand Down
3 changes: 2 additions & 1 deletion examples/contract_instantiate_with_code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ use codec::Decode;
use kitchensink_runtime::Runtime;
use sp_keyring::AccountKeyring;
use substrate_api_client::{
rpc::JsonrpseeClient, AccountId, Api, PlainTipExtrinsicParams, StaticEvent, XtStatus,
rpc::JsonrpseeClient, AccountId, Api, NodeSubscription, PlainTipExtrinsicParams, StaticEvent,
XtStatus,
};

#[allow(unused)]
Expand Down
2 changes: 1 addition & 1 deletion examples/event_callback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use codec::Decode;
use kitchensink_runtime::Runtime;
use log::debug;
use sp_core::{sr25519, H256 as Hash};
use substrate_api_client::HandleSubscription;
use substrate_api_client::{HandleSubscription, NodeSubscription};

use substrate_api_client::{rpc::JsonrpseeClient, Api, AssetTipExtrinsicParams};

Expand Down
3 changes: 2 additions & 1 deletion examples/event_error_details.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ use sp_core::crypto::Pair;
use sp_keyring::AccountKeyring;
use sp_runtime::{AccountId32 as AccountId, MultiAddress};
use substrate_api_client::{
rpc::JsonrpseeClient, Api, ApiResult, AssetTipExtrinsicParams, StaticEvent, XtStatus,
rpc::JsonrpseeClient, Api, ApiResult, AssetTipExtrinsicParams, GetAccountInformation,
NodeSubscription, StaticEvent, XtStatus,
};

#[derive(Decode)]
Expand Down
2 changes: 1 addition & 1 deletion examples/generic_event_callback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use sp_keyring::AccountKeyring;
use sp_runtime::{AccountId32 as AccountId, MultiAddress};
use std::thread;
use substrate_api_client::{
rpc::JsonrpseeClient, Api, AssetTipExtrinsicParams, StaticEvent, XtStatus,
rpc::JsonrpseeClient, Api, AssetTipExtrinsicParams, NodeSubscription, StaticEvent, XtStatus,
};

// Look at the how the transfer event looks like in in the metadata
Expand Down
2 changes: 1 addition & 1 deletion examples/generic_extrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use kitchensink_runtime::Runtime;
use sp_keyring::AccountKeyring;
use substrate_api_client::{
compose_extrinsic, rpc::JsonrpseeClient, Api, AssetTipExtrinsicParams, GenericAddress,
UncheckedExtrinsicV4, XtStatus,
NodeSubscription, UncheckedExtrinsicV4, XtStatus,
};

#[tokio::main]
Expand Down
4 changes: 2 additions & 2 deletions examples/get_account_identity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ use pallet_identity::{Data, IdentityInfo, Registration};
use sp_core::{crypto::Pair, H256};
use sp_keyring::AccountKeyring;
use substrate_api_client::{
compose_extrinsic, rpc::JsonrpseeClient, Api, AssetTipExtrinsicParams, UncheckedExtrinsicV4,
XtStatus,
compose_extrinsic, rpc::JsonrpseeClient, Api, AssetTipExtrinsicParams, GetGenericStorage,
NodeSubscription, UncheckedExtrinsicV4, XtStatus,
};

type BalanceOf<T> = <<T as pallet_identity::Config>::Currency as Currency<
Expand Down
3 changes: 2 additions & 1 deletion examples/get_blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
use kitchensink_runtime::Runtime;
use sp_core::sr25519;
use substrate_api_client::{
rpc::JsonrpseeClient, Api, AssetTipExtrinsicParams, HandleSubscription,
rpc::JsonrpseeClient, Api, AssetTipExtrinsicParams, GetHeader, HandleSubscription,
NodeSubscription,
};

#[tokio::main]
Expand Down
2 changes: 1 addition & 1 deletion examples/get_existential_deposit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
use kitchensink_runtime::Runtime;
use sp_runtime::app_crypto::sp_core::sr25519;
use substrate_api_client::{rpc::JsonrpseeClient, Api, AssetTipExtrinsicParams};
use substrate_api_client::{rpc::JsonrpseeClient, Api, AssetTipExtrinsicParams, GetBalance};

#[tokio::main]
async fn main() {
Expand Down
2 changes: 1 addition & 1 deletion examples/get_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use frame_system::AccountInfo as GenericAccountInfo;
use kitchensink_runtime::Runtime;
use sp_keyring::AccountKeyring;
use substrate_api_client::{rpc::JsonrpseeClient, Api, AssetTipExtrinsicParams};
use substrate_api_client::{rpc::JsonrpseeClient, Api, AssetTipExtrinsicParams, GetGenericStorage};

type IndexFor<T> = <T as frame_system::Config>::Index;
type AccountDataFor<T> = <T as frame_system::Config>::AccountData;
Expand Down
4 changes: 3 additions & 1 deletion examples/staking_payout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ use sp_keyring::AccountKeyring;
#[cfg(feature = "staking-xt")]
use sp_runtime::{app_crypto::Ss58Codec, AccountId32};
#[cfg(feature = "staking-xt")]
use substrate_api_client::{rpc::JsonrpseeClient, Api, AssetTipExtrinsicParams, XtStatus};
use substrate_api_client::{
rpc::JsonrpseeClient, Api, AssetTipExtrinsicParams, NodeSubscription, XtStatus,
};

#[cfg(feature = "staking-xt")]
#[tokio::main]
Expand Down
2 changes: 1 addition & 1 deletion examples/sudo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use kitchensink_runtime::Runtime;
use sp_keyring::AccountKeyring;
use substrate_api_client::{
compose_call, compose_extrinsic, rpc::JsonrpseeClient, Api, AssetTipExtrinsicParams,
GenericAddress, UncheckedExtrinsicV4, XtStatus,
GenericAddress, NodeSubscription, UncheckedExtrinsicV4, XtStatus,
};

#[tokio::main]
Expand Down
5 changes: 4 additions & 1 deletion examples/transfer_using_seed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ use sp_core::{
sr25519,
};
use sp_runtime::MultiAddress;
use substrate_api_client::{rpc::JsonrpseeClient, Api, AssetTipExtrinsicParams, XtStatus};
use substrate_api_client::{
rpc::JsonrpseeClient, Api, AssetTipExtrinsicParams, GetAccountInformation, NodeSubscription,
XtStatus,
};

#[tokio::main]
async fn main() {
Expand Down
13 changes: 4 additions & 9 deletions primitives/src/pallet_traits/frame_system_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
limitations under the License.
*/
use codec::{Codec, EncodeLike, FullCodec, MaxEncodedLen};
use codec::{Codec, Decode, EncodeLike, FullCodec, MaxEncodedLen};
use core::fmt::Debug;
use scale_info::TypeInfo;
use sp_runtime::traits::{
Expand All @@ -37,18 +37,13 @@ pub trait FrameSystemConfig {
+ TypeInfo
+ Dispatchable<RuntimeOrigin = Self::RuntimeOrigin>
+ Debug;
type Index: Codec
+ EncodeLike
+ Clone
+ Eq
+ Debug
+ TypeInfo
+ MaybeSerializeDeserialize
type Index: MaybeSerializeDeserialize
+ Debug
+ Default
+ AtLeast32Bit
+ Copy
+ MaxEncodedLen;
+ MaxEncodedLen
+ Decode;
type BlockNumber: Codec
+ EncodeLike
+ Clone
Expand Down
Loading

0 comments on commit cd501f8

Please sign in to comment.