Skip to content

Commit

Permalink
Change API.ContractVerification, use VerificationResults
Browse files Browse the repository at this point in the history
  • Loading branch information
emiliorizzo committed Jan 29, 2021
1 parent 0f52294 commit 58a808a
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/api/modules/ContractVerification.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ import { EVMversions } from '../../lib/types'

export class ContractVerification extends DataCollectorItem {
constructor (collections, name) {
const { ContractVerification, VerificationsResults } = collections
const { ContractVerification } = collections
super(ContractVerification, name)
this.verificationsCollection = VerificationsResults
this.publicActions = {
/**
* @swagger
Expand All @@ -27,9 +26,7 @@ export class ContractVerification extends DataCollectorItem {
* $ref: '#/responses/NotFound'
*/
getVerifiedContracts: (params) => {
params.fields = { address: 1 }
let query = { match: true }
return this.getPageData(query, params)
return this.parent.getModule('VerificationResults').run('getResults', params)
},
/**
* @swagger
Expand Down Expand Up @@ -163,9 +160,7 @@ export class ContractVerification extends DataCollectorItem {
* $ref: '#/responses/NotFound'
*/
isVerified: async (params) => {
const { address } = params
const data = await this.verificationsCollection.findOne({ address })
return { data }
return this.parent.getModule('VerificationResults').run('getVerification', params)
}
}
}
Expand Down

0 comments on commit 58a808a

Please sign in to comment.