Skip to content

Commit a2ddbac

Browse files
authored
handle zero values for publicPOI and blockNumber in action queue (#1150)
1 parent d3c1a7c commit a2ddbac

File tree

5 files changed

+26
-10
lines changed

5 files changed

+26
-10
lines changed

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
],
55
"npmClient": "yarn",
66
"useWorkspaces": true,
7-
"version": "0.25.0"
7+
"version": "0.25.2"
88
}

packages/indexer-agent/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@graphprotocol/indexer-agent",
3-
"version": "0.25.0",
3+
"version": "0.25.2",
44
"description": "Indexer agent",
55
"main": "./dist/index.js",
66
"types": "./dist/index.d.ts",
@@ -30,7 +30,7 @@
3030
},
3131
"dependencies": {
3232
"@graphprotocol/common-ts": "3.0.1",
33-
"@graphprotocol/indexer-common": "0.25.0",
33+
"@graphprotocol/indexer-common": "0.25.2",
3434
"@thi.ng/heaps": "^1.3.1",
3535
"axios": "0.26.1",
3636
"bs58": "5.0.0",

packages/indexer-cli/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@graphprotocol/indexer-cli",
3-
"version": "0.25.0",
3+
"version": "0.25.2",
44
"description": "Indexer CLI for The Graph Network",
55
"main": "./dist/cli.js",
66
"files": [
@@ -27,7 +27,7 @@
2727
},
2828
"dependencies": {
2929
"@graphprotocol/common-ts": "3.0.1",
30-
"@graphprotocol/indexer-common": "0.25.0",
30+
"@graphprotocol/indexer-common": "0.25.2",
3131
"@iarna/toml": "2.2.5",
3232
"@thi.ng/iterators": "5.1.74",
3333
"@urql/core": "3.1.0",

packages/indexer-cli/src/actions.ts

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,20 @@ export async function buildActionInput(
6161
if (poi == '0' || poi == '0x0') {
6262
poi = hexlify(new Uint8Array(32).fill(0))
6363
}
64+
let publicPOI = actionParams.param5
65+
if (publicPOI == '0' || publicPOI == '0x0') {
66+
publicPOI = hexlify(new Uint8Array(32).fill(0))
67+
}
68+
let poiBlockNumber: number | undefined = undefined
69+
if (actionParams.param4 !== undefined) {
70+
poiBlockNumber = Number(actionParams.param4)
71+
}
6472
return {
6573
deploymentID: actionParams.targetDeployment,
6674
allocationID: actionParams.param1,
6775
poi: poi,
68-
publicPOI: actionParams.param5,
69-
poiBlockNumber: actionParams.param4 ? Number(actionParams.param4) : undefined,
76+
publicPOI: publicPOI,
77+
poiBlockNumber: poiBlockNumber,
7078
force: actionParams.param3 === 'true',
7179
type,
7280
source,
@@ -82,13 +90,21 @@ export async function buildActionInput(
8290
if (poi == '0' || poi == '0x0') {
8391
poi = hexlify(new Uint8Array(32).fill(0))
8492
}
93+
let publicPOI = actionParams.param6
94+
if (publicPOI == '0' || publicPOI == '0x0') {
95+
publicPOI = hexlify(new Uint8Array(32).fill(0))
96+
}
97+
let poiBlockNumber: number | undefined = undefined
98+
if (actionParams.param5 !== undefined) {
99+
poiBlockNumber = Number(actionParams.param5)
100+
}
85101
return {
86102
deploymentID: actionParams.targetDeployment,
87103
allocationID: actionParams.param1,
88104
amount: actionParams.param2?.toString(),
89105
poi: poi,
90-
publicPOI: actionParams.param6,
91-
poiBlockNumber: actionParams.param5 ? Number(actionParams.param5) : undefined,
106+
publicPOI: publicPOI,
107+
poiBlockNumber: poiBlockNumber,
92108
force: actionParams.param4 === 'true',
93109
type,
94110
source,

packages/indexer-common/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@graphprotocol/indexer-common",
3-
"version": "0.25.0",
3+
"version": "0.25.2",
44
"description": "Common library for Graph Protocol indexer components",
55
"main": "./dist/index.js",
66
"types": "./dist/index.d.ts",

0 commit comments

Comments
 (0)