-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
48b8689
commit d60d84e
Showing
2 changed files
with
9 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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); | ||
|
@@ -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); | ||
|
@@ -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); | ||
|
@@ -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); | ||
|
@@ -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); | ||
|
@@ -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); | ||
|
@@ -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({ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters