Browse Source

Add remaining bounty events

Theophile Sandoz 3 years ago
parent
commit
e9e7938766
2 changed files with 275 additions and 1 deletions
  1. 32 1
      query-node/schemas/bounty.graphql
  2. 243 0
      query-node/schemas/bountyEvents.graphql

+ 32 - 1
query-node/schemas/bounty.graphql

@@ -103,8 +103,20 @@ type Bounty @entity {
   "The event the bounty was created in"
   createdInEvent: BountyCreatedEvent! @derivedFrom(field: "bounty")
 
-  "Event emitted if a bounty reached its maximum funding amount"
+  "Event emitted if the bounty is canceled"
+  canceledEvent: BountyCanceledEvent @derivedFrom(field: "bounty")
+
+  "Event emitted if the bounty is vetoed"
+  vetoedEvent: BountyVetoedEvent @derivedFrom(field: "bounty")
+
+  "Event emitted if the bounty reached its maximum funding amount"
   maxFundingReachedEvent: BountyMaxFundingReachedEvent @derivedFrom(field: "bounty")
+
+  "Event emitted when the bounty is removed (i.e terminated)"
+  removedInEvent: BountyRemovedEvent @derivedFrom(field: "bounty")
+
+  "Event emitted if the oracle judged the bounty work entries"
+  judgement: OracleJudgmentSubmittedEvent @derivedFrom(field: "bounty")
 }
 
 "Initial status during creation in Working Period."
