@reality.eth/graph 0.4.16 → 0.4.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
- # Reality.eth subgraph (incomplete)
1
+ # Reality.eth subgraph
2
2
 
3
- This is the subgraph for reality.eth. As of 2021-05-17, it is not yet completed or deployed.
3
+ This is the subgraph for reality.eth.
4
4
 
5
5
  It should be able to parse most templates correctly, but as we do not yet have a complete port of the sprintf-js library used by the dapp, we cannot guarantee the exact same handling of edge cases. We recommend that anywhere important, such as a page where you allow people to submit bonds, you do the template handling and formatting in JavaScript.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reality.eth/graph",
3
- "version": "0.4.16",
3
+ "version": "0.4.18",
4
4
  "scripts": {
5
5
  "create-local": "graph create realityeth/realityeth --node http://127.0.0.1:8020",
6
6
  "remove-local": "graph remove realityeth/realityeth --node http://127.0.0.1:8020",
@@ -46,11 +46,11 @@
46
46
  "@graphprotocol/graph-ts": "^0.20.0"
47
47
  },
48
48
  "dependencies": {
49
- "@reality.eth/contracts": "^3.0.14",
49
+ "@reality.eth/contracts": "^3.0.16",
50
50
  "babel-polyfill": "^6.26.0",
51
51
  "babel-register": "^6.26.0",
52
52
  "mustache": "^4.2.0",
53
53
  "truffle-hdwallet-provider": "^1.0.4"
54
54
  },
55
- "gitHead": "c455af927697dad5fc3f4ff76475a230e9cb93d4"
55
+ "gitHead": "bf4b54cd772d0763ab0a88ee631415d8ee90b2bb"
56
56
  }
package/src/mapping.ts CHANGED
@@ -107,7 +107,11 @@ export function handleNewQuestion(event: LogNewQuestion): void {
107
107
  for(let i = 0; i < q_outcomes.length; i++) {
108
108
  let outcomeID = contractQuestionId + '-' + i.toString();
109
109
  let outcome = new Outcome(outcomeID);
110
- outcome.answer = q_outcomes[i].toString()
110
+ if (q_outcomes[i].kind === JSONValueKind.STRING) {
111
+ outcome.answer = q_outcomes[i].toString()
112
+ } else {
113
+ outcome.answer = "[FORMATTING ERROR]";
114
+ }
111
115
  outcome.question = contractQuestionId;
112
116
  outcome.save()
113
117
  }
@@ -436,7 +440,7 @@ export function handleFactoryRealityETHDeploy(event: RealityETH_ERC20_deployed):
436
440
  let facdep = new FactoryDeployment(deploymentId)
437
441
  facdep.token_address = event.params.token;
438
442
  facdep.token_symbol = event.params.token_ticker;
439
- facdep.token_decimals = new BigInt(event.params.decimals);
443
+ facdep.token_decimals = BigInt.fromI32(event.params.decimals);
440
444
  facdep.realityETH = event.params.reality_eth;
441
445
  facdep.factory = event.address;
442
446
  facdep.createdBlock = event.block.number;
@@ -3,7 +3,7 @@ templates:
3
3
  name: FactoryCreatedRealityETH
4
4
  network: {{network}}
5
5
  source:
6
- abi: FactoryCreatedRealityETH
6
+ abi: RealityETH
7
7
  mapping:
8
8
  kind: ethereum/events
9
9
  apiVersion: 0.0.4
@@ -11,7 +11,7 @@ templates:
11
11
  entities:
12
12
  - Question
13
13
  abis:
14
- - name: FactoryCreatedRealityETH
14
+ - name: RealityETH
15
15
  file: ./node_modules/@reality.eth/contracts/abi/solc-0.8.6/RealityETH-all.abi.json
16
16
  eventHandlers:
17
17
  - event: LogNewTemplate(indexed uint256,indexed address,string)