Skip to content

Commit 03e0991

Browse files
author
Grégory Saive
authored
Merge pull request #31 from jontey/patch-1
Fix spelling for reapplyGiven method (prev. replyGiven)
2 parents 684ed22 + 7de8ee4 commit 03e0991

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/model/transaction/Transaction.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,12 @@ export abstract class Transaction {
158158
}
159159

160160
/**
161-
* @description re-aplly a given value to the transaction in an immutable way
161+
* @description reapply a given value to the transaction in an immutable way
162162
* @param {Deadline} deadline
163163
* @returns {Transaction}
164164
* @memberof Transaction
165165
*/
166-
public replyGiven(deadline: Deadline = Deadline.create()): Transaction {
166+
public reapplyGiven(deadline: Deadline = Deadline.create()): Transaction {
167167
if (this.isUnannounced()) {
168168
return Object.assign({__proto__: Object.getPrototypeOf(this)}, this, {deadline});
169169
}

test/model/transaction/Transaction.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ describe('Transaction', () => {
9999
});
100100
});
101101

102-
describe('replyGiven', () => {
102+
describe('reapplyGiven', () => {
103103
it('should throw an error if the transaction is announced', () => {
104104
const transaction = new FakeTransaction(TransactionType.TRANSFER,
105105
NetworkType.MIJIN_TEST,
@@ -111,7 +111,7 @@ describe('Transaction', () => {
111111
new TransactionInfo(UInt64.fromUint(100), 1, 'id_hash', 'hash', 'hash'),
112112
);
113113
expect(() => {
114-
transaction.replyGiven(Deadline.create());
114+
transaction.reapplyGiven(Deadline.create());
115115
}).to.throws('an Announced transaction can\'t be modified');
116116
});
117117
it('should return a new transaction', () => {
@@ -124,7 +124,7 @@ describe('Transaction', () => {
124124
undefined,
125125
);
126126

127-
const newTransaction = transaction.replyGiven(Deadline.create());
127+
const newTransaction = transaction.reapplyGiven(Deadline.create());
128128
expect(newTransaction).to.not.equal(transaction);
129129
});
130130
it('should overide deadline properly', () => {
@@ -138,7 +138,7 @@ describe('Transaction', () => {
138138
);
139139

140140
const newDeadline = Deadline.create(3);
141-
const newTransaction = transaction.replyGiven(newDeadline);
141+
const newTransaction = transaction.reapplyGiven(newDeadline);
142142
const equal = newTransaction.deadline.value.equals(transaction.deadline.value);
143143
const after = newTransaction.deadline.value.isAfter(transaction.deadline.value);
144144
expect(newTransaction.deadline).to.be.equal(newDeadline);

0 commit comments

Comments
 (0)