mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-23 16:35:46 +00:00
Move subxt-new to be the new subxt, and get first example working
This commit is contained in:
+3
-4
@@ -297,10 +297,9 @@ pub mod dev {
|
||||
#[cfg(feature = "subxt")]
|
||||
mod subxt_compat {
|
||||
use super::*;
|
||||
|
||||
use subxt_core::config::Config;
|
||||
use subxt_core::tx::signer::Signer as SignerT;
|
||||
use subxt_core::utils::{AccountId32, MultiAddress, MultiSignature};
|
||||
use subxt::config::Config;
|
||||
use subxt::transactions::Signer as SignerT;
|
||||
use subxt::utils::{AccountId32, MultiAddress, MultiSignature};
|
||||
|
||||
impl From<Signature> for MultiSignature {
|
||||
fn from(value: Signature) -> Self {
|
||||
|
||||
+11
-10
@@ -309,10 +309,10 @@ pub mod dev {
|
||||
#[cfg(feature = "subxt")]
|
||||
mod subxt_compat {
|
||||
use super::*;
|
||||
use subxt_core::config::Config;
|
||||
use subxt_core::tx::signer::Signer as SignerT;
|
||||
use subxt_core::utils::AccountId20;
|
||||
use subxt_core::utils::MultiAddress;
|
||||
use subxt::config::Config;
|
||||
use subxt::transactions::Signer as SignerT;
|
||||
use subxt::utils::AccountId20;
|
||||
use subxt::utils::MultiAddress;
|
||||
|
||||
impl<T: Config> SignerT<T> for Keypair
|
||||
where
|
||||
@@ -365,21 +365,22 @@ mod test {
|
||||
use bip39::Mnemonic;
|
||||
use proptest::prelude::*;
|
||||
use secp256k1::Secp256k1;
|
||||
use subxt_core::utils::AccountId20;
|
||||
|
||||
use subxt_core::{config::*, tx::signer::Signer as SignerT};
|
||||
use subxt::utils::AccountId20;
|
||||
use subxt::transactions::Signer as SignerT;
|
||||
use subxt::config::{Config, HashFor, substrate};
|
||||
|
||||
use super::*;
|
||||
|
||||
enum StubEthRuntimeConfig {}
|
||||
#[derive(Debug, Clone)]
|
||||
struct StubEthRuntimeConfig;
|
||||
|
||||
impl Config for StubEthRuntimeConfig {
|
||||
type AccountId = AccountId20;
|
||||
type Address = AccountId20;
|
||||
type Signature = Signature;
|
||||
type Hasher = substrate::BlakeTwo256;
|
||||
type Header = substrate::SubstrateHeader<u32, substrate::BlakeTwo256>;
|
||||
type ExtrinsicParams = SubstrateExtrinsicParams<Self>;
|
||||
type Header = substrate::SubstrateHeader<HashFor<Self>>;
|
||||
type ExtrinsicParams = substrate::SubstrateExtrinsicParams<Self>;
|
||||
type AssetId = u32;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
//! Enable the `subxt` feature to enable use of this [`sr25519::Keypair`] in signing
|
||||
//! subxt transactions for chains supporting sr25519 signatures.
|
||||
|
||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
extern crate alloc;
|
||||
@@ -24,22 +23,18 @@ mod crypto;
|
||||
|
||||
// An sr25519 key pair implementation.
|
||||
#[cfg(feature = "sr25519")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "sr25519")))]
|
||||
pub mod sr25519;
|
||||
|
||||
// An ecdsa key pair implementation.
|
||||
#[cfg(feature = "ecdsa")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "ecdsa")))]
|
||||
pub mod ecdsa;
|
||||
|
||||
// An ethereum signer implementation.
|
||||
#[cfg(feature = "unstable-eth")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-eth")))]
|
||||
pub mod eth;
|
||||
|
||||
/// A polkadot-js account json loader.
|
||||
#[cfg(feature = "polkadot-js-compat")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "polkadot-js-compat")))]
|
||||
pub mod polkadot_js_compat;
|
||||
|
||||
// Re-export useful bits and pieces for generating a Pair from a phrase,
|
||||
|
||||
@@ -76,6 +76,9 @@ struct KeyringPairJson {
|
||||
address: AccountId32,
|
||||
}
|
||||
|
||||
// Re-export this type which is used above.
|
||||
pub use subxt_utils_accountid32::AccountId32;
|
||||
|
||||
// This can be removed once split_array is stabilized.
|
||||
fn slice_to_u32(slice: &[u8]) -> u32 {
|
||||
u32::from_le_bytes(slice.try_into().expect("Slice should be 4 bytes."))
|
||||
|
||||
@@ -287,15 +287,11 @@ pub mod dev {
|
||||
// Make `Keypair` usable to sign transactions in Subxt. This is optional so that
|
||||
// `subxt-signer` can be used entirely independently of Subxt.
|
||||
#[cfg(feature = "subxt")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "subxt")))]
|
||||
mod subxt_compat {
|
||||
use super::*;
|
||||
|
||||
use subxt_core::{
|
||||
Config,
|
||||
tx::signer::Signer as SignerT,
|
||||
utils::{AccountId32, MultiAddress, MultiSignature},
|
||||
};
|
||||
use subxt::Config;
|
||||
use subxt::transactions::Signer as SignerT;
|
||||
use subxt::utils::{AccountId32, MultiAddress, MultiSignature};
|
||||
|
||||
impl From<Signature> for MultiSignature {
|
||||
fn from(value: Signature) -> Self {
|
||||
|
||||
Reference in New Issue
Block a user