From 67762727f28028401d6fe87171f0c4dc39431734 Mon Sep 17 00:00:00 2001 From: Ron Date: Fri, 13 Sep 2024 12:06:31 +0800 Subject: [PATCH] Fix register PNA (#1282) --- smoketest/tests/register_polkadot_token.rs | 25 ++++++++++------------ 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/smoketest/tests/register_polkadot_token.rs b/smoketest/tests/register_polkadot_token.rs index 9c59347e64..f4c0c79044 100644 --- a/smoketest/tests/register_polkadot_token.rs +++ b/smoketest/tests/register_polkadot_token.rs @@ -10,12 +10,11 @@ use snowbridge_smoketest::{ }, }, }; -use subxt_signer::sr25519::dev; +use subxt::tx::Payload; #[tokio::test] async fn register_polkadot_token() { let test_clients = initial_clients().await.expect("initialize clients"); - type Junctions = runtime_types::staging_xcm::v4::junctions::Junctions; let asset = VersionedLocation::V4(runtime_types::staging_xcm::v4::location::Location { parents: 1, @@ -42,20 +41,18 @@ async fn register_polkadot_token() { ), decimals: 12, }; - let call = - bridgehub::api::ethereum_system::calls::TransactionApi.register_token(asset, metadata); - let result = test_clients - .bridge_hub_client - .tx() - .sign_and_submit_then_watch_default(&call, &dev::bob()) - .await - .expect("send register call.") - .wait_for_finalized_success() - .await - .expect("call success"); + let ethereum_system_api = bridgehub::api::ethereum_system::calls::TransactionApi; - println!("call issued at bridgehub block hash {:?}", result.extrinsic_hash()); + let mut encoded = Vec::new(); + ethereum_system_api + .register_token(asset, metadata) + .encode_call_data_to(&test_clients.bridge_hub_client.metadata(), &mut encoded) + .expect("encoded call"); + + governance_bridgehub_call_from_relay_chain(encoded) + .await + .expect("set token fees"); wait_for_bridgehub_event::(&test_clients.bridge_hub_client).await;