diff --git a/web3.js/src/transaction.ts b/web3.js/src/transaction.ts index 3e1d2eef6450ef..0dc9d4bdcfcefe 100644 --- a/web3.js/src/transaction.ts +++ b/web3.js/src/transaction.ts @@ -253,12 +253,14 @@ export class Transaction { ) { if (!opts) { return; - } else if (Object.prototype.hasOwnProperty.call(opts, 'lastValidBlockHeight')) { + } else if ( + Object.prototype.hasOwnProperty.call(opts, 'lastValidBlockHeight') + ) { const newOpts = opts as TransactionBlockhashCtor; Object.assign(this, newOpts); this.recentBlockhash = newOpts.recentBlockhash; this.lastValidBlockHeight = newOpts.lastValidBlockHeight; - } else { + } else { const oldOpts = opts as TransactionCtorFields_DEPRECATED; Object.assign(this, oldOpts); this.recentBlockhash = oldOpts.recentBlockhash; diff --git a/web3.js/test/transaction.test.ts b/web3.js/test/transaction.test.ts index 09dc13d1f24160..1155048713a5e1 100644 --- a/web3.js/test/transaction.test.ts +++ b/web3.js/test/transaction.test.ts @@ -470,7 +470,9 @@ describe('Transaction', () => { const recentBlockhash = 'EETubP5AKHgjPAhzPAFcb8BAY1hMH639CWCFTqi3hq1k'; const lastValidBlockHeight = 1234; - const transaction = new Transaction({ recentBlockhash, lastValidBlockHeight, + const transaction = new Transaction({ + recentBlockhash, + lastValidBlockHeight, }); expect(transaction.recentBlockhash).to.eq(recentBlockhash); expect(transaction.lastValidBlockHeight).to.eq(lastValidBlockHeight);