Skip to content

Commit 54c80da

Browse files
committed
fix bdd tests
1 parent 8ab2ca6 commit 54c80da

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

test/bdd/steps/common.mjs

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -149,29 +149,23 @@ Given(
149149
try {
150150
await nodeInstance.start(); // This will skip startNetworkModule
151151

152-
// Configure blockchain options for the DKG client
153-
const clientBlockchainOptions = {};
154-
for (const blockchainId of Object.keys(this.state.localBlockchains)) {
155-
const blockchain = this.state.localBlockchains[blockchainId];
156-
const wallets = blockchain.getWallets();
157-
clientBlockchainOptions[blockchainId] = {
158-
blockchain: {
159-
name: blockchainId,
160-
publicKey: wallets[0].address,
161-
privateKey: wallets[0].privateKey,
162-
rpc: `http://localhost:${blockchain.port}`,
163-
hubContract: '0x5FbDB2315678afecb367f032d93F642f64180aa3',
164-
},
165-
};
166-
}
152+
// Get the first blockchain for the DKG client config
153+
const firstBlockchainId = Object.keys(this.state.localBlockchains)[0];
154+
const firstBlockchain = this.state.localBlockchains[firstBlockchainId];
155+
const firstWallet = firstBlockchain.getWallets()[0];
167156

168157
const client = new DkgClientHelper({
169158
endpoint: 'http://localhost',
170159
port: rpcPort,
171160
useSSL: false,
172161
timeout: 25,
173162
loglevel: 'trace',
174-
...clientBlockchainOptions,
163+
blockchain: {
164+
name: firstBlockchainId,
165+
publicKey: firstWallet.address,
166+
privateKey: firstWallet.privateKey,
167+
rpc: `http://localhost:${firstBlockchain.port}`,
168+
},
175169
});
176170

177171
this.state.bootstraps.push({

0 commit comments

Comments
 (0)