Skip to content

Commit

Permalink
[Forta 1061] create account if missing when transferring pools (#242)
Browse files Browse the repository at this point in the history
* add subgraph readme

* create account entity if missing on transfer

* deploy to forta-b

* Revert "add subgraph readme"

This reverts commit 2d2f3bc.

---------

Co-authored-by: Robert Leonard <leaonrd.robert.h@gmail.com>
  • Loading branch information
Robert-H-Leonard and Robert Leonard committed Jun 30, 2023
1 parent 506274c commit 2ce2a41
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion subgraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"prepare": "yarn prepare:schema && yarn prepare:codegen && yarn prepare:compile",
"prepare-dev": "yarn prepare-dev:schema && yarn prepare-dev:codegen && yarn prepare-dev:compile",
"deploy-dev": "graph deploy --node https://api.graph-eu.p2pify.com/765768b776199f59bb7f1bf37253e73f/deploy --ipfs https://api.graph-eu.p2pify.com/765768b776199f59bb7f1bf37253e73f/ipfs forta-dev",
"deploy": "graph deploy --node https://api.graph-eu.p2pify.com/27e4e99c0f8ed6da77ddf942f20fe189/deploy --ipfs https://api.graph-eu.p2pify.com/27e4e99c0f8ed6da77ddf942f20fe189/ipfs forta-a",
"deploy": "graph deploy --node https://api.graph-eu.p2pify.com/3e3485fa2703678549290ce52f45ef9c/deploy --ipfs https://api.graph-eu.p2pify.com/3e3485fa2703678549290ce52f45ef9c/ipfs forta-b",
"create-local": "graph create --node http://localhost:8020/ forta-network/forta-network",
"remove-local": "graph remove --node http://localhost:8020/ forta-network/forta-network",
"deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 forta-network/forta-network",
Expand Down
2 changes: 1 addition & 1 deletion subgraph/src/datasources/ScannerPoolRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@ export function handleScannerEnabled(event: ScannerEnabledEvent): void {
export function handleTransfer(event: TransferEvent): void {
const scannerPoolId = event.params.tokenId;
const scannerPool = fetchScannerPool(scannerPoolId);
scannerPool.owner = event.params.to.toHexString();
scannerPool.owner = fetchAccount(event.params.to).id;
scannerPool.save();
}

0 comments on commit 2ce2a41

Please sign in to comment.