Skip to content

Commit

Permalink
Fix config check
Browse files Browse the repository at this point in the history
  • Loading branch information
prevostc committed Sep 4, 2024
1 parent 4b96d50 commit 0eee1f0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ src/config.ts
src/random.ts
random.json

tests/.latest.json
tests/.latest.json

*.log
17 changes: 9 additions & 8 deletions bin/check-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,26 +270,27 @@ async function main() {
// check for missing holder counts
const missingHolderCounts: BeefyVault[] = []
for (const vault of allConfigs) {
const subgraphchain = vault.chain === "avax" ? "avalanche" : vault.chain === "one" ? "harmony" : vault.chain
const level = vault.eol ? "ERROR" : "WARN"
if (!countsPerToken[`${vault.chain}:${vault.vault_address}`]) {
console.error(`${level}: Missing holder count for ${vault.id} with address ${vault.chain}:${vault.vault_address}`)
if (!countsPerToken[`${subgraphchain}:${vault.vault_address}`]) {
console.error(`${level}: Missing holder count for ${vault.id} with address ${subgraphchain}:${vault.vault_address}`)
missingHolderCounts.push(vault)
}
if (vault.protocol_type === "beefy_clm_vault") {
if (!countsPerToken[`${vault.chain}:${vault.beefy_clm_manager.vault_address}`]) {
console.error(`${level}: Missing holder count for ${vault.id} with CLM address ${vault.chain}:${vault.beefy_clm_manager.vault_address}`)
if (!countsPerToken[`${subgraphchain}:${vault.beefy_clm_manager.vault_address}`]) {
console.error(`${level}: Missing holder count for ${vault.id} with CLM address ${subgraphchain}:${vault.beefy_clm_manager.vault_address}`)
missingHolderCounts.push(vault)
}
}
for (const pool of vault.reward_pools) {
if (!countsPerToken[`${vault.chain}:${pool.clm_address}`]) {
console.error(`${level}: Missing holder count for ${vault.id}'s Reward Pool with address ${vault.chain}:${pool.clm_address}`)
if (!countsPerToken[`${subgraphchain}:${pool.clm_address}`]) {
console.error(`${level}: Missing holder count for ${vault.id}'s Reward Pool with address ${subgraphchain}:${pool.reward_pool_address}`)
missingHolderCounts.push(vault)
}
}
for (const boost of vault.boosts) {
if (!countsPerToken[`${vault.chain}:${boost.underlying_address}`]) {
console.error(`${level}: Missing holder count for ${vault.id}'s BOOST with address ${vault.chain}:${boost.underlying_address}`)
if (!countsPerToken[`${subgraphchain}:${boost.underlying_address}`]) {
console.error(`${level}: Missing holder count for ${vault.id}'s BOOST with address ${subgraphchain}:${boost.boost_address}`)
missingHolderCounts.push(vault)
}
}
Expand Down

0 comments on commit 0eee1f0

Please sign in to comment.