Skip to content

Commit 37d6645

Browse files
authored
Merge pull request #24 from kleros/fix/add-query-headers
fix: add-headers-for-subgraph-fetch-query
2 parents b271c4f + 91a831d commit 37d6645

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/light-gtcr-execution.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ async function run(signer: ethers.Wallet) {
2929
response = await fetch(process.env.GTCR_SUBGRAPH_URL, {
3030
method: "POST",
3131
body: JSON.stringify(subgraphQuery),
32+
headers: {
33+
"Content-Type": "application/json",
34+
},
3235
});
3336

3437
const parsed = await response.json();
@@ -76,7 +79,10 @@ async function run(signer: ethers.Wallet) {
7679
`Executing request for item ID ${request.item.itemID}`.green
7780
);
7881
// pass gas requirement manually for arbitrum rinkeby compatibility
79-
await tcr.executeRequest(request.item.itemID, { nonce, gasLimit: 2_100_000 });
82+
await tcr.executeRequest(request.item.itemID, {
83+
nonce,
84+
gasLimit: 2_100_000,
85+
});
8086
await delay(120 * 1000); // Wait 2 minutes to give time for the chain to sync/nonce handling.
8187
} catch (error) {
8288
console.error(

src/light-gtcr-withdrawal.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ async function run(batchWithdraw: ethers.Contract, signer: ethers.Wallet) {
2323
response = await fetch(process.env.GTCR_SUBGRAPH_URL, {
2424
method: "POST",
2525
body: JSON.stringify(subgraphQuery),
26+
headers: {
27+
"Content-Type": "application/json",
28+
},
2629
});
2730

2831
const parsed = await response.json();

0 commit comments

Comments
 (0)