mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 05:11:09 +00:00
Configurable Config and Extra types (#373)
* WIP config * WIP separate default config * Separate trait impls on client * WIP introduce new ApiConfig (to be renamed) trait * Update generated polkadot codegen * Allow configuring Config and Extra types independently * Add extra default configuration * Revert ir parsing of config attr * Add default-features = false to substrate deps * Revert "Add default-features = false to substrate deps" This reverts commit 099d20cd4cbf8000ff938d1dc090ecbc28a5e788.
This commit is contained in:
@@ -19,8 +19,8 @@ use crate::{
|
||||
balances,
|
||||
runtime_types,
|
||||
system,
|
||||
DefaultConfig,
|
||||
},
|
||||
pair_signer,
|
||||
test_context,
|
||||
};
|
||||
use codec::Decode;
|
||||
@@ -30,20 +30,18 @@ use sp_core::{
|
||||
};
|
||||
use sp_keyring::AccountKeyring;
|
||||
use subxt::{
|
||||
extrinsic::{
|
||||
PairSigner,
|
||||
Signer,
|
||||
},
|
||||
DefaultConfig,
|
||||
Error,
|
||||
EventSubscription,
|
||||
PalletError,
|
||||
RuntimeError,
|
||||
Signer,
|
||||
};
|
||||
|
||||
#[async_std::test]
|
||||
async fn tx_basic_transfer() -> Result<(), subxt::Error> {
|
||||
let alice = PairSigner::<DefaultConfig, _>::new(AccountKeyring::Alice.pair());
|
||||
let bob = PairSigner::<DefaultConfig, _>::new(AccountKeyring::Bob.pair());
|
||||
let alice = pair_signer(AccountKeyring::Alice.pair());
|
||||
let bob = pair_signer(AccountKeyring::Bob.pair());
|
||||
let bob_address = bob.account_id().clone().into();
|
||||
let cxt = test_context().await;
|
||||
let api = &cxt.api;
|
||||
@@ -114,7 +112,7 @@ async fn storage_total_issuance() {
|
||||
|
||||
#[async_std::test]
|
||||
async fn storage_balance_lock() -> Result<(), subxt::Error> {
|
||||
let bob = PairSigner::<DefaultConfig, _>::new(AccountKeyring::Bob.pair());
|
||||
let bob = pair_signer(AccountKeyring::Bob.pair());
|
||||
let charlie = AccountKeyring::Charlie.to_account_id();
|
||||
let cxt = test_context().await;
|
||||
|
||||
@@ -155,9 +153,9 @@ async fn storage_balance_lock() -> Result<(), subxt::Error> {
|
||||
#[async_std::test]
|
||||
async fn transfer_error() {
|
||||
env_logger::try_init().ok();
|
||||
let alice = PairSigner::<DefaultConfig, _>::new(AccountKeyring::Alice.pair());
|
||||
let alice = pair_signer(AccountKeyring::Alice.pair());
|
||||
let alice_addr = alice.account_id().clone().into();
|
||||
let hans = PairSigner::<DefaultConfig, _>::new(Pair::generate().0);
|
||||
let hans = pair_signer(Pair::generate().0);
|
||||
let hans_address = hans.account_id().clone().into();
|
||||
let cxt = test_context().await;
|
||||
|
||||
@@ -198,7 +196,7 @@ async fn transfer_error() {
|
||||
#[async_std::test]
|
||||
async fn transfer_subscription() {
|
||||
env_logger::try_init().ok();
|
||||
let alice = PairSigner::<DefaultConfig, _>::new(AccountKeyring::Alice.pair());
|
||||
let alice = pair_signer(AccountKeyring::Alice.pair());
|
||||
let bob = AccountKeyring::Bob.to_account_id();
|
||||
let bob_addr = bob.clone().into();
|
||||
let cxt = test_context().await;
|
||||
@@ -230,7 +228,7 @@ async fn transfer_subscription() {
|
||||
#[async_std::test]
|
||||
async fn transfer_implicit_subscription() {
|
||||
env_logger::try_init().ok();
|
||||
let alice = PairSigner::<DefaultConfig, _>::new(AccountKeyring::Alice.pair());
|
||||
let alice = pair_signer(AccountKeyring::Alice.pair());
|
||||
let bob = AccountKeyring::Bob.to_account_id();
|
||||
let bob_addr = bob.clone().into();
|
||||
let cxt = test_context().await;
|
||||
|
||||
Reference in New Issue
Block a user