Skip to content

Commit

Permalink
apply linters
Browse files Browse the repository at this point in the history
  • Loading branch information
mortelli committed Jun 4, 2021
1 parent dcf366a commit e1a938a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/common/ContractInteractor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export default class ContractInteractor {
return await this.IDeployVerifierContract.at(address)
}

async createTokenHandler(address: Address): Promise<ITokenHandlerInstance> {
async createTokenHandler (address: Address): Promise<ITokenHandlerInstance> {
return await this.ITokenHandlerContract.at(address)
}

Expand Down
2 changes: 1 addition & 1 deletion src/common/VerifierResponse.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Address } from "../relayclient/types/Aliases";
import { Address } from '../relayclient/types/Aliases'

export default interface VerifierResponse {
trustedVerifiers: Address[]
Expand Down
20 changes: 10 additions & 10 deletions src/relayserver/RelayServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ import { configureServer, ServerConfigParams, ServerDependencies } from './Serve
import { constants } from '../common/Constants'
import { DeployRequest, RelayRequest } from '../common/EIP712/RelayRequest'
import TokenResponse from '../common/TokenResponse'
import VerifierResponse from '../common/VerifierResponse'

import Timeout = NodeJS.Timeout
import VerifierResponse from '../common/VerifierResponse'

const VERSION = '2.0.1'
const PARAMETERS_COST = 43782
Expand Down Expand Up @@ -115,24 +115,24 @@ export class RelayServer extends EventEmitter {
}

async tokenHandler (verifier: Address): Promise<TokenResponse> {
let verifiersToQuery : Address[]
let verifiersToQuery: Address[]

// if a verifier was supplied, check that it is trusted
if (verifier){
if (!this.trustedVerifiers.has(verifier.toLowerCase())){
throw new Error("supplied verifier is not trusted")
if (verifier !== undefined) {
if (!this.trustedVerifiers.has(verifier.toLowerCase())) {
throw new Error('supplied verifier is not trusted')
}
verifiersToQuery = [verifier]
}else{
} else {
// if no verifier was supplied, query all tursted verifiers
verifiersToQuery = Array.from(this.trustedVerifiers) as Address[]
}

let res: TokenResponse = {}
for (const verifier of verifiersToQuery){
const res: TokenResponse = {}
for (const verifier of verifiersToQuery) {
const tokenHandlerInstance = await this.contractInteractor.createTokenHandler(verifier)
const acceptedTokens = await tokenHandlerInstance.contract.methods.getAcceptedTokens().call();
res[verifier] = acceptedTokens
const acceptedTokens = await tokenHandlerInstance.contract.methods.getAcceptedTokens().call()
res[verifier] = acceptedTokens
};

return res
Expand Down

0 comments on commit e1a938a

Please sign in to comment.