-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
subgraph-beanstalk2.4.0 + add standardized Version entity to all subg…
…raphs (#1025)
- Loading branch information
Showing
140 changed files
with
6,593 additions
and
5,487 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { BigInt, ethereum } from "@graphprotocol/graph-ts"; | ||
import { Version } from "../../generated/schema"; | ||
|
||
export function handleInitVersion(block: ethereum.Block): void { | ||
const versionEntity = new Version("subgraph"); | ||
versionEntity.versionNumber = "2.2.2"; | ||
versionEntity.subgraphName = subgraphNameForBlockNumber(block.number); | ||
versionEntity.chain = chainForBlockNumber(block.number); | ||
versionEntity.save(); | ||
} | ||
|
||
function subgraphNameForBlockNumber(blockNumber: BigInt): string { | ||
if (blockNumber == BigInt.fromU32(17977922)) { | ||
return "basin"; | ||
} | ||
throw new Error("Unable to initialize subgraph name for this block number"); | ||
} | ||
|
||
function chainForBlockNumber(blockNumber: BigInt): string { | ||
if (blockNumber == BigInt.fromU32(17977922)) { | ||
return "ethereum"; | ||
} | ||
throw new Error("Unable to initialize chain for this block number"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { BigInt, ethereum } from "@graphprotocol/graph-ts"; | ||
import { Version } from "../../generated/schema"; | ||
|
||
export function handleInitVersion(block: ethereum.Block): void { | ||
const versionEntity = new Version("subgraph"); | ||
versionEntity.versionNumber = "2.3.1"; | ||
versionEntity.subgraphName = subgraphNameForBlockNumber(block.number); | ||
versionEntity.chain = chainForBlockNumber(block.number); | ||
versionEntity.save(); | ||
} | ||
|
||
function subgraphNameForBlockNumber(blockNumber: BigInt): string { | ||
if (blockNumber == BigInt.fromU32(12974075)) { | ||
return "bean"; | ||
} | ||
throw new Error("Unable to initialize subgraph name for this block number"); | ||
} | ||
|
||
function chainForBlockNumber(blockNumber: BigInt): string { | ||
if (blockNumber == BigInt.fromU32(12974075)) { | ||
return "ethereum"; | ||
} | ||
throw new Error("Unable to initialize chain for this block number"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,23 @@ | ||
# This same entity schema is intended for use across the subgraphs | ||
type Version @entity { | ||
"= 'subgraph'" | ||
id: ID! | ||
"= 'beanstalk'" | ||
subgraphName: String! | ||
"Verison number of the subgraph" | ||
versionNumber: String! | ||
"Which blockchain is being indexed, i.e. 'ethereum', 'arbitrum', etc." | ||
chain: String! | ||
} | ||
|
||
type BeaNFTUser @entity { | ||
id: ID! | ||
barnRaise: [Int!] | ||
genesis: [Int!] | ||
winter: [Int!] | ||
basin: [Int!] | ||
}, | ||
} | ||
type CollectionData @entity { | ||
id: ID! | ||
minted: [Int!] | ||
} | ||
} |
Oops, something went wrong.