Skip to content

Commit

Permalink
Testing
Browse files Browse the repository at this point in the history
  • Loading branch information
bokkypoobah committed Jan 1, 2022
1 parent fbb77bc commit 2e7e333
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 54 deletions.
44 changes: 0 additions & 44 deletions test/00_test_0.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,50 +187,6 @@ describe("Nix", function () {
await data.printState("After Taker Executed Orders");
});

it.skip("04. Maker SellAll Test & Owner Withdraw Tips", async function () {
console.log(" 04. Maker SellAll Test & Owner Withdraw Tips");
console.log(" --- Maker Add Orders ---");
const addOrder1Tx = await data.nix.connect(data.maker0Signer).addOrder(data.nftA.address, [ 0, 1, 2 ], ZERO_ADDRESS, BUYORSELL.SELL, ANYORALL.ALL, ethers.utils.parseEther("12.3456"), 0, 1, data.integrator, { value: ethers.utils.parseEther("0.000000001") });
await data.printEvents("Maker Added Order #0 - SellAll NFTA:{0&1&2} for 12.3456e", await addOrder1Tx.wait());
await data.printState("After Maker Added Orders");

console.log(" --- Taker Execute Against Orders ---");
const executeOrder1Tx = await data.nix.connect(data.taker0Signer).executeOrder(0, [ 0, 1, 2 ], ethers.utils.parseEther("12.3456"), data.integrator, { value: ethers.utils.parseEther("0.000000001") });
await data.printEvents("Taker Bought #0,#1&#2 against SellAll NFTA:{0&1&2} for 12.3456e" , await executeOrder1Tx.wait());
await data.printState("After Taker Executed Orders");

console.log(" --- Send Nix ETH Tip ---");
const sendNixTip0Tx = await data.deployerSigner.sendTransaction({ to: data.nix.address, value: ethers.utils.parseEther("8.888") });
await data.printEvents("txFee Send Nix ETH Tip" , await sendNixTip0Tx.wait());
await data.printState("After Send Nix ETH Tip");

console.log(" --- Owner Withdraw Tips ---");
const ownerWithdrawTips0Tx = await data.nix.connect(data.deployerSigner).withdraw(ZERO_ADDRESS, 0, 0);
await data.printEvents("txFee Owner Withdrawn Tips" , await ownerWithdrawTips0Tx.wait());
await data.printState("After Owner Withdrawn Tips");

console.log(" --- Send Nix WETH Tip ---");
const sendNixWETHTip0Tx = await data.weth.connect(data.taker0Signer).transfer(data.nix.address, ethers.utils.parseEther("3.33"));
await data.printEvents("txFee Send Nix WETH Tip" , await sendNixWETHTip0Tx.wait());
await data.printState("After Send Nix WETH Tip");

console.log(" --- Owner Withdraw WETH Tips ---");
const ownerWithdrawWETHTips0Tx = await data.nix.connect(data.deployerSigner).withdraw(data.weth.address, 0, 0);
await data.printEvents("txFee Owner Withdrawn WETH Tips" , await ownerWithdrawWETHTips0Tx.wait());
await data.printState("After Owner Withdrawn WETH Tips");

console.log(" --- Taker0 Transfer NFTA To Nix For Donation ---");
const takerTransferNFTToNixTx = await data.nftA.connect(data.taker0Signer)["safeTransferFrom(address,address,uint256)"](data.taker0, data.nix.address, 3);
await data.printEvents("Taker0 Transfer NFTA To Nix For Donation" , await takerTransferNFTToNixTx.wait());
await data.printState("After Taker0 Transfer NFTA To Nix For Donation");

console.log(" --- Owner Withdraw NFT Tips ---");
const ownerWithdrawNFTTips1Tx = await data.nix.connect(data.deployerSigner).withdraw(data.nftA.address, 0, 3);
await data.printEvents("txFee Owner Withdrawn Tips" , await ownerWithdrawNFTTips1Tx.wait());
await data.printState("After Owner Withdrawn Tips");

});

