Skip to content

Commit d572603

Browse files
Merge pull request #28 from kleros/chore/envio-query-migration
chore: migrate-to-envio-query
2 parents fdadbec + da4840c commit d572603

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

.env.example

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
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
5-
GTCR_SUBGRAPH_URL=https://api.thegraph.com/subgraphs/name/eccentricexit/light-curate-kovan-ii
5+
# envio indexer url
6+
GTCR_SUBGRAPH_URL=https://indexer.hyperindex.xyz/abcabc/v1/graphql
7+
# Chain id to filter GTCR/LGTCR items
8+
GTCR_SUBGRAPH_CHAIN_ID=100
69

710
# How often to check if items passed the challenge period without challenges.
811
# The minimum value accepted is 2 * BLOCK_TIME_SECONDS / 60.

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(where: { resolved: false, disputed: false }, first: 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(where: { withdrawable: true }) {
19+
lcontributions: LContribution(where: { withdrawable: {_eq: true}, chainId: {_eq: ${chainId}} }) {
1320
id
1421
contributor
1522
}

0 commit comments

Comments
 (0)