Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tool 373 mark as deprecated all legacy functions #567

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/abi/interaction.local.net.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { ManagedDecimalValue } from "./typesystem";
describe("test smart contract interactor", function () {
let provider = createLocalnetProvider();
let alice: TestWallet;
const transactionComputer = new TransactionComputer();

before(async function () {
({ alice } = await loadTestWallets());
Expand Down Expand Up @@ -46,7 +47,6 @@ describe("test smart contract interactor", function () {
});
deployTransaction.nonce = BigInt(alice.account.nonce.valueOf());

const transactionComputer = new TransactionComputer();
deployTransaction.signature = await alice.signer.sign(
Buffer.from(transactionComputer.computeBytesForSigning(deployTransaction)),
);
Expand Down Expand Up @@ -283,7 +283,6 @@ describe("test smart contract interactor", function () {
});
deployTransaction.nonce = BigInt(alice.account.nonce.valueOf());

const transactionComputer = new TransactionComputer();
deployTransaction.signature = await alice.signer.sign(
Buffer.from(transactionComputer.computeBytesForSigning(deployTransaction)),
);
Expand Down Expand Up @@ -385,7 +384,6 @@ describe("test smart contract interactor", function () {
});
deployTransaction.nonce = BigInt(alice.account.nonce.valueOf());

const transactionComputer = new TransactionComputer();
deployTransaction.signature = await alice.signer.sign(
Buffer.from(transactionComputer.computeBytesForSigning(deployTransaction)),
);
Expand Down Expand Up @@ -483,7 +481,6 @@ describe("test smart contract interactor", function () {
const transaction = options.transaction;
const wallet = options.wallet;

const transactionComputer = new TransactionComputer();
transaction.signature = await wallet.signer.sign(transactionComputer.computeBytesForSigning(transaction));
}
});
1 change: 1 addition & 0 deletions src/abi/interaction.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ describe("test smart contract interactor", function () {
let provider = new MockNetworkProvider();
let alice: TestWallet;
const transactionComputer = new TransactionComputer();

before(async function () {
({ alice } = await loadTestWallets());
});
Expand Down
2 changes: 1 addition & 1 deletion src/abi/interaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ interface ISmartContractWithinInteraction {
}

/**
* @deprecated component. Use "SmartContractTransactionsFactory" (for transactions) or "SmartContractQueriesController" (for queries), instead.
* @deprecated component. Use "SmartContractTransactionsFactory" (for transactions) or "SmartContractController" (for queries), instead.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the controller can be used for transactions, as well.

*
* Interactions can be seen as mutable transaction & query builders.
*
Expand Down
5 changes: 1 addition & 4 deletions src/abi/smartContract.local.net.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ describe("test on local testnet", function () {
let provider = createLocalnetProvider();
let watcher: TransactionWatcher;
let parser: SmartContractTransactionsOutcomeParser;
const transactionComputer = new TransactionComputer();

before(async function () {
({ alice, bob, carol } = await loadTestWallets());
Expand Down Expand Up @@ -61,7 +62,6 @@ describe("test on local testnet", function () {
});
deployTransaction.nonce = BigInt(alice.account.nonce.valueOf());

const transactionComputer = new TransactionComputer();
deployTransaction.signature = await alice.signer.sign(
Buffer.from(transactionComputer.computeBytesForSigning(deployTransaction)),
);
Expand Down Expand Up @@ -146,7 +146,6 @@ describe("test on local testnet", function () {
});
deployTransaction.nonce = BigInt(alice.account.nonce.valueOf());

const transactionComputer = new TransactionComputer();
deployTransaction.signature = await alice.signer.sign(
Buffer.from(transactionComputer.computeBytesForSigning(deployTransaction)),
);
Expand Down Expand Up @@ -224,7 +223,6 @@ describe("test on local testnet", function () {
arguments: [new U32Value(10000)],
});
deployTransaction.nonce = BigInt(alice.account.nonce.valueOf());
const transactionComputer = new TransactionComputer();
deployTransaction.signature = await alice.signer.sign(
Buffer.from(transactionComputer.computeBytesForSigning(deployTransaction)),
);
Expand Down Expand Up @@ -327,7 +325,6 @@ describe("test on local testnet", function () {
});
deployTransaction.nonce = BigInt(alice.account.nonce.valueOf());

const transactionComputer = new TransactionComputer();
deployTransaction.signature = await alice.signer.sign(
Buffer.from(transactionComputer.computeBytesForSigning(deployTransaction)),
);
Expand Down
2 changes: 1 addition & 1 deletion src/abi/smartContractResults.local.net.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ describe("fetch transactions from local testnet", function () {
let watcher: TransactionWatcher;
let parser: SmartContractTransactionsOutcomeParser;
const transactionComputer = new TransactionComputer();

before(async function () {
({ alice } = await loadTestWallets());
watcher = new TransactionWatcher({
Expand Down Expand Up @@ -99,7 +100,6 @@ describe("fetch transactions from local testnet", function () {
});
deployTransaction.nonce = BigInt(alice.account.nonce.valueOf());

const transactionComputer = new TransactionComputer();
deployTransaction.signature = await alice.signer.sign(
Buffer.from(transactionComputer.computeBytesForSigning(deployTransaction)),
);
Expand Down
4 changes: 1 addition & 3 deletions src/networkProviders/apiNetworkProvider.dev.net.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { ApiNetworkProvider } from "./apiNetworkProvider";

describe("ApiNetworkProvider Tests", function () {
const apiProvider = new ApiNetworkProvider("https://devnet-api.multiversx.com");
const transactionComputer = new TransactionComputer();

it("should fetch network configuration", async () => {
const result = await apiProvider.getNetworkConfig();
Expand Down Expand Up @@ -282,7 +283,6 @@ describe("ApiNetworkProvider Tests", function () {

it("should simulate transaction", async () => {
const bob = await loadTestWallet("bob");
const transactionComputer = new TransactionComputer();
let transaction = new Transaction({
sender: bob.address,
receiver: bob.address,
Expand Down Expand Up @@ -334,7 +334,6 @@ describe("ApiNetworkProvider Tests", function () {

it("should estimate transaction cost", async function () {
const bob = await loadTestWallet("bob");
const transactionComputer = new TransactionComputer();
const transaction = new Transaction({
sender: bob.address,
receiver: bob.address,
Expand All @@ -351,7 +350,6 @@ describe("ApiNetworkProvider Tests", function () {
it("should send and await for completed transaction", async function () {
this.timeout(30000);
const bob = await loadTestWallet("bob");
const transactionComputer = new TransactionComputer();
let transaction = new Transaction({
sender: bob.address,
receiver: bob.address,
Expand Down
6 changes: 2 additions & 4 deletions src/networkProviders/proxyNetworkProvider.dev.net.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ProxyNetworkProvider } from "./proxyNetworkProvider";

describe("ProxyNetworkProvider Tests", function () {
const proxy = new ProxyNetworkProvider("https://devnet-gateway.multiversx.com");

const transactionComputer = new TransactionComputer();
it("should fetch network configuration", async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add empty line here

const result = await proxy.getNetworkConfig();
assert.equal(result.chainID, "D");
Expand Down Expand Up @@ -282,7 +282,7 @@ describe("ProxyNetworkProvider Tests", function () {

it("should simulate transaction", async () => {
const bob = await loadTestWallet("bob");
const transactionComputer = new TransactionComputer();

let transaction = new Transaction({
sender: bob.address,
receiver: bob.address,
Expand Down Expand Up @@ -334,7 +334,6 @@ describe("ProxyNetworkProvider Tests", function () {

it("should estimate transaction cost", async function () {
const bob = await loadTestWallet("bob");
const transactionComputer = new TransactionComputer();
const transaction = new Transaction({
sender: bob.address,
receiver: bob.address,
Expand All @@ -351,7 +350,6 @@ describe("ProxyNetworkProvider Tests", function () {
it("should send and await for completed transaction", async function () {
this.timeout(50000);
const bob = await loadTestWallet("bob");
const transactionComputer = new TransactionComputer();
let transaction = new Transaction({
sender: bob.address,
receiver: bob.address,
Expand Down
4 changes: 2 additions & 2 deletions src/transaction.local.net.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { TransferTransactionsFactory } from "./transfers/transferTransactionsFac
describe("test transaction", function () {
let alice: TestWallet, bob: TestWallet;
const transactionComputer = new TransactionComputer();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing empty line below (here, and in a few other files that have been changed).


before(async function () {
({ alice, bob } = await loadTestWallets());
});
Expand Down Expand Up @@ -56,8 +57,7 @@ describe("test transaction", function () {
await bob.sync(provider);
let initialBalanceOfBob = new BigNumber((await bob.getBalance(provider)).toString());

transactionOne.nonce = alice.account.nonce;
alice.account.incrementNonce();
transactionOne.nonce = alice.account.getNonceThenIncrement();
transactionTwo.nonce = alice.account.nonce;

await signTransaction({ transaction: transactionOne, wallet: alice });
Expand Down
Loading