Skip to content
This repository has been archived by the owner on Jul 8, 2021. It is now read-only.

Commit

Permalink
fix(proxy): reset the proxy handler of axios (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
clearloop authored Sep 15, 2020
1 parent 17946fb commit f1fb407
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": false,
"name": "@darwinia/dj",
"version": "0.2.3-beta.2",
"version": "0.2.4-alpha.2",
"description": "Darwinia bridge relayer tool",
"homepage": "https://github.com/darwinia-network/dj",
"repository": {
Expand Down
11 changes: 10 additions & 1 deletion src/api/shadow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ import {
IEthereumHeaderThingWithProof,
} from "../types";

/// Disable Proxy
process.env.HTTP_PROXY = ""
process.env.HTTPS_PROXY = ""
process.env.http_proxy = ""
process.env.https_proxy = ""

/**
* Shadow APIs
*
Expand All @@ -16,7 +22,7 @@ import {
export class ShadowAPI {
constructor(api: string) {
axios.defaults.baseURL = api;
axios.defaults.proxy = false;
// axios.defaults.proxy = false;
}

/**
Expand Down Expand Up @@ -62,6 +68,9 @@ export class ShadowAPI {
last_leaf: number,
): Promise<IEthereumHeaderThingWithProof> {
log.event(`Fetching proposal of ${target}`);
if (member === undefined) {
member = 0;
}
const r: any = await axios.post("/eth/proposal", {
member,
target,
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function check(arg: string): boolean {
/// Run and exit
async function cmdOnce(): Promise<boolean> {
if (check("--version")) {
console.log(whereisPj());
console.log(whereisPj().version);
return true;
} else if (check("-h") || check("--help")) {
console.log("dj: illegal option -- -");
Expand Down
10 changes: 9 additions & 1 deletion src/util/static/types.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,11 @@
"header_hash": "H256"
},
"EthereumReceiptProofThing": "(EthereumHeader, EthereumReceiptProof, MMRProof)",
"MMRProof": "Vec<H256>",
"MMRProof": {
"member_leaf_index": "u64",
"last_leaf_index": "u64",
"proof": "Vec<H256>"
},
"__[pallet.claims]__": {},
"OtherSignature": {
"_enum": {
Expand Down Expand Up @@ -226,5 +230,9 @@
},
"StakingRuntimeDispatchInfo": {
"power": "Power"
},
"ConfirmedEthereumHeaderInfo": {
"header": "EthereumHeader",
"mmr_root": "H256"
}
}

0 comments on commit f1fb407

Please sign in to comment.