Skip to content

Commit

Permalink
gettin graph to work final
Browse files Browse the repository at this point in the history
  • Loading branch information
fala13 committed Jun 1, 2024
1 parent 9272dac commit 8ca14c7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 0 additions & 2 deletions packages/subgraph/build/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ type Bounty @entity {
creator: Bytes!
isActive: Boolean!
submissions: [Submission!] @derivedFrom(field: "bounty")
completed: Boolean!
numAcceptedSubmissions: BigInt!
}

Expand Down Expand Up @@ -42,4 +41,3 @@ type User @entity {
depositCount: BigInt!
paymentReceivedCount: BigInt!
}

8 changes: 4 additions & 4 deletions packages/subgraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"abi-copy": "node --loader ts-node/esm --experimental-specifier-resolution=node scripts/abi_copy.ts",
"codegen": "graph codegen",
"build": "graph build",
"deploy": "graph deploy --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ GITHUB_USERNAME/your-contract",
"local-create": "graph create --node http://localhost:8020/ scaffold-eth/your-contract",
"local-remove": "graph remove --node http://localhost:8020/ scaffold-eth/your-contract",
"local-deploy": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 scaffold-eth/your-contract",
"deploy": "graph deploy --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ GITHUB_USERNAME/think2earn",
"local-create": "graph create --node http://localhost:8020/ scaffold-eth/think2earn",
"local-remove": "graph remove --node http://localhost:8020/ scaffold-eth/think2earn",
"local-deploy": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 scaffold-eth/think2earn",
"local-ship": "yarn abi-copy && yarn codegen && yarn build --network localhost && yarn local-deploy",
"test": "graph test",
"run-node": "cd graph-node && docker-compose up",
Expand Down
3 changes: 2 additions & 1 deletion packages/subgraph/src/mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ export function handleBountyCreated(event: BountyCreated): void {
let bounty = new Bounty(event.params.bountyId.toString());
bounty.name = event.params.name;
bounty.description = event.params.description;
bounty.mediaURIHash = event.params.mediaURIHash;
bounty.mediaURIHash = event.params.mediaURI;
bounty.reward = event.params.reward;
bounty.duration = event.params.duration;
bounty.judgeTime = event.params.judgeTime;
bounty.maxProgress = event.params.maxProgress;
bounty.creator = event.params.creator;
bounty.creationBlock = event.block.number;
bounty.isActive = true;
bounty.numAcceptedSubmissions = BigInt.fromI32(1) ;

bounty.save();
}
Expand Down
1 change: 0 additions & 1 deletion packages/subgraph/src/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ type Bounty @entity {
creator: Bytes!
isActive: Boolean!
submissions: [Submission!] @derivedFrom(field: "bounty")
completed: Boolean!
numAcceptedSubmissions: BigInt!
}

Expand Down

0 comments on commit 8ca14c7

Please sign in to comment.