mirror of
https://github.com/alexgo-io/DefiLlama-Adapters.git
synced 2026-01-12 16:53:02 +08:00
monkey patch sdk.api.abi.call
This commit is contained in:
11
test.js
11
test.js
@@ -8,6 +8,7 @@ const {
|
||||
humanizeNumber,
|
||||
} = require("@defillama/sdk/build/computeTVL/humanizeNumber");
|
||||
const { util } = require("@defillama/sdk");
|
||||
const sdk = require("@defillama/sdk");
|
||||
const whitelistedExportKeys = require('./projects/helper/whitelistedExportKeys.json')
|
||||
const chainList = require('./projects/helper/chains.json')
|
||||
const handleError = require('./utils/handleError')
|
||||
@@ -99,6 +100,16 @@ if (process.argv.length < 3) {
|
||||
}
|
||||
const passedFile = path.resolve(process.cwd(), process.argv[2]);
|
||||
|
||||
const originalCall = sdk.api.abi.call
|
||||
sdk.api.abi.call = async (...args)=>{
|
||||
try{
|
||||
return await originalCall(...args)
|
||||
} catch(e){
|
||||
console.log("sdk.api.abi.call errored with params:", args)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
(async () => {
|
||||
let module = {};
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user