diff --git a/packages/subgraph/build/schema.graphql b/packages/subgraph/build/schema.graphql index 9ef60f5..716004f 100644 --- a/packages/subgraph/build/schema.graphql +++ b/packages/subgraph/build/schema.graphql @@ -11,7 +11,6 @@ type Bounty @entity { creator: Bytes! isActive: Boolean! submissions: [Submission!] @derivedFrom(field: "bounty") - completed: Boolean! numAcceptedSubmissions: BigInt! } @@ -42,4 +41,3 @@ type User @entity { depositCount: BigInt! paymentReceivedCount: BigInt! } - diff --git a/packages/subgraph/package.json b/packages/subgraph/package.json index 8cbd572..6bbefb4 100644 --- a/packages/subgraph/package.json +++ b/packages/subgraph/package.json @@ -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", diff --git a/packages/subgraph/src/mapping.ts b/packages/subgraph/src/mapping.ts index 794f8a1..38dfaa2 100644 --- a/packages/subgraph/src/mapping.ts +++ b/packages/subgraph/src/mapping.ts @@ -13,7 +13,7 @@ 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; @@ -21,6 +21,7 @@ export function handleBountyCreated(event: BountyCreated): void { bounty.creator = event.params.creator; bounty.creationBlock = event.block.number; bounty.isActive = true; + bounty.numAcceptedSubmissions = BigInt.fromI32(1) ; bounty.save(); } diff --git a/packages/subgraph/src/schema.graphql b/packages/subgraph/src/schema.graphql index 39c14a8..716004f 100644 --- a/packages/subgraph/src/schema.graphql +++ b/packages/subgraph/src/schema.graphql @@ -11,7 +11,6 @@ type Bounty @entity { creator: Bytes! isActive: Boolean! submissions: [Submission!] @derivedFrom(field: "bounty") - completed: Boolean! numAcceptedSubmissions: BigInt! }