Skip to content

Commit

Permalink
Undo some changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
andreibancioiu committed Jul 6, 2022
1 parent 48b8689 commit d60d84e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions checks/localnet/snippets/adder.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ describe("adder snippet", async function () {

let contractAddress = await session.loadAddress("adderInShard0");

const { transaction, transactionHash } = await sendValueToContract(bob, contractAddress, 1, "[email protected]", 10000000)
const { transaction, transactionHash } = await sendToContract(bob, contractAddress, 1, "[email protected]", 10000000)
console.log("Transaction:", transactionHash);

const transactionOnNetwork = await transactionWatcher.awaitCompleted(transaction);
Expand All @@ -103,7 +103,7 @@ describe("adder snippet", async function () {

let contractAddress = await session.loadAddress("adderInShard0");

const { transaction, transactionHash } = await sendValueToContract(bob, contractAddress, 1, "", 10000000)
const { transaction, transactionHash } = await sendToContract(bob, contractAddress, 1, "", 10000000)
console.log("Transaction:", transactionHash);

const transactionOnNetwork = await transactionWatcher.awaitCompleted(transaction);
Expand Down Expand Up @@ -141,7 +141,7 @@ describe("adder snippet", async function () {

let contractAddress = await session.loadAddress("adderInShard1");

const { transaction, transactionHash } = await sendValueToContract(bob, contractAddress, 1, "[email protected]", 10000000);
const { transaction, transactionHash } = await sendToContract(bob, contractAddress, 1, "[email protected]", 10000000);
console.log("Transaction:", transactionHash);

const transactionOnNetwork = await transactionWatcher.awaitCompleted(transaction);
Expand All @@ -155,7 +155,7 @@ describe("adder snippet", async function () {

let contractAddress = await session.loadAddress("adderInShard0");

const { transaction, transactionHash } = await sendValueToContract(bob, contractAddress, 1, "hello", 10000000)
const { transaction, transactionHash } = await sendToContract(bob, contractAddress, 1, "hello", 10000000)
console.log("Transaction:", transactionHash);

const transactionOnNetwork = await transactionWatcher.awaitCompleted(transaction);
Expand All @@ -169,7 +169,7 @@ describe("adder snippet", async function () {

let contractAddress = await session.loadAddress("adderInShard1");

const { transaction, transactionHash } = await sendValueToContract(bob, contractAddress, 1, "hello", 10000000)
const { transaction, transactionHash } = await sendToContract(bob, contractAddress, 1, "hello", 10000000)
console.log("Transaction:", transactionHash);

const transactionOnNetwork = await transactionWatcher.awaitCompleted(transaction);
Expand All @@ -183,7 +183,7 @@ describe("adder snippet", async function () {

let contractAddress = await session.loadAddress("adderInShard0");

const { transaction, transactionHash } = await sendValueToContract(bob, contractAddress, 1, "add@01", 100000000)
const { transaction, transactionHash } = await sendToContract(bob, contractAddress, 1, "add@01", 100000000)
console.log("Transaction:", transactionHash);

const transactionOnNetwork = await transactionWatcher.awaitCompleted(transaction);
Expand All @@ -197,14 +197,14 @@ describe("adder snippet", async function () {

let contractAddress = await session.loadAddress("adderInShard1");

const { transaction, transactionHash } = await sendValueToContract(bob, contractAddress, 1, "add@01", 100000000)
const { transaction, transactionHash } = await sendToContract(bob, contractAddress, 1, "add@01", 100000000)
console.log("Transaction:", transactionHash);

const transactionOnNetwork = await transactionWatcher.awaitCompleted(transaction);
session.audit.onTransactionCompleted({ transactionHash, transaction: transactionOnNetwork });
});

async function sendValueToContract(user: ITestUser, contractAddress: IAddress, value: BigNumber.Value, data: string, gasLimit: number): Promise<{ transaction: Transaction, transactionHash: string }> {
async function sendToContract(user: ITestUser, contractAddress: IAddress, value: BigNumber.Value, data: string, gasLimit: number): Promise<{ transaction: Transaction, transactionHash: string }> {
const payment = TokenPayment.egldFromAmount(value);

const transaction = transactionFactory.createEGLDTransfer({
Expand Down
2 changes: 1 addition & 1 deletion checks/localnet/snippets/adderInteractor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class AdderInteractor {
gasLimit: 20000000,
chainID: this.networkConfig.ChainID
});

// Set the transaction nonce. The account nonce must be synchronized beforehand.
// Also, locally increment the nonce of the deployer (optional).
transaction.setNonce(deployer.account.getNonceThenIncrement());
Expand Down

0 comments on commit d60d84e

Please sign in to comment.