From 5e5d1f2eec2571633bf76053929d3ce253e3c7b6 Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Thu, 26 Oct 2023 13:28:30 +0300 Subject: [PATCH] renaming --- src/tokens.ts | 2 +- .../smartContractTransactionsFactory.spec.ts | 14 +++++++------- .../smartContractTransactionsFactory.ts | 4 ++-- .../tokenTransfersDataBuilder.ts | 8 ++++---- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/tokens.ts b/src/tokens.ts index dd769992..07ef014f 100644 --- a/src/tokens.ts +++ b/src/tokens.ts @@ -11,7 +11,7 @@ export class Token { } } -export namespace NewTokenTransfer { +export namespace NextTokenTransfer { export class TokenTransfer { token: Token; amount: BigNumber.Value; diff --git a/src/transactionsFactories/smartContractTransactionsFactory.spec.ts b/src/transactionsFactories/smartContractTransactionsFactory.spec.ts index d1819072..02affd27 100644 --- a/src/transactionsFactories/smartContractTransactionsFactory.spec.ts +++ b/src/transactionsFactories/smartContractTransactionsFactory.spec.ts @@ -9,7 +9,7 @@ import { loadContractCode, loadAbiRegistry } from "../testutils/utils"; import { Err } from "../errors"; import { TransactionsFactoryConfig } from "./transactionsFactoryConfig"; import BigNumber from "bignumber.js"; -import { Token, NewTokenTransfer, TokenComputer } from "../tokens"; +import { Token, NextTokenTransfer, TokenComputer } from "../tokens"; describe("test smart contract transactions factory", function () { const config = new TransactionsFactoryConfig("D"); @@ -150,7 +150,7 @@ describe("test smart contract transactions factory", function () { const gasLimit = 6000000; const args = [new U32Value(7)]; const token = new Token("FOO-6ce17b", 0); - const transfer = new NewTokenTransfer.TokenTransfer(token, 10); + const transfer = new NextTokenTransfer.TokenTransfer(token, 10); const executeDraft = factory.createTransactionForExecute({ sender: sender, @@ -186,9 +186,9 @@ describe("test smart contract transactions factory", function () { const args = [new U32Value(7)]; const fooToken = new Token("FOO-6ce17b", 0); - const fooTransfer = new NewTokenTransfer.TokenTransfer(fooToken, 10); + const fooTransfer = new NextTokenTransfer.TokenTransfer(fooToken, 10); const barToken = new Token("BAR-5bc08f", 0); - const barTransfer = new NewTokenTransfer.TokenTransfer(barToken, 3140); + const barTransfer = new NextTokenTransfer.TokenTransfer(barToken, 3140); const executeDraft = factory.createTransactionForExecute({ sender: sender, @@ -229,7 +229,7 @@ describe("test smart contract transactions factory", function () { const args = [new U32Value(7)]; const token = new Token("NFT-123456", 1); - const transfer = new NewTokenTransfer.TokenTransfer(token, 1); + const transfer = new NextTokenTransfer.TokenTransfer(token, 1); const executeDraft = factory.createTransactionForExecute({ sender: sender, @@ -270,9 +270,9 @@ describe("test smart contract transactions factory", function () { const args = [new U32Value(7)]; const firstToken = new Token("NFT-123456", 1); - const firstTransfer = new NewTokenTransfer.TokenTransfer(firstToken, 1); + const firstTransfer = new NextTokenTransfer.TokenTransfer(firstToken, 1); const secondToken = new Token("NFT-123456", 42); - const secondTransfer = new NewTokenTransfer.TokenTransfer(secondToken, 1); + const secondTransfer = new NextTokenTransfer.TokenTransfer(secondToken, 1); const executeDraft = factory.createTransactionForExecute({ sender: sender, diff --git a/src/transactionsFactories/smartContractTransactionsFactory.ts b/src/transactionsFactories/smartContractTransactionsFactory.ts index aa311d8d..638cd783 100644 --- a/src/transactionsFactories/smartContractTransactionsFactory.ts +++ b/src/transactionsFactories/smartContractTransactionsFactory.ts @@ -8,7 +8,7 @@ import { NativeSerializer } from "../smartcontracts/nativeSerializer"; import { Err, ErrBadUsage } from "../errors"; import { Address } from "../address"; import { DraftTransactionBuilder } from "./draftTransactionBuilder"; -import { Token, NewTokenTransfer } from "../tokens"; +import { Token, NextTokenTransfer } from "../tokens"; import { TokenTransfersDataBuilder } from "./tokenTransfersDataBuilder"; interface Config { @@ -84,7 +84,7 @@ export class SmartContractTransactionsFactory { gasLimit: BigNumber.Value; args?: any[]; nativeTransferAmount?: BigNumber.Value; - tokenTransfers?: NewTokenTransfer.TokenTransfer[]; + tokenTransfers?: NextTokenTransfer.TokenTransfer[]; }): DraftTransaction { const args = options.args || []; const tokenTransfer = options.tokenTransfers || []; diff --git a/src/transactionsFactories/tokenTransfersDataBuilder.ts b/src/transactionsFactories/tokenTransfersDataBuilder.ts index 96cf382d..9f9bd19e 100644 --- a/src/transactionsFactories/tokenTransfersDataBuilder.ts +++ b/src/transactionsFactories/tokenTransfersDataBuilder.ts @@ -1,5 +1,5 @@ import { IAddress } from "../interface"; -import { NewTokenTransfer, TokenComputer } from "../tokens"; +import { NextTokenTransfer, TokenComputer } from "../tokens"; import { numberToPaddedHex, utf8ToHex, addressToHex } from "../utils.codec"; export class TokenTransfersDataBuilder { @@ -9,13 +9,13 @@ export class TokenTransfersDataBuilder { this.tokenComputer = new TokenComputer(); } - buildArgsForESDTTransfer(transfer: NewTokenTransfer.TokenTransfer): string[] { + buildArgsForESDTTransfer(transfer: NextTokenTransfer.TokenTransfer): string[] { let args = ["ESDTTransfer"]; args.push(...[utf8ToHex(transfer.token.identifier), numberToPaddedHex(transfer.amount)]); return args; } - buildArgsForSingleESDTNFTTransfer(transfer: NewTokenTransfer.TokenTransfer, receiver: IAddress) { + buildArgsForSingleESDTNFTTransfer(transfer: NextTokenTransfer.TokenTransfer, receiver: IAddress) { let args = ["ESDTNFTTransfer"]; const token = transfer.token; @@ -32,7 +32,7 @@ export class TokenTransfersDataBuilder { return args; } - buildArgsForMultiESDTNFTTransfer(receiver: IAddress, transfers: NewTokenTransfer.TokenTransfer[]) { + buildArgsForMultiESDTNFTTransfer(receiver: IAddress, transfers: NextTokenTransfer.TokenTransfer[]) { let args = ["MultiESDTNFTTransfer", addressToHex(receiver), numberToPaddedHex(transfers.length)]; for (let transfer of transfers) {