Skip to content

Commit

Permalink
Improve test and fix wrong imports
Browse files Browse the repository at this point in the history
  • Loading branch information
k06a committed Mar 15, 2024
1 parent c7b9d54 commit 1669daf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
13 changes: 8 additions & 5 deletions test/contracts/BySig.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { constants, expect } from '../../src/prelude';
import { constants } from '../../src/prelude';
import { expect } from '../../src/expect';
import { loadFixture } from '@nomicfoundation/hardhat-network-helpers';
import { ethers } from 'hardhat';
import { NonceType, buildBySigTraits } from './BySigTraits.test';
Expand Down Expand Up @@ -133,7 +134,7 @@ describe('BySig', function () {
// await expect(token.bySig(alice, sig, '0x')).to.be.revertedWithCustomError(token, 'WrongNonce');
});

it.only('should work', async function () {
it('should work for transfer method', async function () {
const { addrs: { alice, bob }, token } = await loadFixture(deployAddressArrayMock);
await token.mint(bob.address, 1000);

Expand All @@ -146,9 +147,11 @@ describe('BySig', function () {
{ SignedCall: [{ name: 'traits', type: 'uint256' }, { name: 'data', type: 'bytes' }] },
signedCall
);
await token.bySig(bob, signedCall, signature);
// expect(await token.balanceOf(bob.address)).to.be.equal(900);
// expect(await token.balanceOf(alice.address)).to.be.equal('100');
await expect(token.bySig(bob, signedCall, signature))
.to.emit(token, 'Transfer')
.withArgs(bob.address, alice.address, 100);
expect(await token.balanceOf(bob)).to.be.equal(900);
expect(await token.balanceOf(alice)).to.be.equal(100);
});
});

Expand Down
3 changes: 2 additions & 1 deletion test/contracts/BySigTraits.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect, constants } from '../../src/prelude';
import { constants } from '../../src/prelude';
import { expect } from '../../src/expect';
import { loadFixture } from '@nomicfoundation/hardhat-network-helpers';
import { ethers } from 'hardhat';

Expand Down

0 comments on commit 1669daf

Please sign in to comment.