Skip to content

Commit

Permalink
log only if there is failed calls (#66)
Browse files Browse the repository at this point in the history
* log only if there is failed calls

* 2.3.91
  • Loading branch information
g1nt0ki committed Aug 18, 2022
1 parent 486c645 commit 0f3379f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@defillama/sdk",
"version": "2.3.90",
"version": "2.3.91",
"description": "SDK for calculating TVL",
"main": "build/index.js",
"scripts": {
Expand Down
5 changes: 3 additions & 2 deletions src/abi/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,9 @@ export async function multiCall(params: {
.sort(([c1, i1], [c2, i2])=>i1-i2).map(([c, i])=>c)
) as any[]

if(process.env.SDK_DEBUG === "true"){
console.log("Failed multicalls:", flatResults.filter(r => !r.success).map(r=>r.input))
const failedQueries = flatResults.filter(r => !r.success)
if(failedQueries.length && (process.env.SDK_DEBUG === "true" || process.env.LLAMA_DEBUG_MODE)){
console.log("Failed multicalls:", failedQueries.map(r=>r.input))
}

if (params.requery === true && flatResults.some(r => !r.success)) {
Expand Down
4 changes: 3 additions & 1 deletion src/abi/multicall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ function multicallAddress(chainId: number) {
case 19: // songbird
case 1030: // conflux
case 333999: // polis
case 7700: // canto
case 62621: // multivac
return "0x18fA376d92511Dd04090566AB6144847c03557d8";
case 2222:
return "0x30A62aA52Fa099C4B227869EB6aeaDEda054d121" // kava
Expand All @@ -243,7 +245,7 @@ function multicallAddress(chainId: number) {
case 820: // callisto
case 199: // bittorrent
return "0xB2fB6dA40DF36CcFFDc3B0F99df4871C7b86FCe7"
case 568: // dogechain
case 2000: // dogechain
return "0x8856C24Ba82F737CFb99Ec4785CEe4d48A842F33"
default:
return null;
Expand Down
2 changes: 1 addition & 1 deletion src/general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export const providers = {
jfin: createProvider("jfin", "https://rpc.jfinchain.com/", 3501),
bitkub: createProvider("bitkub", "https://rpc.bitkubchain.io/", 96),
canto: createProvider("canto", "https://jsonrpc.canto.nodestake.top,https://canto.evm.chandrastation.com/", 7700),
dogechain: createProvider("dogechain", "https://rpc01-sg.dogechain.dog,https://rpc02-sg.dogechain.dog,https://rpc03-sg.dogechain.dog", 568),
dogechain: createProvider("dogechain", "https://rpc01-sg.dogechain.dog,https://rpc02-sg.dogechain.dog,https://rpc03-sg.dogechain.dog", 2000),
} as {
[chain: string]: ethers.providers.BaseProvider;
};
Expand Down

0 comments on commit 0f3379f

Please sign in to comment.