Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/model/transaction/Transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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});
}
Expand Down
8 changes: 4 additions & 4 deletions test/model/transaction/Transaction.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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', () => {
Expand All @@ -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', () => {
Expand All @@ -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);
Expand Down