From 7fa413a47edcb32ac0097b1559de0cae52d8e3c9 Mon Sep 17 00:00:00 2001 From: danielailie Date: Wed, 18 Dec 2024 11:24:06 +0200 Subject: [PATCH] Remove unneeded check --- src/transfers/transferTransactionsFactory.ts | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/transfers/transferTransactionsFactory.ts b/src/transfers/transferTransactionsFactory.ts index 0ed1e1ba..3423142f 100644 --- a/src/transfers/transferTransactionsFactory.ts +++ b/src/transfers/transferTransactionsFactory.ts @@ -1,6 +1,6 @@ import { Address } from "../address"; import { EGLD_IDENTIFIER_FOR_MULTI_ESDTNFT_TRANSFER } from "../constants"; -import { Err, ErrBadUsage } from "../errors"; +import { ErrBadUsage } from "../errors"; import { TokenComputer, TokenTransfer } from "../tokens"; import { TokenTransfersDataBuilder } from "../tokenTransfersDataBuilder"; import { Transaction } from "../transaction"; @@ -33,15 +33,7 @@ export class TransferTransactionsFactory { this.tokenTransfersDataBuilder = new TokenTransfersDataBuilder(); } - private ensureConfigIsDefined() { - if (this.config === undefined) { - throw new Err("'config' is not defined"); - } - } - createTransactionForNativeTokenTransfer(sender: Address, options: resources.NativeTokenTransferInput): Transaction { - this.ensureConfigIsDefined(); - const data = options.data || new Uint8Array(); return new Transaction({ @@ -55,8 +47,6 @@ export class TransferTransactionsFactory { } createTransactionForESDTTokenTransfer(sender: Address, options: resources.CustomTokenTransferInput): Transaction { - this.ensureConfigIsDefined(); - const numberOfTransfers = options.tokenTransfers.length; if (numberOfTransfers === 0) { @@ -117,8 +107,6 @@ export class TransferTransactionsFactory { tokenTransfers: TokenTransfer[]; }, ): Transaction { - this.ensureConfigIsDefined(); - const transfer = options.tokenTransfers[0]; const { dataParts, extraGasForTransfer, receiver } = this.buildTransferData(transfer, { sender,