@@ -184,8 +196,17 @@ type BountyEntry @entity {
   "The event the work entry was created in"
   announcedInEvent: WorkEntryAnnouncedEvent! @derivedFrom(field: "entry")
 
+  "Event emitted if the entry is withdrawn"
+  withdrawnInEvent: WorkEntryWithdrawnEvent @derivedFrom(field: "entry")
+
+  "Event emitted if the entry is withdrawn"
+  slashedInEvent: WorkEntrySlashedEvent @derivedFrom(field: "entry")
+
   "All of the submitted work events"
   works: [WorkSubmittedEvent] @derivedFrom(field: "entry")
+
+  "Event emitted if the entrant cashed out stake and/or share of bounty reward"
+  cashedOutInEvent: WorkEntrantFundsWithdrawnEvent @derivedFrom(field: "entry")
 }
 
 type BountyContribution @entity {
@@ -200,4 +221,14 @@ type BountyContribution @entity {
 
   "Amount of the contribution"
   amount: BigInt!
+
+  # Events
+  "The event the contribution was created in"
+  createdInEvent: BountyFundedEvent! @derivedFrom(field: "contribution")
+
+  "Event emitted if the bounty reached its maximum funding amount"
+  maxFundingReachedEvent: BountyMaxFundingReachedEvent @derivedFrom(field: "contribution")
+
+  "Event emitted if the contribution is withdrawn"
+  withdrawnInEvent: BountyFundingWithdrawalEvent @derivedFrom(field: "contribution")
 }

+ 243 - 0
query-node/schemas/bountyEvents.graphql

@@ -22,6 +22,78 @@ type BountyCreatedEvent implements Event @entity {
   bounty: Bounty!
 }
 
+type BountyCanceledEvent implements Event @entity {
+  ### GENERIC DATA ###
+
+  "(network}-{blockNumber}-{indexInBlock}"
+  id: ID!
+
+  "Hash of the extrinsic which caused the event to be emitted"
+  inExtrinsic: String
+
+  "Blocknumber of the block in which the event was emitted."
+  inBlock: Int!
+
+  "Network the block was produced in"
+  network: Network!
+
+  "Index of event in block from which it was emitted."
+  indexInBlock: Int!
+
+  ### SPECIFIC DATA ###
+
+  "Related bounty"
+  bounty: Bounty!
+}
+
+type BountyVetoedEvent implements Event @entity {
+  ### GENERIC DATA ###
+
+  "(network}-{blockNumber}-{indexInBlock}"
+  id: ID!
+
+  "Hash of the extrinsic which caused the event to be emitted"
+  inExtrinsic: String
+
+  "Blocknumber of the block in which the event was emitted."
+  inBlock: Int!
+
+  "Network the block was produced in"
+  network: Network!
+
+  "Index of event in block from which it was emitted."
+  indexInBlock: Int!
+
+  ### SPECIFIC DATA ###
+
+  "Related bounty"
+  bounty: Bounty!
+}
+
+type BountyFundedEvent implements Event @entity {
+  ### GENERIC DATA ###
+
+  "(network}-{blockNumber}-{indexInBlock}"
+  id: ID!
+
+  "Hash of the extrinsic which caused the event to be emitted"
+  inExtrinsic: String
+
+  "Blocknumber of the block in which the event was emitted."
+  inBlock: Int!
+
+  "Network the block was produced in"
+  network: Network!
+
+  "Index of event in block from which it was emitted."
+  indexInBlock: Int!
+
+  ### SPECIFIC DATA ###
+
+  "Related bounty contribution"
+  contribution: BountyContribution!
+}
+
 type BountyMaxFundingReachedEvent implements Event @entity {
   ### GENERIC DATA ###
 
@@ -44,6 +116,81 @@ type BountyMaxFundingReachedEvent implements Event @entity {
 
   "Related bounty"
   bounty: Bounty!
+
+  "Related bounty contribution"
+  contribution: BountyContribution!
+}
+
+type BountyFundingWithdrawalEvent implements Event @entity {
+  ### GENERIC DATA ###
+
+  "(network}-{blockNumber}-{indexInBlock}"
+  id: ID!
+
+  "Hash of the extrinsic which caused the event to be emitted"
+  inExtrinsic: String
+
+  "Blocknumber of the block in which the event was emitted."
+  inBlock: Int!
+
+  "Network the block was produced in"
+  network: Network!
+
+  "Index of event in block from which it was emitted."
+  indexInBlock: Int!
+
+  ### SPECIFIC DATA ###
+
+  "Related bounty contribution"
+  contribution: BountyContribution!
+}
+
+type BountyCreatorCherryWithdrawalEvent implements Event @entity {
+  ### GENERIC DATA ###
+
+  "(network}-{blockNumber}-{indexInBlock}"
+  id: ID!
+
+  "Hash of the extrinsic which caused the event to be emitted"
+  inExtrinsic: String
+
+  "Blocknumber of the block in which the event was emitted."
+  inBlock: Int!
+
+  "Network the block was produced in"
+  network: Network!
+
+  "Index of event in block from which it was emitted."
+  indexInBlock: Int!
+
+  ### SPECIFIC DATA ###
+
+  "Related bounty"
+  bounty: Bounty!
+}
+
+type BountyRemovedEvent implements Event @entity {
+  ### GENERIC DATA ###
+
+  "(network}-{blockNumber}-{indexInBlock}"
+  id: ID!
+
+  "Hash of the extrinsic which caused the event to be emitted"
+  inExtrinsic: String
+
+  "Blocknumber of the block in which the event was emitted."
+  inBlock: Int!
+
+  "Network the block was produced in"
+  network: Network!
+
+  "Index of event in block from which it was emitted."
+  indexInBlock: Int!
+
+  ### SPECIFIC DATA ###
+
+  "Related bounty"
+  bounty: Bounty!
 }
 
 type WorkEntryAnnouncedEvent implements Event @entity {
@@ -70,6 +217,54 @@ type WorkEntryAnnouncedEvent implements Event @entity {
   entry: BountyEntry!
 }
 
+type WorkEntryWithdrawnEvent implements Event @entity {
+  ### GENERIC DATA ###
+
+  "(network}-{blockNumber}-{indexInBlock}"
+  id: ID!
+
+  "Hash of the extrinsic which caused the event to be emitted"
+  inExtrinsic: String
+
+  "Blocknumber of the block in which the event was emitted."
+  inBlock: Int!
+
+  "Network the block was produced in"
+  network: Network!
+
+  "Index of event in block from which it was emitted."
+  indexInBlock: Int!
+
+  ### SPECIFIC DATA ###
+
+  "Related work entry"
+  entry: BountyEntry!
+}
+
+type WorkEntrySlashedEvent implements Event @entity {
+  ### GENERIC DATA ###
+
+  "(network}-{blockNumber}-{indexInBlock}"
+  id: ID!
+
+  "Hash of the extrinsic which caused the event to be emitted"
+  inExtrinsic: String
+
+  "Blocknumber of the block in which the event was emitted."
+  inBlock: Int!
+
+  "Network the block was produced in"
+  network: Network!
+
+  "Index of event in block from which it was emitted."
+  indexInBlock: Int!
+
+  ### SPECIFIC DATA ###
+
+  "Related work entry"
+  entry: BountyEntry!
+}
+
 type WorkSubmittedEvent implements Event @entity {
   ### GENERIC DATA ###
 
@@ -99,3 +294,51 @@ type WorkSubmittedEvent implements Event @entity {
   "Description which contains the work itself as a URL, a BLOB, or just text"
   description: String!
 }
+
+type OracleJudgmentSubmittedEvent implements Event @entity {
+  ### GENERIC DATA ###
+
+  "(network}-{blockNumber}-{indexInBlock}"
+  id: ID!
+
+  "Hash of the extrinsic which caused the event to be emitted"
+  inExtrinsic: String
+
+  "Blocknumber of the block in which the event was emitted."
+  inBlock: Int!
+
+  "Network the block was produced in"
+  network: Network!
+
+  "Index of event in block from which it was emitted."
+  indexInBlock: Int!
+
+  ### SPECIFIC DATA ###
+
+  "Related bounty"
+  bounty: Bounty!
+}
+
+type WorkEntrantFundsWithdrawnEvent implements Event @entity {
+  ### GENERIC DATA ###
+
+  "(network}-{blockNumber}-{indexInBlock}"
+  id: ID!
+
+  "Hash of the extrinsic which caused the event to be emitted"
+  inExtrinsic: String
+
+  "Blocknumber of the block in which the event was emitted."
+  inBlock: Int!
+
+  "Network the block was produced in"
+  network: Network!
+
+  "Index of event in block from which it was emitted."
+  indexInBlock: Int!
+
+  ### SPECIFIC DATA ###
+
+  "Related work entry"
+  entry: BountyEntry!
+}