Skip to content

Commit

Permalink
fix multisig test to restore participant from seed and exchange keys
Browse files Browse the repository at this point in the history
  • Loading branch information
woodser committed Aug 24, 2023
1 parent 9a1961c commit 610049e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
13 changes: 7 additions & 6 deletions src/test/TestMoneroWalletCommon.js
Expand Up @@ -4754,12 +4754,13 @@ class TestMoneroWalletCommon {
assert(seed.length > 0);

// restore participant from multisig seed
// TODO: fix restoring from seed: https://github.com/monero-project/monero/pull/8942
// participant = await this.createWallet(new MoneroWalletConfig().setSeed(seed).setIsMultisig(true));
// await MoneroUtils.validateAddress(await participant.getPrimaryAddress(), TestUtils.NETWORK_TYPE);
// assert.equal(await participant.getPrimaryAddress(), address);
// this._testMultisigInfo(await participant.getMultisigInfo(), M, N);
// assert.equal(await participant.getSeed(), seed);
await this.closeWallet(participant);
participant = await this.createWallet(new MoneroWalletConfig().setSeed(seed).setIsMultisig(true));
await MoneroUtils.validateAddress(await participant.getPrimaryAddress(), TestUtils.NETWORK_TYPE);
assert.equal(await participant.getPrimaryAddress(), address);
this._testMultisigInfo(await participant.getMultisigInfo(), M, N);
assert.equal(await participant.getSeed(), seed);
participants[0] = participant;

// test sending a multisig transaction if configured
if (testTx) {
Expand Down
3 changes: 2 additions & 1 deletion src/test/TestMoneroWalletFull.js
Expand Up @@ -410,7 +410,8 @@ class TestMoneroWalletFull extends TestMoneroWalletCommon {
catch (e) { }

// save and close participants
await TestUtils.stopWalletRpcProcess(participants[0]);
if (participants[0] instanceof monerojs.MoneroWalletRpc) await TestUtils.stopWalletRpcProcess(participants[0]);
else participants[0].close(true); // multisig tests might restore wallet from seed
await TestUtils.stopWalletRpcProcess(participants[1]);
await that.closeWallet(participants[2], true);
if (err) throw err;
Expand Down

0 comments on commit 610049e

Please sign in to comment.