INNER CODE UNIT · Rust
test_chainflip_explorer
gemwalletcom/wallet · core/crates/block_explorers/src/lib.rs:216
fn test_chainflip_explorer() {
assert_eq!(swap_explorer(SwapProvider::Chainflip, Chain::Solana).unwrap().name(), "Chainflip");
assert!(swap_explorer(SwapProvider::Chainflip, Chain::Polkadot).is_none());
}
#[test]
fn test_swaps_xyz_explorer() {
let transaction_id = "0x6331c6eded7cfe4ed578e41a57855102b3fd60b3daa2c4bef992f4f5869856b4";
for chain in [Chain::Ton, Chain::Algorand, Chain::Stellar] {
let explorer = swap_explorer(SwapProvider::SwapsXyz, chain).unwrap();
assert_eq!(explorer.name(), "Swaps.xyz");
assert_eq!(explorer.get_swap_tx_url(&transaction_id.into()), format!("https://scan.swaps.xyz/transactions?search={transaction_id}"));
}
}
}