Skip to content

Commit

Permalink
Merge pull request #938 from rainlanguage/2024-10-12-debug-subgraph
Browse files Browse the repository at this point in the history
fix subgraph bugs
  • Loading branch information
thedavidmeister authored Oct 13, 2024
2 parents 1021da7 + 2fcefd1 commit 3a336d7
Show file tree
Hide file tree
Showing 17 changed files with 547 additions and 183 deletions.
296 changes: 296 additions & 0 deletions crates/subgraph/schema/orderbook.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,55 @@ input Block_height {

scalar Bytes

type Clear implements TradeEvent {
id: Bytes!
"""
Alice input amount
"""
aliceInputAmount: BigInt!
"""
Alice output amount
"""
aliceOutputAmount: BigInt!
"""
Bob input amount
"""
bobInputAmount: BigInt!
"""
Bob output amount
"""
bobOutputAmount: BigInt!
"""
Alice bounty amount
"""
aliceBountyAmount: BigInt!
"""
Bob bounty amount
"""
bobBountyAmount: BigInt!
aliceBountyVaultBalanceChange: ClearBounty
bobBountyVaultBalanceChange: ClearBounty
"""
The orderbook this trade event is for
"""
orderbook: Orderbook!
"""
The trades that occured in this event
"""
trades(
skip: Int = 0
first: Int = 100
orderBy: Trade_orderBy
orderDirection: OrderDirection
where: Trade_filter
): [Trade!]!
transaction: Transaction!
"""
The msg.sender of this trade
"""
sender: Bytes!
}

type ClearBounty implements VaultBalanceChange {
id: Bytes!
"""
Expand Down Expand Up @@ -513,6 +562,201 @@ enum ClearTemporaryData_orderBy {
bobBounty
}

input Clear_filter {
id: Bytes
id_not: Bytes
id_gt: Bytes
id_lt: Bytes
id_gte: Bytes
id_lte: Bytes
id_in: [Bytes!]
id_not_in: [Bytes!]
id_contains: Bytes
id_not_contains: Bytes
aliceInputAmount: BigInt
aliceInputAmount_not: BigInt
aliceInputAmount_gt: BigInt
aliceInputAmount_lt: BigInt
aliceInputAmount_gte: BigInt
aliceInputAmount_lte: BigInt
aliceInputAmount_in: [BigInt!]
aliceInputAmount_not_in: [BigInt!]
aliceOutputAmount: BigInt
aliceOutputAmount_not: BigInt
aliceOutputAmount_gt: BigInt
aliceOutputAmount_lt: BigInt
aliceOutputAmount_gte: BigInt
aliceOutputAmount_lte: BigInt
aliceOutputAmount_in: [BigInt!]
aliceOutputAmount_not_in: [BigInt!]
bobInputAmount: BigInt
bobInputAmount_not: BigInt
bobInputAmount_gt: BigInt
bobInputAmount_lt: BigInt
bobInputAmount_gte: BigInt
bobInputAmount_lte: BigInt
bobInputAmount_in: [BigInt!]
bobInputAmount_not_in: [BigInt!]
bobOutputAmount: BigInt
bobOutputAmount_not: BigInt
bobOutputAmount_gt: BigInt
bobOutputAmount_lt: BigInt
bobOutputAmount_gte: BigInt
bobOutputAmount_lte: BigInt
bobOutputAmount_in: [BigInt!]
bobOutputAmount_not_in: [BigInt!]
aliceBountyAmount: BigInt
aliceBountyAmount_not: BigInt
aliceBountyAmount_gt: BigInt
aliceBountyAmount_lt: BigInt
aliceBountyAmount_gte: BigInt
aliceBountyAmount_lte: BigInt
aliceBountyAmount_in: [BigInt!]
aliceBountyAmount_not_in: [BigInt!]
bobBountyAmount: BigInt
bobBountyAmount_not: BigInt
bobBountyAmount_gt: BigInt
bobBountyAmount_lt: BigInt
bobBountyAmount_gte: BigInt
bobBountyAmount_lte: BigInt
bobBountyAmount_in: [BigInt!]
bobBountyAmount_not_in: [BigInt!]
aliceBountyVaultBalanceChange: String
aliceBountyVaultBalanceChange_not: String
aliceBountyVaultBalanceChange_gt: String
aliceBountyVaultBalanceChange_lt: String
aliceBountyVaultBalanceChange_gte: String
aliceBountyVaultBalanceChange_lte: String
aliceBountyVaultBalanceChange_in: [String!]
aliceBountyVaultBalanceChange_not_in: [String!]
aliceBountyVaultBalanceChange_contains: String
aliceBountyVaultBalanceChange_contains_nocase: String
aliceBountyVaultBalanceChange_not_contains: String
aliceBountyVaultBalanceChange_not_contains_nocase: String
aliceBountyVaultBalanceChange_starts_with: String
aliceBountyVaultBalanceChange_starts_with_nocase: String
aliceBountyVaultBalanceChange_not_starts_with: String
aliceBountyVaultBalanceChange_not_starts_with_nocase: String
aliceBountyVaultBalanceChange_ends_with: String
aliceBountyVaultBalanceChange_ends_with_nocase: String
aliceBountyVaultBalanceChange_not_ends_with: String
aliceBountyVaultBalanceChange_not_ends_with_nocase: String
aliceBountyVaultBalanceChange_: ClearBounty_filter
bobBountyVaultBalanceChange: String
bobBountyVaultBalanceChange_not: String
bobBountyVaultBalanceChange_gt: String
bobBountyVaultBalanceChange_lt: String
bobBountyVaultBalanceChange_gte: String
bobBountyVaultBalanceChange_lte: String
bobBountyVaultBalanceChange_in: [String!]
bobBountyVaultBalanceChange_not_in: [String!]
bobBountyVaultBalanceChange_contains: String
bobBountyVaultBalanceChange_contains_nocase: String
bobBountyVaultBalanceChange_not_contains: String
bobBountyVaultBalanceChange_not_contains_nocase: String
bobBountyVaultBalanceChange_starts_with: String
bobBountyVaultBalanceChange_starts_with_nocase: String
bobBountyVaultBalanceChange_not_starts_with: String
bobBountyVaultBalanceChange_not_starts_with_nocase: String
bobBountyVaultBalanceChange_ends_with: String
bobBountyVaultBalanceChange_ends_with_nocase: String
bobBountyVaultBalanceChange_not_ends_with: String
bobBountyVaultBalanceChange_not_ends_with_nocase: String
bobBountyVaultBalanceChange_: ClearBounty_filter
orderbook: String
orderbook_not: String
orderbook_gt: String
orderbook_lt: String
orderbook_gte: String
orderbook_lte: String
orderbook_in: [String!]
orderbook_not_in: [String!]
orderbook_contains: String
orderbook_contains_nocase: String
orderbook_not_contains: String
orderbook_not_contains_nocase: String
orderbook_starts_with: String
orderbook_starts_with_nocase: String
orderbook_not_starts_with: String
orderbook_not_starts_with_nocase: String
orderbook_ends_with: String
orderbook_ends_with_nocase: String
orderbook_not_ends_with: String
orderbook_not_ends_with_nocase: String
orderbook_: Orderbook_filter
trades_: Trade_filter
transaction: String
transaction_not: String
transaction_gt: String
transaction_lt: String
transaction_gte: String
transaction_lte: String
transaction_in: [String!]
transaction_not_in: [String!]
transaction_contains: String
transaction_contains_nocase: String
transaction_not_contains: String
transaction_not_contains_nocase: String
transaction_starts_with: String
transaction_starts_with_nocase: String
transaction_not_starts_with: String
transaction_not_starts_with_nocase: String
transaction_ends_with: String
transaction_ends_with_nocase: String
transaction_not_ends_with: String
transaction_not_ends_with_nocase: String
transaction_: Transaction_filter
sender: Bytes
sender_not: Bytes
sender_gt: Bytes
sender_lt: Bytes
sender_gte: Bytes
sender_lte: Bytes
sender_in: [Bytes!]
sender_not_in: [Bytes!]
sender_contains: Bytes
sender_not_contains: Bytes
"""
Filter for the block changed event.
"""
_change_block: BlockChangedFilter
and: [Clear_filter]
or: [Clear_filter]
}

enum Clear_orderBy {
id
aliceInputAmount
aliceOutputAmount
bobInputAmount
bobOutputAmount
aliceBountyAmount
bobBountyAmount
aliceBountyVaultBalanceChange
aliceBountyVaultBalanceChange__id
aliceBountyVaultBalanceChange__sender
aliceBountyVaultBalanceChange__amount
aliceBountyVaultBalanceChange__oldVaultBalance
aliceBountyVaultBalanceChange__newVaultBalance
aliceBountyVaultBalanceChange__timestamp
bobBountyVaultBalanceChange
bobBountyVaultBalanceChange__id
bobBountyVaultBalanceChange__sender
bobBountyVaultBalanceChange__amount
bobBountyVaultBalanceChange__oldVaultBalance
bobBountyVaultBalanceChange__newVaultBalance
bobBountyVaultBalanceChange__timestamp
orderbook
orderbook__id
trades
transaction
transaction__id
transaction__timestamp
transaction__blockNumber
transaction__from
sender
}

type Deposit implements Event & VaultBalanceChange {
id: Bytes!
"""
Expand Down Expand Up @@ -1521,6 +1765,32 @@ type Query {
"""
subgraphError: _SubgraphErrorPolicy_! = deny
): [TakeOrder!]!
clear(
id: ID!
"""
The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.
"""
block: Block_height
"""
Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.
"""
subgraphError: _SubgraphErrorPolicy_! = deny
): Clear
clears(
skip: Int = 0
first: Int = 100
orderBy: Clear_orderBy
orderDirection: OrderDirection
where: Clear_filter
"""
The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.
"""
block: Block_height
"""
Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.
"""
subgraphError: _SubgraphErrorPolicy_! = deny
): [Clear!]!
transaction(
id: ID!
"""
Expand Down Expand Up @@ -2100,6 +2370,32 @@ type Subscription {
"""
subgraphError: _SubgraphErrorPolicy_! = deny
): [TakeOrder!]!
clear(
id: ID!
"""
The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.
"""
block: Block_height
"""
Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.
"""
subgraphError: _SubgraphErrorPolicy_! = deny
): Clear
clears(
skip: Int = 0
first: Int = 100
orderBy: Clear_orderBy
orderDirection: OrderDirection
where: Clear_filter
"""
The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.
"""
block: Block_height
"""
Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.
"""
subgraphError: _SubgraphErrorPolicy_! = deny
): [Clear!]!
transaction(
id: ID!
"""
Expand Down
Loading

0 comments on commit 3a336d7

Please sign in to comment.