Files
pezkuwi-subxt/polkadot/zombienet_tests/functional/0003-common.js
T
Robert Hambrock 71aa0b0931 BEEFY & MMR zombienet tests (#7068)
* test that successfully verify self-generated proof

* verify proof result on all unpaused nodes

* tighten interface: reuse connection

* generate the proof on arbitrary node

* s/stub-name/validator

seems this doesn't pass some regex

* rename script

* add basic mmr-leaves test

* documentation formatting

* check lower bound on mmr leaves

* test beefy rpc: finalized heads match

* test mmr api: stateless proofs

* set lower bound on number of leaves

* change leaves in proof generation

* remove TODOs

* cleanup: consistently ignore zndsl name arg

* refactor: simplify returns

Co-authored-by: Serban Iorga <serban@parity.io>

* lax finalized head test

Co-authored-by: Adrian Catangiu <adrian@parity.io>

* fixup! refactor: simplify returns

* refactor out getApis

Co-authored-by: Serban Iorga <serban@parity.io>

* split out paused validator from group

* refactor: don't ignore node arg

don't randomize selection of proof generating / finalized head
retrieving node, but use the node arg for this.

* only check min block height, not relative

Co-authored-by: Adrian Catangiu <adrian@parity.io>

* verify finalized heads share same canonical chain

picks the node with the highest finalized head, gets its blockchain
headers since genesis, and verifies that all other nodes' finalized
heads are in said blockchain.

* fixup! split out paused validator from group

Co-authored-by: Serban Iorga <serban@parity.io>

---------

Co-authored-by: Serban Iorga <serban@parity.io>
Co-authored-by: Adrian Catangiu <adrian@parity.io>
2023-05-04 16:36:50 +03:00

17 lines
521 B
JavaScript

async function getApis(networkInfo, nodeNames) {
const connectionPromises = nodeNames.map(async (nodeName) => {
const { wsUri, userDefinedTypes } = networkInfo.nodesByName[nodeName];
const connection = await zombie.connect(wsUri, userDefinedTypes);
return { nodeName, connection };
});
const connections = await Promise.all(connectionPromises);
return connections.reduce((map, { nodeName, connection }) => {
map[nodeName] = connection;
return map;
}, {});
}
module.exports = { getApis };