Skip to content

Commit

Permalink
test: added coverage for tokenAirdrop to a smart contract
Browse files Browse the repository at this point in the history
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
  • Loading branch information
quiet-node committed Nov 12, 2024
1 parent 99af572 commit 35a5d31
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,25 @@ describe.only('HRC904Contract Test Suite', function () {
expect(receipt.status).to.eq(1);
});

it('should revert for tokenAirdrop to a smart contract', async function () {
try {
const tx = await airdropContract.tokenAirdrop(
tokenAddress,
signers[0].address,
tokenCreateContract.target,
1,
{
gasLimit: 2_000_000,
value: 100_000,
}
);
await tx.wait();
expect.fail('Should revert');
} catch (error) {
expect(error.code).to.eq(Constants.CALL_EXCEPTION);
}
});

it('should be able to airdrop any token in its balance based on token address', async function () {
const tx = await airdropContract.tokenAirdrop(
tokenAddress,
Expand Down

0 comments on commit 35a5d31

Please sign in to comment.