Skip to content

Commit ef73205

Browse files
committed
chore: rabbit-feedback
1 parent a13274c commit ef73205

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FACTORY_ADDRESS=0x4296b39059b8591d4f22a0fc4ee49508279b8fc6
22
BATCH_WITHDRAW_ADDRESS=0xA32942798112e561d4d3ffc62c552bb0E9651b66
3-
PROVIDER_URL=https://kovan.infura.io/v3/<secret-key>
3+
PROVIDER_URL=https://rpc.gnosis.gateway.fm
44
LBATCH_WITHDRAW_ADDRESS=0x13c5E321cdF37e3736470bbC6E8DD95015D7B9E3
55
# envio indexer url
66
GTCR_SUBGRAPH_URL=https://indexer.hyperindex.xyz/abcabc/v1/graphql

src/light-gtcr-execution.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,17 @@ import _LightGeneralizedTCR from "./assets/LightGeneralizedTCR.json";
77

88
async function run(signer: ethers.Wallet) {
99
console.info(`Checking for pending requests.`.green);
10+
11+
const chainId = Number(process.env.GTCR_SUBGRAPH_CHAIN_ID);
12+
if (isNaN(chainId)) {
13+
console.error(`Invalid GTCR_SUBGRAPH_CHAIN_ID. Must be a number.`.red);
14+
return;
15+
}
16+
1017
const subgraphQuery = {
1118
query: `
1219
{
13-
lrequests: LRequest(where: { resolved: {_eq: false}, disputed: {_eq: false}, chainId: {_eq: ${process.env.GTCR_SUBGRAPH_CHAIN_ID}} }, limit: 1000) {
20+
lrequests: LRequest(where: { resolved: {_eq: false}, disputed: {_eq: false}, chainId: {_eq: ${chainId}} }, limit: 1000) {
1421
submissionTime
1522
item {
1623
itemID

src/light-gtcr-withdrawal.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,17 @@ import _LightBatchWidthdraw from "./assets/LightBatchWithdraw.json";
66

77
async function run(batchWithdraw: ethers.Contract, signer: ethers.Wallet) {
88
console.info(`Checking for pending withdrawals.`.yellow);
9+
10+
const chainId = Number(process.env.GTCR_SUBGRAPH_CHAIN_ID);
11+
if (isNaN(chainId)) {
12+
console.error(`Invalid GTCR_SUBGRAPH_CHAIN_ID. Must be a number.`.red);
13+
return;
14+
}
15+
916
const subgraphQuery = {
1017
query: `
1118
{
12-
lcontributions: LContribution(where: { withdrawable: {_eq :true}, chainId: {_eq: ${process.env.GTCR_SUBGRAPH_CHAIN_ID}} }) {
19+
lcontributions: LContribution(where: { withdrawable: {_eq :true}, chainId: {_eq: ${chainId}} }) {
1320
id
1421
contributor
1522
}

0 commit comments

Comments
 (0)