From 20b27281a56b6deda7b5a484a431e85988762058 Mon Sep 17 00:00:00 2001 From: Hugh Cunningham <57735705+hughy@users.noreply.github.com> Date: Tue, 3 Dec 2024 12:08:37 -0800 Subject: [PATCH] removes unused argument from RawTransaction.postedSize (#5684) the publicAddress passed to postedSize is not used --- ironfish/src/primitives/rawTransaction.test.slow.ts | 4 ++-- ironfish/src/primitives/rawTransaction.test.ts | 2 +- ironfish/src/primitives/rawTransaction.ts | 2 +- ironfish/src/wallet/wallet.ts | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ironfish/src/primitives/rawTransaction.test.slow.ts b/ironfish/src/primitives/rawTransaction.test.slow.ts index faf298d2b6..86b209a12f 100644 --- a/ironfish/src/primitives/rawTransaction.test.slow.ts +++ b/ironfish/src/primitives/rawTransaction.test.slow.ts @@ -219,7 +219,7 @@ describe('RawTransaction', () => { ) ).serialize() - expect(raw.postedSize(account.publicAddress)).toEqual(serialized.byteLength) + expect(raw.postedSize()).toEqual(serialized.byteLength) }) }) }) @@ -254,7 +254,7 @@ describe('RawTransaction', () => { ) ).serialize() - expect(raw.postedSize(account.publicAddress)).toEqual(serialized.byteLength) + expect(raw.postedSize()).toEqual(serialized.byteLength) }) }) }) diff --git a/ironfish/src/primitives/rawTransaction.test.ts b/ironfish/src/primitives/rawTransaction.test.ts index bf08438d47..58e86331a2 100644 --- a/ironfish/src/primitives/rawTransaction.test.ts +++ b/ironfish/src/primitives/rawTransaction.test.ts @@ -87,7 +87,7 @@ describe('RawTransaction', () => { // should have same size for posted transaction and estimated size from raw transaction const serializedPost = posted.serialize() - expect(raw.postedSize(account.publicAddress)).toEqual(serializedPost.byteLength) + expect(raw.postedSize()).toEqual(serializedPost.byteLength) }) it('should throw an error if the max mint value is exceeded', async () => { diff --git a/ironfish/src/primitives/rawTransaction.ts b/ironfish/src/primitives/rawTransaction.ts index fa5dc4f0eb..0321a9ed67 100644 --- a/ironfish/src/primitives/rawTransaction.ts +++ b/ironfish/src/primitives/rawTransaction.ts @@ -63,7 +63,7 @@ export class RawTransaction { this.version = version } - postedSize(_publicAddress: string): number { + postedSize(): number { let size = 0 size += 1 // version size += 8 // spends length diff --git a/ironfish/src/wallet/wallet.ts b/ironfish/src/wallet/wallet.ts index 84f1529fea..d8cad39384 100644 --- a/ironfish/src/wallet/wallet.ts +++ b/ironfish/src/wallet/wallet.ts @@ -914,7 +914,7 @@ export class Wallet { } if (options.feeRate) { - raw.fee = getFee(options.feeRate, raw.postedSize(options.account.publicAddress)) + raw.fee = getFee(options.feeRate, raw.postedSize()) } await this.fund(raw, { @@ -924,7 +924,7 @@ export class Wallet { }) if (options.feeRate) { - raw.fee = getFee(options.feeRate, raw.postedSize(options.account.publicAddress)) + raw.fee = getFee(options.feeRate, raw.postedSize()) raw.spends = [] await this.fund(raw, {