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

Conversation

danielailie
Copy link
Contributor

No description provided.

@danielailie danielailie self-assigned this Jan 29, 2025
@@ -21,7 +21,7 @@ interface ISmartContractWithinInteraction {
}

/**
* Legacy component. Use "SmartContractTransactionsFactory" (for transactions) or "SmartContractQueriesController" (for queries), instead.
* @deprecated component. Use "SmartContractTransactionsFactory" (for transactions) or "SmartContractQueriesController" (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.

this does not exist anymore: SmartContractQueriesController. Change to:

Use "SmartContractTransactionsFactory" or "SmartContractController", instead.

or something similar.

andreibancioiu
andreibancioiu previously approved these changes Jan 29, 2025
transaction.setSender(alice.address);
transaction.applySignature(await alice.signer.sign(transaction.serializeForSigning()));
transaction.sender = alice.address;
transaction.signature = await alice.signer.sign(transactionComputer.computeBytesForSigning(transaction));
Copy link
Contributor

Choose a reason for hiding this comment

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

In a future PR, since now we have the Account class, maybe replace alice.signer.sign(...) withalice.signTransaction(...)?

assert.equal(deployTransaction.gasLimit, 1000000n);
assert.equal(deployTransaction.nonce, 42n);

// Sign the transaction
deployTransaction.applySignature(await alice.signer.sign(deployTransaction.serializeForSigning()));
deployTransaction.signature = await alice.signer.sign(computer.computeBytesForSigning(deployTransaction));
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment / signTransaction etc.

@@ -13,7 +13,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).

Comment on lines 59 to 61
transactionOne.nonce = alice.account.nonce;
alice.account.incrementNonce();
transactionTwo.setNonce(alice.account.nonce);
transactionTwo.nonce = alice.account.nonce;
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can even use getThenIncrementNonce() - this is the place it excels?

@@ -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.

@@ -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

@danielailie danielailie merged commit 66c042d into feat/next Jan 29, 2025
4 checks passed
@danielailie danielailie deleted the TOOL-373-mark-as-deprecated-all-legacy-functions branch January 29, 2025 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants