Skip to content

Commit

Permalink
fix: rollback comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-bisonai committed Feb 7, 2024
1 parent 15373ae commit ec2c658
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 62 deletions.
42 changes: 21 additions & 21 deletions cli/src/delegator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,28 +298,28 @@ export function reporterListHandler() {
try {
const endpoint = buildUrl(ORAKL_NETWORK_DELEGATOR_URL, `reporter`)
const result = (await axios.get(endpoint)).data
// const printResult: any[] = []

// const aggregatorUrl = new URL(AGGREGATOR_ENDPOINT)
// const aggregatorResult = (await axios.get(aggregatorUrl.toString())).data

// for (const reporter of result) {
// if (!reporter.contract) {
// printResult.push({ ...reporter })
// continue
// }

// const aggregator = aggregatorResult.find(
// (aggregator) => aggregator.address === reporter.contract[0]
// )
// if (aggregator) {
// printResult.push({ ...reporter, name: aggregator.name })
// } else {
// printResult.push({ ...reporter })
// }
// }

console.log(result)
const printResult: any[] = []

Check warning on line 302 in cli/src/delegator.ts

View workflow job for this annotation

GitHub Actions / build-publish

Unexpected any. Specify a different type
const aggregatorUrl = new URL(AGGREGATOR_ENDPOINT)
const aggregatorResult = (await axios.get(aggregatorUrl.toString())).data

for (const reporter of result) {
if (!reporter.contract) {
printResult.push({ ...reporter })
continue
}

const aggregator = aggregatorResult.find(
(aggregator) => aggregator.address === reporter.contract[0]
)
if (aggregator) {
printResult.push({ ...reporter, name: aggregator.name })
} else {
printResult.push({ ...reporter })
}
}

console.log(printResult)
return result
} catch (e) {
console.error('Delegator Reporter was not listed. Reason:')
Expand Down
41 changes: 20 additions & 21 deletions cli/src/listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,28 +126,27 @@ export function listHandler(print?: boolean) {

try {
const result = (await axios.get(LISTENER_ENDPOINT, { data: { chain, service } }))?.data
// const printResult: any[] = []

// const aggregatorUrl = new URL(AGGREGATOR_ENDPOINT)
// const aggregatorResult = (await axios.get(aggregatorUrl.toString())).data
const printResult: any[] = []

Check warning on line 129 in cli/src/listener.ts

View workflow job for this annotation

GitHub Actions / build-publish

Unexpected any. Specify a different type
const aggregatorUrl = new URL(AGGREGATOR_ENDPOINT)
const aggregatorResult = (await axios.get(aggregatorUrl.toString())).data
if (print) {
// for (const listener of result) {
// if (listener.service != 'DATA_FEED') {
// printResult.push({ ...listener })
// continue
// }

// const aggregator = aggregatorResult.find(
// (aggregator) => aggregator.address === listener.address
// )
// if (aggregator) {
// printResult.push({ ...listener, name: aggregator.name })
// } else {
// printResult.push({ ...listener })
// }
// }

console.dir(result, { depth: null })
for (const listener of result) {
if (listener.service != 'DATA_FEED') {
printResult.push({ ...listener })
continue
}

const aggregator = aggregatorResult.find(
(aggregator) => aggregator.address === listener.address
)
if (aggregator) {
printResult.push({ ...listener, name: aggregator.name })
} else {
printResult.push({ ...listener })
}
}

console.dir(printResult, { depth: null })
}
return result
} catch (e) {
Expand Down
40 changes: 20 additions & 20 deletions cli/src/reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,28 +149,28 @@ export function listHandler(print?: boolean) {

try {
const result = (await axios.get(REPORTER_ENDPOINT, { data: { chain, service } }))?.data
// const printResult: any[] = []

// const aggregatorUrl = new URL(AGGREGATOR_ENDPOINT)
// const aggregatorResult = (await axios.get(aggregatorUrl.toString())).data
const printResult: any[] = []

Check warning on line 153 in cli/src/reporter.ts

View workflow job for this annotation

GitHub Actions / build-publish

Unexpected any. Specify a different type
const aggregatorUrl = new URL(AGGREGATOR_ENDPOINT)
const aggregatorResult = (await axios.get(aggregatorUrl.toString())).data
if (print) {
// for (const reporter of result) {
// if (reporter.service != 'DATA_FEED') {
// printResult.push({ ...reporter })
// continue
// }

// const aggregator = aggregatorResult.find(
// (aggregator) => aggregator.address === reporter.oracleAddress
// )
// if (aggregator) {
// printResult.push({ ...reporter, name: aggregator.name })
// } else {
// printResult.push({ ...reporter })
// }
// }

console.dir(result, { depth: null })
for (const reporter of result) {
if (reporter.service != 'DATA_FEED') {
printResult.push({ ...reporter })
continue
}

const aggregator = aggregatorResult.find(
(aggregator) => aggregator.address === reporter.oracleAddress
)
if (aggregator) {
printResult.push({ ...reporter, name: aggregator.name })
} else {
printResult.push({ ...reporter })
}
}

console.dir(printResult, { depth: null })
}
return result
} catch (e) {
Expand Down

0 comments on commit ec2c658

Please sign in to comment.