Skip to content

Commit

Permalink
Fixed promises that were not resolving on time (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
aritkulova authored Aug 5, 2024
1 parent 485c99a commit f0443c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
7 changes: 2 additions & 5 deletions test/finance/vesting/Vesting.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,11 @@ describe("Vesting", () => {
vestingAmount: vestingAmount * 2n,
};

const linearTx = vesting.createVesting(linearVesting);
const exponentialTx = vesting.createVesting(exponentialVesting);

await expect(linearTx)
await expect(vesting.createVesting(linearVesting))
.to.emit(vesting, "VestingCreated")
.withArgs(1, linearVesting.beneficiary, linearVesting.vestingToken);

await expect(exponentialTx)
await expect(vesting.createVesting(exponentialVesting))
.to.emit(vesting, "VestingCreated")
.withArgs(2, exponentialVesting.beneficiary, exponentialVesting.vestingToken);

Expand Down
8 changes: 4 additions & 4 deletions test/libs/data-structures/SparseMerkleTree.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,10 @@ describe("SparseMerkleTree", () => {
await merkleTree.addUint(hexKey, key);
}

expect(merkleTree.removeUint(ethers.toBeHex(8, 32))).to.be.revertedWith(
await expect(merkleTree.removeUint(ethers.toBeHex(8, 32))).to.be.revertedWith(
"SparseMerkleTree: the node does not exist",
);
expect(merkleTree.removeUint(ethers.toBeHex(9, 32))).to.be.revertedWith(
await expect(merkleTree.removeUint(ethers.toBeHex(9, 32))).to.be.revertedWith(
"SparseMerkleTree: the leaf does not match",
);
});
Expand Down Expand Up @@ -328,10 +328,10 @@ describe("SparseMerkleTree", () => {
await merkleTree.addUint(hexKey, key);
}

expect(merkleTree.updateUint(ethers.toBeHex(8, 32), 1n)).to.be.revertedWith(
await expect(merkleTree.updateUint(ethers.toBeHex(8, 32), 1n)).to.be.revertedWith(
"SparseMerkleTree: the node does not exist",
);
expect(merkleTree.updateUint(ethers.toBeHex(9, 32), 1n)).to.be.revertedWith(
await expect(merkleTree.updateUint(ethers.toBeHex(9, 32), 1n)).to.be.revertedWith(
"SparseMerkleTree: the leaf does not match",
);
});
Expand Down

0 comments on commit f0443c5

Please sign in to comment.