Skip to content

Commit

Permalink
renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
popenta committed Oct 26, 2023
1 parent 87dd278 commit 5e5d1f2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class Token {
}
}

export namespace NewTokenTransfer {
export namespace NextTokenTransfer {
export class TokenTransfer {
token: Token;
amount: BigNumber.Value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/transactionsFactories/smartContractTransactionsFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 || [];
Expand Down
8 changes: 4 additions & 4 deletions src/transactionsFactories/tokenTransfersDataBuilder.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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;
Expand All @@ -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) {
Expand Down

0 comments on commit 5e5d1f2

Please sign in to comment.