From 270f8592b33c65bc4da99616700cc34cc45aa08f Mon Sep 17 00:00:00 2001 From: Jonathan Tey Date: Wed, 5 Dec 2018 10:25:33 +0800 Subject: [PATCH 1/3] Fix spelling for reapply --- src/model/transaction/Transaction.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/model/transaction/Transaction.ts b/src/model/transaction/Transaction.ts index 65a8fcc792..98792df920 100644 --- a/src/model/transaction/Transaction.ts +++ b/src/model/transaction/Transaction.ts @@ -158,12 +158,12 @@ export abstract class Transaction { } /** - * @description re-aplly a given value to the transaction in an immutable way + * @description reapply a given value to the transaction in an immutable way * @param {Deadline} deadline * @returns {Transaction} * @memberof Transaction */ - public replyGiven(deadline: Deadline = Deadline.create()): Transaction { + public reapplyGiven(deadline: Deadline = Deadline.create()): Transaction { if (this.isUnannounced()) { return Object.assign({__proto__: Object.getPrototypeOf(this)}, this, {deadline}); } From ec762b7aa4ecaffee67b6f13569c7c605cbb45e2 Mon Sep 17 00:00:00 2001 From: Jonathan Tey Date: Wed, 5 Dec 2018 15:41:36 +0800 Subject: [PATCH 2/3] Fix tests for name change --- test/model/transaction/Transaction.spec.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/model/transaction/Transaction.spec.ts b/test/model/transaction/Transaction.spec.ts index 6d1987ecce..aade7541e3 100644 --- a/test/model/transaction/Transaction.spec.ts +++ b/test/model/transaction/Transaction.spec.ts @@ -111,7 +111,7 @@ describe('Transaction', () => { new TransactionInfo(UInt64.fromUint(100), 1, 'id_hash', 'hash', 'hash'), ); expect(() => { - transaction.replyGiven(Deadline.create()); + transaction.reapplyGiven(Deadline.create()); }).to.throws('an Announced transaction can\'t be modified'); }); it('should return a new transaction', () => { @@ -124,7 +124,7 @@ describe('Transaction', () => { undefined, ); - const newTransaction = transaction.replyGiven(Deadline.create()); + const newTransaction = transaction.reapplyGiven(Deadline.create()); expect(newTransaction).to.not.equal(transaction); }); it('should overide deadline properly', () => { @@ -138,7 +138,7 @@ describe('Transaction', () => { ); const newDeadline = Deadline.create(3); - const newTransaction = transaction.replyGiven(newDeadline); + const newTransaction = transaction.reapplyGiven(newDeadline); const equal = newTransaction.deadline.value.equals(transaction.deadline.value); const after = newTransaction.deadline.value.isAfter(transaction.deadline.value); expect(newTransaction.deadline).to.be.equal(newDeadline); From ae5b92c3ebb0246ca3417c15568a8ca8bbc00abd Mon Sep 17 00:00:00 2001 From: Jonathan Tey Date: Wed, 5 Dec 2018 15:51:29 +0800 Subject: [PATCH 3/3] Fix description for reapplyGiven test --- test/model/transaction/Transaction.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/model/transaction/Transaction.spec.ts b/test/model/transaction/Transaction.spec.ts index aade7541e3..e4412b5016 100644 --- a/test/model/transaction/Transaction.spec.ts +++ b/test/model/transaction/Transaction.spec.ts @@ -99,7 +99,7 @@ describe('Transaction', () => { }); }); - describe('replyGiven', () => { + describe('reapplyGiven', () => { it('should throw an error if the transaction is announced', () => { const transaction = new FakeTransaction(TransactionType.TRANSFER, NetworkType.MIJIN_TEST,