Skip to content

Commit

Permalink
move test to chain atest
Browse files Browse the repository at this point in the history
  • Loading branch information
haerdib committed Dec 19, 2023
1 parent 9ce881c commit 8543bd9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 20 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ ac-node-api = { path = "node-api", features = ["mocks"] }
kitchensink-runtime = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "master" }
scale-info = { version = "2.1.1", features = ["derive"] }
test-case = "3.1.0"
sp-keyring = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "master" }

[features]
default = ["std", "jsonrpsee-client", "sync-api"]
Expand Down
16 changes: 0 additions & 16 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,3 @@ pub fn storage_key(module: &str, storage_key_name: &str) -> StorageKey {
key.extend(twox_128(storage_key_name.as_bytes()));
StorageKey(key)
}

#[cfg(test)]
mod tests {
use super::*;
use ac_primitives::{DefaultRuntimeConfig, ExtrinsicSigner};
use rpc::TungsteniteRpcClient;
use sp_keyring::AccountKeyring;

#[test]
fn test_extrinsic_signer_conversion() {
let client = TungsteniteRpcClient::with_default_url(1);
let mut api = Api::<DefaultRuntimeConfig, _>::new(client).unwrap();
let signer = AccountKeyring::Alice.pair();
api.set_signer(ExtrinsicSigner::<DefaultRuntimeConfig>::new(signer));
}
}
7 changes: 5 additions & 2 deletions testing/examples/chain_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@

//! Tests for the chain rpc interface functions.
use sp_keyring::AccountKeyring;
use substrate_api_client::{
ac_primitives::AssetRuntimeConfig,
ac_primitives::{DefaultRuntimeConfig, ExtrinsicSigner},
rpc::{HandleSubscription, JsonrpseeClient},
Api, GetChainInfo, SubscribeChain,
};
Expand All @@ -25,7 +26,9 @@ use substrate_api_client::{
async fn main() {
// Setup
let client = JsonrpseeClient::with_default_url().unwrap();
let api = Api::<AssetRuntimeConfig, _>::new(client).unwrap();
let mut api = Api::<DefaultRuntimeConfig, _>::new(client).unwrap();
let signer = AccountKeyring::Alice.pair();
api.set_signer(ExtrinsicSigner::<DefaultRuntimeConfig>::new(signer));

// GetChainInfo
let finalized_header_hash = api.get_finalized_head().unwrap().unwrap();
Expand Down

0 comments on commit 8543bd9

Please sign in to comment.