From e8e6009cd0d6b4ac28b1076f773b4348c38c0e7e Mon Sep 17 00:00:00 2001 From: nanocryk <6422796+nanocryk@users.noreply.github.com> Date: Wed, 4 Dec 2024 15:20:38 +0100 Subject: [PATCH] test operators appears in pallet session --- .../test_zombie_tanssi_relay_eth_bridge.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/test/suites/zombie_tanssi_relay_eth_bridge/test_zombie_tanssi_relay_eth_bridge.ts b/test/suites/zombie_tanssi_relay_eth_bridge/test_zombie_tanssi_relay_eth_bridge.ts index 2bf2595d6..686aa4bf9 100644 --- a/test/suites/zombie_tanssi_relay_eth_bridge/test_zombie_tanssi_relay_eth_bridge.ts +++ b/test/suites/zombie_tanssi_relay_eth_bridge/test_zombie_tanssi_relay_eth_bridge.ts @@ -33,8 +33,12 @@ describeSuite({ let beefyClientDetails; let gatewayProxyAddress; let gatewayDetails; + let ethereumWallet; + let operatorAccount; + let operatorNimbusKey; + beforeAll(async () => { relayApi = context.polkadotJs("Tanssi-relay"); const relayNetwork = relayApi.consts.system.version.specName.toString(); @@ -46,6 +50,12 @@ describeSuite({ const beaconRelay = keyring.addFromUri("//BeaconRelay", { name: "Beacon relay default" }); const executionRelay = keyring.addFromUri("//ExecutionRelay", { name: "Execution relay default" }); + // Operator keys + operatorAccount = keyring.addFromUri("//" + "Bob", { name: "COLLATOR" + " ACCOUNT" }); + operatorNimbusKey = keyring.addFromUri("//" + "COLLATOR_NIMBUS", { name: "COLLATOR" + " NIMBUS" }); + + await relayApi.tx.session.setKeys(u8aToHex(operatorNimbusKey), []).signAndSend(operatorAccount); + const fundingTxHash = await relayApi.tx.utility .batch([ relayApi.tx.balances.transferAllowDeath(beaconRelay.address, 1_000_000_000_000), @@ -173,7 +183,7 @@ describeSuite({ const externalValidatorsBefore = await relayApi.query.externalValidators.externalValidators(); const rawValidators = [ - "0x1234567890123456789012345678901234567890123456789012345678901234", + u8aToHex(operatorAccount.addressRaw), "0x7894567890123456789012345678901234567890123456789012345678901234", "0x4564567890123456789012345678901234567890123456789012345678901234", ]; @@ -196,6 +206,9 @@ describeSuite({ }); expect(externalValidatorsHex).to.deep.eq(rawValidators); + + const sessionValidators = await relayApi.query.session.validators(); + expect(sessionValidators.includes(operatorNimbusKey)); }, });