mirror of
https://github.com/cerc-io/watcher-ts
synced 2025-04-23 14:51:16 +00:00
Fixes in eden watcher after comparing with generated watcher (#96)
This commit is contained in:
parent
e883463aa6
commit
7a4d0b6bb4
@ -31,7 +31,6 @@
|
|||||||
"@apollo/client": "^3.3.19",
|
"@apollo/client": "^3.3.19",
|
||||||
"@ethersproject/providers": "5.3.0",
|
"@ethersproject/providers": "5.3.0",
|
||||||
"@ipld/dag-cbor": "^6.0.12",
|
"@ipld/dag-cbor": "^6.0.12",
|
||||||
"@vulcanize/cache": "^0.1.0",
|
|
||||||
"@vulcanize/ipld-eth-client": "^0.1.0",
|
"@vulcanize/ipld-eth-client": "^0.1.0",
|
||||||
"@vulcanize/solidity-mapper": "^0.1.0",
|
"@vulcanize/solidity-mapper": "^0.1.0",
|
||||||
"@vulcanize/util": "^0.1.0",
|
"@vulcanize/util": "^0.1.0",
|
||||||
@ -43,10 +42,7 @@
|
|||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"graphql": "^15.5.0",
|
"graphql": "^15.5.0",
|
||||||
"graphql-import-node": "^0.0.4",
|
"graphql-import-node": "^0.0.4",
|
||||||
"ipfs-http-client": "^53.0.1",
|
|
||||||
"json-bigint": "^1.0.0",
|
"json-bigint": "^1.0.0",
|
||||||
"lodash": "^4.17.21",
|
|
||||||
"multiformats": "^9.4.8",
|
|
||||||
"reflect-metadata": "^0.1.13",
|
"reflect-metadata": "^0.1.13",
|
||||||
"typeorm": "^0.2.32",
|
"typeorm": "^0.2.32",
|
||||||
"yargs": "^17.0.1",
|
"yargs": "^17.0.1",
|
||||||
|
@ -59,14 +59,12 @@
|
|||||||
|
|
||||||
* Generating state:
|
* Generating state:
|
||||||
|
|
||||||
* Edit the custom hook function `createInitialCheckpoint` (triggered on watch-contract, checkpoint: `true`) in [hooks.ts](./src/hooks.ts) to save an initial checkpoint `IPLDBlock` using the `Indexer` object.
|
* Edit the custom hook function `createInitialState` (triggered if the watcher passes the start block, checkpoint: `true`) in [hooks.ts](./src/hooks.ts) to save an initial state `IPLDBlock` using the `Indexer` object.
|
||||||
|
|
||||||
* Edit the custom hook function `createStateDiff` (triggered on a block) in [hooks.ts](./src/hooks.ts) to save the state in a `diff` `IPLDBlock` using the `Indexer` object. The default state (if exists) is updated.
|
* Edit the custom hook function `createStateDiff` (triggered on a block) in [hooks.ts](./src/hooks.ts) to save the state in a `diff` `IPLDBlock` using the `Indexer` object. The default state (if exists) is updated.
|
||||||
|
|
||||||
* Edit the custom hook function `createStateCheckpoint` (triggered just before default and CLI checkpoint) in [hooks.ts](./src/hooks.ts) to save the state in a `checkpoint` `IPLDBlock` using the `Indexer` object.
|
* Edit the custom hook function `createStateCheckpoint` (triggered just before default and CLI checkpoint) in [hooks.ts](./src/hooks.ts) to save the state in a `checkpoint` `IPLDBlock` using the `Indexer` object.
|
||||||
|
|
||||||
* The existing example hooks in [hooks.ts](./src/hooks.ts) are for an `ERC20` contract.
|
|
||||||
|
|
||||||
## Run
|
## Run
|
||||||
|
|
||||||
* Run the watcher:
|
* Run the watcher:
|
||||||
|
@ -31,7 +31,6 @@
|
|||||||
"@apollo/client": "^3.3.19",
|
"@apollo/client": "^3.3.19",
|
||||||
"@ethersproject/providers": "5.3.0",
|
"@ethersproject/providers": "5.3.0",
|
||||||
"@ipld/dag-cbor": "^6.0.12",
|
"@ipld/dag-cbor": "^6.0.12",
|
||||||
"@vulcanize/cache": "^0.1.0",
|
|
||||||
"@vulcanize/ipld-eth-client": "^0.1.0",
|
"@vulcanize/ipld-eth-client": "^0.1.0",
|
||||||
"@vulcanize/solidity-mapper": "^0.1.0",
|
"@vulcanize/solidity-mapper": "^0.1.0",
|
||||||
"@vulcanize/util": "^0.1.0",
|
"@vulcanize/util": "^0.1.0",
|
||||||
@ -43,10 +42,7 @@
|
|||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"graphql": "^15.5.0",
|
"graphql": "^15.5.0",
|
||||||
"graphql-import-node": "^0.0.4",
|
"graphql-import-node": "^0.0.4",
|
||||||
"ipfs-http-client": "^53.0.1",
|
|
||||||
"json-bigint": "^1.0.0",
|
"json-bigint": "^1.0.0",
|
||||||
"lodash": "^4.17.21",
|
|
||||||
"multiformats": "^9.4.8",
|
|
||||||
"reflect-metadata": "^0.1.13",
|
"reflect-metadata": "^0.1.13",
|
||||||
"typeorm": "^0.2.32",
|
"typeorm": "^0.2.32",
|
||||||
"yargs": "^17.0.1",
|
"yargs": "^17.0.1",
|
||||||
|
@ -67,6 +67,70 @@ query events($blockHash: String!, $contractAddress: String!, $name: String){
|
|||||||
withdrawer
|
withdrawer
|
||||||
withdrawalAmount
|
withdrawalAmount
|
||||||
}
|
}
|
||||||
|
... on ApprovalForAllEvent {
|
||||||
|
owner
|
||||||
|
operator
|
||||||
|
approved
|
||||||
|
}
|
||||||
|
... on BlockProducerAddedEvent {
|
||||||
|
producer
|
||||||
|
}
|
||||||
|
... on BlockProducerRemovedEvent {
|
||||||
|
producer
|
||||||
|
}
|
||||||
|
... on BlockProducerRewardCollectorChangedEvent {
|
||||||
|
producer
|
||||||
|
collector
|
||||||
|
}
|
||||||
|
... on RewardScheduleChangedEvent {
|
||||||
|
dummy
|
||||||
|
}
|
||||||
|
... on ClaimedEvent {
|
||||||
|
index
|
||||||
|
totalEarned
|
||||||
|
account
|
||||||
|
claimed
|
||||||
|
}
|
||||||
|
... on SlashedEvent {
|
||||||
|
account
|
||||||
|
slashed
|
||||||
|
}
|
||||||
|
... on MerkleRootUpdatedEvent {
|
||||||
|
merkleRoot
|
||||||
|
distributionNumber
|
||||||
|
metadataURI
|
||||||
|
}
|
||||||
|
... on AccountUpdatedEvent {
|
||||||
|
account
|
||||||
|
totalClaimed
|
||||||
|
totalSlashed
|
||||||
|
}
|
||||||
|
... on PermanentURIEvent {
|
||||||
|
value
|
||||||
|
id
|
||||||
|
}
|
||||||
|
... on GovernanceChangedEvent {
|
||||||
|
from
|
||||||
|
to
|
||||||
|
}
|
||||||
|
... on UpdateThresholdChangedEvent {
|
||||||
|
updateThreshold
|
||||||
|
}
|
||||||
|
... on RoleAdminChangedEvent {
|
||||||
|
role
|
||||||
|
previousAdminRole
|
||||||
|
newAdminRole
|
||||||
|
}
|
||||||
|
... on RoleGrantedEvent {
|
||||||
|
role
|
||||||
|
account
|
||||||
|
sender
|
||||||
|
}
|
||||||
|
... on RoleRevokedEvent {
|
||||||
|
role
|
||||||
|
account
|
||||||
|
sender
|
||||||
|
}
|
||||||
}
|
}
|
||||||
proof{
|
proof{
|
||||||
data
|
data
|
||||||
|
@ -67,6 +67,70 @@ query eventsInRange($fromBlockNumber: Int!, $toBlockNumber: Int!){
|
|||||||
withdrawer
|
withdrawer
|
||||||
withdrawalAmount
|
withdrawalAmount
|
||||||
}
|
}
|
||||||
|
... on ApprovalForAllEvent {
|
||||||
|
owner
|
||||||
|
operator
|
||||||
|
approved
|
||||||
|
}
|
||||||
|
... on BlockProducerAddedEvent {
|
||||||
|
producer
|
||||||
|
}
|
||||||
|
... on BlockProducerRemovedEvent {
|
||||||
|
producer
|
||||||
|
}
|
||||||
|
... on BlockProducerRewardCollectorChangedEvent {
|
||||||
|
producer
|
||||||
|
collector
|
||||||
|
}
|
||||||
|
... on RewardScheduleChangedEvent {
|
||||||
|
dummy
|
||||||
|
}
|
||||||
|
... on ClaimedEvent {
|
||||||
|
index
|
||||||
|
totalEarned
|
||||||
|
account
|
||||||
|
claimed
|
||||||
|
}
|
||||||
|
... on SlashedEvent {
|
||||||
|
account
|
||||||
|
slashed
|
||||||
|
}
|
||||||
|
... on MerkleRootUpdatedEvent {
|
||||||
|
merkleRoot
|
||||||
|
distributionNumber
|
||||||
|
metadataURI
|
||||||
|
}
|
||||||
|
... on AccountUpdatedEvent {
|
||||||
|
account
|
||||||
|
totalClaimed
|
||||||
|
totalSlashed
|
||||||
|
}
|
||||||
|
... on PermanentURIEvent {
|
||||||
|
value
|
||||||
|
id
|
||||||
|
}
|
||||||
|
... on GovernanceChangedEvent {
|
||||||
|
from
|
||||||
|
to
|
||||||
|
}
|
||||||
|
... on UpdateThresholdChangedEvent {
|
||||||
|
updateThreshold
|
||||||
|
}
|
||||||
|
... on RoleAdminChangedEvent {
|
||||||
|
role
|
||||||
|
previousAdminRole
|
||||||
|
newAdminRole
|
||||||
|
}
|
||||||
|
... on RoleGrantedEvent {
|
||||||
|
role
|
||||||
|
account
|
||||||
|
sender
|
||||||
|
}
|
||||||
|
... on RoleRevokedEvent {
|
||||||
|
role
|
||||||
|
account
|
||||||
|
sender
|
||||||
|
}
|
||||||
}
|
}
|
||||||
proof{
|
proof{
|
||||||
data
|
data
|
||||||
|
@ -67,6 +67,70 @@ subscription onEvent{
|
|||||||
withdrawer
|
withdrawer
|
||||||
withdrawalAmount
|
withdrawalAmount
|
||||||
}
|
}
|
||||||
|
... on ApprovalForAllEvent {
|
||||||
|
owner
|
||||||
|
operator
|
||||||
|
approved
|
||||||
|
}
|
||||||
|
... on BlockProducerAddedEvent {
|
||||||
|
producer
|
||||||
|
}
|
||||||
|
... on BlockProducerRemovedEvent {
|
||||||
|
producer
|
||||||
|
}
|
||||||
|
... on BlockProducerRewardCollectorChangedEvent {
|
||||||
|
producer
|
||||||
|
collector
|
||||||
|
}
|
||||||
|
... on RewardScheduleChangedEvent {
|
||||||
|
dummy
|
||||||
|
}
|
||||||
|
... on ClaimedEvent {
|
||||||
|
index
|
||||||
|
totalEarned
|
||||||
|
account
|
||||||
|
claimed
|
||||||
|
}
|
||||||
|
... on SlashedEvent {
|
||||||
|
account
|
||||||
|
slashed
|
||||||
|
}
|
||||||
|
... on MerkleRootUpdatedEvent {
|
||||||
|
merkleRoot
|
||||||
|
distributionNumber
|
||||||
|
metadataURI
|
||||||
|
}
|
||||||
|
... on AccountUpdatedEvent {
|
||||||
|
account
|
||||||
|
totalClaimed
|
||||||
|
totalSlashed
|
||||||
|
}
|
||||||
|
... on PermanentURIEvent {
|
||||||
|
value
|
||||||
|
id
|
||||||
|
}
|
||||||
|
... on GovernanceChangedEvent {
|
||||||
|
from
|
||||||
|
to
|
||||||
|
}
|
||||||
|
... on UpdateThresholdChangedEvent {
|
||||||
|
updateThreshold
|
||||||
|
}
|
||||||
|
... on RoleAdminChangedEvent {
|
||||||
|
role
|
||||||
|
previousAdminRole
|
||||||
|
newAdminRole
|
||||||
|
}
|
||||||
|
... on RoleGrantedEvent {
|
||||||
|
role
|
||||||
|
account
|
||||||
|
sender
|
||||||
|
}
|
||||||
|
... on RoleRevokedEvent {
|
||||||
|
role
|
||||||
|
account
|
||||||
|
sender
|
||||||
|
}
|
||||||
}
|
}
|
||||||
proof{
|
proof{
|
||||||
data
|
data
|
||||||
|
@ -92,8 +92,8 @@ type SlotClaimedEvent {
|
|||||||
slot: Int!
|
slot: Int!
|
||||||
owner: String!
|
owner: String!
|
||||||
delegate: String!
|
delegate: String!
|
||||||
newBidAmount: Int!
|
newBidAmount: BigInt!
|
||||||
oldBidAmount: Int!
|
oldBidAmount: BigInt!
|
||||||
taxNumerator: Int!
|
taxNumerator: Int!
|
||||||
taxDenominator: Int!
|
taxDenominator: Int!
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user