From a2c3a4eb5ace9ee9756c2ee1fb1d4c6babc98f80 Mon Sep 17 00:00:00 2001 From: claravanstaden Date: Fri, 6 Dec 2024 14:13:32 +0200 Subject: [PATCH] adds test --- .../src/tests/snowbridge.rs | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/snowbridge.rs b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/snowbridge.rs index f579a049ac..4ad7b433ba 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/snowbridge.rs +++ b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/snowbridge.rs @@ -86,6 +86,28 @@ pub fn send_inbound_message(fixture: InboundQueueFixture) -> DispatchResult { ) } +#[test] +fn create_agent_2() { + let origin_para: u32 = 1001; + // Fund the origin parachain sovereign account so that it can pay execution fees. + BridgeHubPolkadot::fund_para_sovereign(origin_para.into(), INITIAL_FUND); + // Fund Treasury account with ED so that when create agent fees are paid to treasury, + // the treasury account may exist. + BridgeHubPolkadot::fund_accounts(vec![(RelayTreasuryPalletAccount::get(), INITIAL_FUND)]); + let parachain_sovereign = BridgeHubPolkadot::sovereign_account_id_of(Location::new( + 1, + [Parachain(origin_para.into())], + )); + + BridgeHubPolkadot::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; + // Check that a message was sent to Ethereum to create the agent + assert_ok!(::EthereumSystem::create_agent( + ::RuntimeOrigin::signed(parachain_sovereign), + )); + }); +} + /// Create an agent on Ethereum. An agent is a representation of an entity in the Polkadot /// ecosystem (like a parachain) on Ethereum. #[test]