From 610049e3ed7f81985451c38833d0c8d32f2e6f83 Mon Sep 17 00:00:00 2001 From: woodser Date: Thu, 24 Aug 2023 13:20:49 -0400 Subject: [PATCH] fix multisig test to restore participant from seed and exchange keys --- src/test/TestMoneroWalletCommon.js | 13 +++++++------ src/test/TestMoneroWalletFull.js | 3 ++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/test/TestMoneroWalletCommon.js b/src/test/TestMoneroWalletCommon.js index d7cc7ff74..f8779fe60 100644 --- a/src/test/TestMoneroWalletCommon.js +++ b/src/test/TestMoneroWalletCommon.js @@ -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) { diff --git a/src/test/TestMoneroWalletFull.js b/src/test/TestMoneroWalletFull.js index 06108d2b1..178637974 100644 --- a/src/test/TestMoneroWalletFull.js +++ b/src/test/TestMoneroWalletFull.js @@ -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;