From 0a232cdb9ddd6116839e330987c6d2853fbfce18 Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Mon, 15 Sep 2014 14:25:02 +1000 Subject: [PATCH] tests: sign test needs to trigger ecurve.Point side effects --- test/wallet.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/wallet.js b/test/wallet.js index dd23587..ccb5f22 100644 --- a/test/wallet.js +++ b/test/wallet.js @@ -651,10 +651,16 @@ describe('Wallet', function() { var fee = 30000 sinon.spy(TransactionBuilder.prototype, "sign") - var tx = wallet.createTx(to, value, { fixedFee: fee }) + wallet.createTx(to, value, { fixedFee: fee }) + + var priv1 = wallet.getPrivateKeyForAddress(address1) + var priv2 = wallet.getPrivateKeyForAddress(address2) + + // FIXME: boo (required) side effects + priv1.pub.Q.affineX, priv2.pub.Q.affineX - assert(TransactionBuilder.prototype.sign.calledWith(0, wallet.getPrivateKeyForAddress(address2))) - assert(TransactionBuilder.prototype.sign.calledWith(1, wallet.getPrivateKeyForAddress(address1))) + assert(TransactionBuilder.prototype.sign.calledWith(0, priv2)) + assert(TransactionBuilder.prototype.sign.calledWith(1, priv1)) }) })