Skip to content

Commit 683a347

Browse files
committed
Add comments for genesis loading method and type definitions
- Added a comment explaining the necessity to load the JSON file in a specific way in `handleGenesis`. - Updated a comment to clarify the ID field in the `SupplyDenom` type in `schema.graphql`. - Added a comment describing the `BlockSupply` type as a join entity between `Block` and `Supply`.
1 parent 339b635 commit 683a347

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

schema.graphql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type EventAttribute @entity {
1515
}
1616

1717
type SupplyDenom @entity {
18-
# denomination indeed
18+
# ID is the supply coin denomination.
1919
id: ID!
2020
}
2121

@@ -134,6 +134,7 @@ type Supply @entity {
134134
blocks: [BlockSupply]! @derivedFrom(field: "supply")
135135
}
136136

137+
# This entity is a Join between Block and Supply
137138
type BlockSupply @entity {
138139
id: ID!
139140
block: Block!

src/mappings/primitives.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ import {
4444
} from "./utils";
4545

4646
export async function handleGenesis(block: CosmosBlock): Promise<void> {
47+
// we MUST load the JSON this way due to the sandboxed environment
4748
// eslint-disable-next-line @typescript-eslint/no-var-requires
4849
const genesis: Genesis = require("../../genesis.json");
4950

0 commit comments

Comments
 (0)