Move subxt-new to be the new subxt, and get first example working

This commit is contained in:
James Wilson
2025-12-11 17:44:18 +00:00
parent 15a7534a55
commit 02d0c12019
279 changed files with 1169 additions and 28576 deletions
+3 -4
View File
@@ -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
View File
@@ -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;
}
-5
View File
@@ -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,
+3
View File
@@ -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."))
+3 -7
View File
@@ -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 {