Skip to content

Commit

Permalink
test: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscotobar committed Feb 15, 2024
1 parent 93eb638 commit 5d9f414
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 110 deletions.
124 changes: 62 additions & 62 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions test/relayserver/RelayServer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1379,7 +1379,7 @@ describe('RelayServer', function () {

await expect(
relayServer.tokenHandler(wrongVerifierAddress)
).to.be.rejectedWith('supplied verifier is not trusted');
).to.be.rejectedWith('Supplied verifier is not trusted');
});

it('should return no tokens for verifiers when none were allowed', async function () {
Expand Down Expand Up @@ -1483,7 +1483,7 @@ describe('RelayServer', function () {

await expect(
relayServer.destinationContractHandler(wrongVerifierAddress)
).to.be.rejectedWith('supplied verifier is not trusted');
).to.be.rejectedWith('Supplied verifier is not trusted');
});

it('should return no contracts for verifiers when none were allowed', async function () {
Expand Down
46 changes: 0 additions & 46 deletions test/verifier/verifiers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -870,30 +870,6 @@ describe('Verifiers tests', function () {
let smartWalletFactory: MinimalBoltzSmartWalletFactory;
let smartWallet: MinimalBoltzSmartWallet;

async function prepareSmartWallet() {
const hardHatSmartWalletFactory = await hardhat.getContractFactory(
'MinimalBoltzSmartWallet'
);
const smartWalletTemplate = await hardHatSmartWalletFactory.deploy();

const hardHatSmartWalletFactoryFactory = await hardhat.getContractFactory(
'MinimalBoltzSmartWalletFactory'
);
smartWalletFactory = await hardHatSmartWalletFactoryFactory.deploy(
smartWalletTemplate.address
);

const smartWallet = await createSupportedSmartWallet({
relayHub: relayHub.address,
sender: relayHub,
owner,
factory: smartWalletFactory,
type: 'Default',
});

return smartWallet;
}

beforeEach(async function () {
const [, localRelayHub] = await hardhat.getSigners();
relayHub = localRelayHub as SignerWithAddress;
Expand Down Expand Up @@ -930,28 +906,6 @@ describe('Verifiers tests', function () {
});
});

it('Should fail if the factory is incorrect', async function () {
const wrongSmartWallet = await prepareSmartWallet();

const relayRequest = createEnvelopingRequest(
false,
{
relayHub: relayHub.address,
from: owner.address,
},
{
callForwarder: wrongSmartWallet.address,
callVerifier: relayVerifier.address,
}
) as RelayRequest;

const signature = '0x00';

await expect(
relayVerifier.verifyRelayedCall(relayRequest, signature)
).to.be.rejectedWith('SW different to template');
});

it('Should always fail', async function () {
const relayRequest = createEnvelopingRequest(
false,
Expand Down

0 comments on commit 5d9f414

Please sign in to comment.