Skip to content

Commit

Permalink
refactor: test
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscotobar committed Jan 24, 2024
1 parent 5883604 commit efb016c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/RelayServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ export class RelayServer extends EventEmitter {
tokenContract != constants.AddressZero
) {
verifierContract = IDeployVerifier__factory.connect(verifier, provider);
} else {
} else if (!isDeployTransaction(envelopingTransaction)) {
verifierContract = IRelayVerifier__factory.connect(verifier, provider);
}
} catch (e) {
Expand All @@ -361,23 +361,26 @@ export class RelayServer extends EventEmitter {

try {
let verifyMethod: PopulatedTransaction;
if (isDeployTransaction(envelopingTransaction)) {
if (
isDeployTransaction(envelopingTransaction) &&
tokenContract != constants.AddressZero
) {
verifyMethod = await (
verifierContract as IDeployVerifier
verifierContract! as IDeployVerifier

Check warning on line 369 in src/RelayServer.ts

View workflow job for this annotation

GitHub Actions / linting_and_testing

Forbidden non-null assertion
).populateTransaction.verifyRelayedCall(
envelopingTransaction.relayRequest,
envelopingTransaction.metadata.signature,
{ from: this.workerAddress }
);
} else {
} else if (!isDeployTransaction(envelopingTransaction)) {
verifyMethod = await (
verifierContract as IRelayVerifier
verifierContract! as IRelayVerifier

Check warning on line 377 in src/RelayServer.ts

View workflow job for this annotation

GitHub Actions / linting_and_testing

Forbidden non-null assertion
).populateTransaction.verifyRelayedCall(
envelopingTransaction.relayRequest as RelayRequest,
envelopingTransaction.metadata.signature
);
}
await provider.call(verifyMethod, 'pending');
await provider.call(verifyMethod!, 'pending');

Check warning on line 383 in src/RelayServer.ts

View workflow job for this annotation

GitHub Actions / linting_and_testing

Forbidden non-null assertion
} catch (e) {
const error = e as Error;
throw new Error(`Verification by verifier failed: ${error.message}`);
Expand Down

0 comments on commit efb016c

Please sign in to comment.