Skip to content

Commit

Permalink
Remove unneeded check
Browse files Browse the repository at this point in the history
  • Loading branch information
danielailie committed Dec 18, 2024
1 parent f297d23 commit 7fa413a
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/transfers/transferTransactionsFactory.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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({
Expand All @@ -55,8 +47,6 @@ export class TransferTransactionsFactory {
}

createTransactionForESDTTokenTransfer(sender: Address, options: resources.CustomTokenTransferInput): Transaction {
this.ensureConfigIsDefined();

const numberOfTransfers = options.tokenTransfers.length;

if (numberOfTransfers === 0) {
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 7fa413a

Please sign in to comment.