added test

This commit is contained in:
bhavik 2021-12-10 23:20:43 +05:30 committed by Ishan Jain
parent 6dce9ff07a
commit ec48612d22
2 changed files with 0 additions and 61 deletions

View File

@ -1,59 +0,0 @@
import axios from "axios";
import { childLogger } from "./logger";
const logger = childLogger("utils/api");
function getApi() {
const api = axios.create({});
api.interceptors.request.use(
(request) => {
logger.info({
msg: "Request to external API",
req: {
method: request.method,
url: request.url,
params: request.params,
headers: request.headers,
},
});
return request;
},
(error) => {
logger.error({ msg: "Error while requesting external API", error });
return Promise.reject(error);
}
);
api.interceptors.response.use(
(response) => {
logger.info({
msg: "Response from external API",
req: {
method: response.config.method,
url: response.config.url,
params: response.config.params,
},
res: {
statusCode: response.status,
statusText: response.statusText,
headers: response.config.headers,
data: response.data,
},
});
return response;
},
(error) => {
logger.error({ msg: "Error response from external API", error });
return Promise.reject(error);
}
);
return api;
}
export default getApi();

View File

@ -5,8 +5,6 @@ const { web3, deployments, waffle, ethers } = hre;
const { provider, deployContract } = waffle;
const BigNumber = require("bignumber.js");
// import axpi from "./api";
const deployAndEnableConnector = require("../../scripts/deployAndEnableConnector.js");
const buildDSAv2 = require("../../scripts/buildDSAv2");
const encodeSpells = require("../../scripts/encodeSpells.js");