Skip to content

Commit

Permalink
Manually merged fix #4
Browse files Browse the repository at this point in the history
  • Loading branch information
bokkypoobah committed Jan 5, 2022
1 parent 01bf55d commit c5618bd
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 100 deletions.
3 changes: 3 additions & 0 deletions contracts/Nix.sol
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ library ArrayUtils {
if (self[mid] < target) {
left = mid + 1;
} else if (self[mid] > target) {
if (mid < 1) {
break;
}
right = mid - 1;
} else {
return true;
Expand Down
1 change: 1 addition & 0 deletions test/00_test_0.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ describe("Nix", function () {
await expect(data.nix.connect(data.taker0Signer).executeOrders([data.nftA.address], [4], [[4]], ethers.utils.parseEther("11").mul(7).div(10), 100, data.integrator, { value: ethers.utils.parseEther("0.000001") })).to.be.revertedWith("OrderCanOnlyBeExecutedBySpecifiedTaker(4,");
await expect(data.nix.connect(data.taker0Signer).executeOrders([data.nftA.address], [0], [[6]], ethers.utils.parseEther("11").mul(7).div(10), 100, data.integrator, { value: ethers.utils.parseEther("0.000001") })).to.be.revertedWith("ERC721: operator query for nonexistent token");
await expect(data.nix.connect(data.taker0Signer).executeOrders([data.nftA.address], [0], [[7]], ethers.utils.parseEther("11").mul(7).div(10), 100, data.integrator, { value: ethers.utils.parseEther("0.000001") })).to.be.revertedWith("TokenIdNotFound(0, 7)");
await expect(data.nix.connect(data.taker0Signer).executeOrders([data.nftA.address], [0], [[2]], ethers.utils.parseEther("11").mul(7).div(10), 100, data.integrator, { value: ethers.utils.parseEther("0.000001") })).to.be.revertedWith("TokenIdNotFound(0, 2)");
await expect(data.nix.connect(data.taker0Signer).executeOrders([data.nftA.address], [5], [[3, 4]], ethers.utils.parseEther("11").mul(7).div(10), 100, data.integrator, { value: ethers.utils.parseEther("0.000001") })).to.be.revertedWith("TokenIdsMismatch(5, [3, 4, 5], [3, 4])");
await expect(data.nix.connect(data.taker0Signer).executeOrders([data.nftA.address], [5], [[3, 4, 5, 6]], ethers.utils.parseEther("11").mul(7).div(10), 100, data.integrator, { value: ethers.utils.parseEther("0.000001") })).to.be.revertedWith("TokenIdsMismatch(5, [3, 4, 5], [3, 4, 5, 6])");
await expect(data.nix.connect(data.taker0Signer).executeOrders([data.nftA.address], [6], [[3, 4, 5]], ethers.utils.parseEther("11").mul(7).div(10), 100, data.integrator, { value: ethers.utils.parseEther("0.000001") })).to.be.revertedWith("OrderMaxxed(6, 1, 0)");
Expand Down
Loading

0 comments on commit c5618bd

Please sign in to comment.