Skip to content

Commit

Permalink
Merge pull request #24 from kleros/fix/add-query-headers
Browse files Browse the repository at this point in the history
fix: add-headers-for-subgraph-fetch-query
  • Loading branch information
salgozino authored Jun 4, 2024
2 parents b271c4f + 91a831d commit 37d6645
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/light-gtcr-execution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ async function run(signer: ethers.Wallet) {
response = await fetch(process.env.GTCR_SUBGRAPH_URL, {
method: "POST",
body: JSON.stringify(subgraphQuery),
headers: {
"Content-Type": "application/json",
},
});

const parsed = await response.json();
Expand Down Expand Up @@ -76,7 +79,10 @@ async function run(signer: ethers.Wallet) {
`Executing request for item ID ${request.item.itemID}`.green
);
// pass gas requirement manually for arbitrum rinkeby compatibility
await tcr.executeRequest(request.item.itemID, { nonce, gasLimit: 2_100_000 });
await tcr.executeRequest(request.item.itemID, {
nonce,
gasLimit: 2_100_000,
});
await delay(120 * 1000); // Wait 2 minutes to give time for the chain to sync/nonce handling.
} catch (error) {
console.error(
Expand Down
3 changes: 3 additions & 0 deletions src/light-gtcr-withdrawal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ async function run(batchWithdraw: ethers.Contract, signer: ethers.Wallet) {
response = await fetch(process.env.GTCR_SUBGRAPH_URL, {
method: "POST",
body: JSON.stringify(subgraphQuery),
headers: {
"Content-Type": "application/json",
},
});

const parsed = await response.json();
Expand Down

0 comments on commit 37d6645

Please sign in to comment.