it("99. Admin Test", async function () {
console.log(" 99. Admin Test");
console.log(" --- Send Nix ETH, WETH & NFT Tips ---");
Expand Down
18 changes: 8 additions & 10 deletions testIt.out
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
# Maker Taker Price B/S Any/All Expiry Tx Count Tx Max RoyFac% Status TokenIds
--- -------------- -------------- -------------------- ---- ------- ------------------------ -------- -------- -------- -------------------- -----------------------
0 maker0:0x7099 null:0x0000 11.0 Buy Any (none) 0 5 100 Executable [3,4,5]
1 maker0:0x7099 null:0x0000 0.0011 Buy Any 2022-01-02T04:48:23.000Z 0 5 100 Executable []
1 maker0:0x7099 null:0x0000 0.0011 Buy Any 2022-01-02T04:49:27.000Z 0 5 100 Executable []

Orders for NFTB:0xDc64, ordersLength: 1, executed: 0, volumeToken: 0, volumeWeth: 0.0
# Maker Taker Price B/S Any/All Expiry Tx Count Tx Max RoyFac% Status TokenIds
Expand Down Expand Up @@ -89,7 +89,7 @@
# Maker Taker Price B/S Any/All Expiry Tx Count Tx Max RoyFac% Status TokenIds
--- -------------- -------------- -------------------- ---- ------- ------------------------ -------- -------- -------- -------------------- -----------------------
0 maker0:0x7099 null:0x0000 11.0 Buy Any (none) 2 5 100 Executable [3,4,5]
1 maker0:0x7099 null:0x0000 0.0011 Buy Any 2022-01-02T04:48:23.000Z 1 5 100 Executable []
1 maker0:0x7099 null:0x0000 0.0011 Buy Any 2022-01-02T04:49:27.000Z 1 5 100 Executable []

Orders for NFTB:0xDc64, ordersLength: 1, executed: 0, volumeToken: 0, volumeWeth: 0.0
# Maker Taker Price B/S Any/All Expiry Tx Count Tx Max RoyFac% Status TokenIds
Expand Down Expand Up @@ -119,7 +119,7 @@
# Maker Taker Price B/S Any/All Expiry Tx Count Tx Max RoyFac% Status TokenIds
--- -------------- -------------- -------------------- ---- ------- ------------------------ -------- -------- -------- -------------------- -----------------------
0 maker0:0x7099 null:0x0000 11.0 Buy Any (none) 2 5 100 Executable [3,4,5]
1 maker0:0x7099 null:0x0000 0.0011 Buy Any 2022-01-02T04:48:23.000Z 1 5 100 Executable []
1 maker0:0x7099 null:0x0000 0.0011 Buy Any 2022-01-02T04:49:27.000Z 1 5 100 Executable []

Orders for NFTB:0xDc64, ordersLength: 1, executed: 0, volumeToken: 0, volumeWeth: 0.0
# Maker Taker Price B/S Any/All Expiry Tx Count Tx Max RoyFac% Status TokenIds
Expand All @@ -128,7 +128,7 @@

tradesLength: 1
trades: ["0x90F79bf6EB2c4f870365E785982E1f101E93b906","100","37","0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9,0,0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9,1"]
✓ 00. Maker BuyAny Test (802ms)
✓ 00. Maker BuyAny Test (838ms)
--- Setup Accounts, WETH, NFT and Nix Contracts ---
> txFee Deployed Nix - gasUsed: 5262032 ~ ETH 0.442010688 ~ USD 1649
> txFee Deployed NixHelper - gasUsed: 2466135 ~ ETH 0.20715534 ~ USD 772
Expand Down Expand Up @@ -206,7 +206,7 @@

tradesLength: 1
trades: ["0x90F79bf6EB2c4f870365E785982E1f101E93b906","100","71","0x09635F643e140090A9A8Dcd712eD6285858ceBef,0"]
✓ 01. Maker BuyAll Test (277ms)
✓ 01. Maker BuyAll Test (307ms)
--- Setup Accounts, WETH, NFT and Nix Contracts ---
> txFee Deployed Nix - gasUsed: 5262032 ~ ETH 0.442010688 ~ USD 1649
> txFee Deployed NixHelper - gasUsed: 2466135 ~ ETH 0.20715534 ~ USD 772
Expand Down Expand Up @@ -282,7 +282,7 @@

tradesLength: 1
trades: ["0x90F79bf6EB2c4f870365E785982E1f101E93b906","100","104","0x1291Be112d480055DaFd8a610b7d1e203891C274,0"]
✓ 02. Maker SellAny Test (324ms)
✓ 02. Maker SellAny Test (305ms)
--- Setup Accounts, WETH, NFT and Nix Contracts ---
> txFee Deployed Nix - gasUsed: 5262032 ~ ETH 0.442010688 ~ USD 1649
> txFee Deployed NixHelper - gasUsed: 2466135 ~ ETH 0.20715534 ~ USD 772
Expand Down Expand Up @@ -360,8 +360,7 @@

tradesLength: 1
trades: ["0x90F79bf6EB2c4f870365E785982E1f101E93b906","100","137","0xDC11f7E700A4c898AE5CAddB1082cFfa76512aDD,0"]
✓ 03. Maker SellAll Test (273ms)
- 04. Maker SellAll Test & Owner Withdraw Tips
✓ 03. Maker SellAll Test (272ms)
--- Setup Accounts, WETH, NFT and Nix Contracts ---
> txFee Deployed Nix - gasUsed: 5262032 ~ ETH 0.442010688 ~ USD 1649
> txFee Deployed NixHelper - gasUsed: 2466135 ~ ETH 0.20715534 ~ USD 772
Expand Down Expand Up @@ -431,9 +430,8 @@
--- Non-Owner Transfer Ownership ---
> Transfer Ownership - gasUsed: 28865 ~ ETH 0.00242466 ~ USD 9
+ Nix:0x5c74 179.0 OwnershipTransferred(from: deployer:0xf39F, to: taker0:0x90F7)
✓ 99. Admin Test (355ms)
✓ 99. Admin Test (358ms)


5 passing (7s)
1 pending

0 comments on commit 2e7e333

Please sign in to comment.