Skip to content

Commit 7a6ddc7

Browse files
authored
Add creation block number and timestamp to activations (#44)
1 parent f427500 commit 7a6ddc7

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

subgraphs/stakewise/schema.graphql

+6
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ type DepositActivation @entity {
8080

8181
"The amount that will be activated"
8282
amount: BigInt!
83+
84+
"The creation block number"
85+
createdAtBlock: BigInt!
86+
87+
"The creation timestamp"
88+
createdAtTimestamp: BigInt!
8389
}
8490

8591
"""

subgraphs/stakewise/src/entities/pool.ts

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ export function createOrLoadDepositActivation(
4141
activation.account = account;
4242
activation.validatorIndex = validatorIndex;
4343
activation.amount = BIG_INT_ZERO;
44+
activation.createdAtBlock = BIG_INT_ZERO;
45+
activation.createdAtTimestamp = BIG_INT_ZERO;
4446
activation.save();
4547
}
4648

subgraphs/stakewise/src/mappings/pool.ts

+2
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ export function handleActivationScheduled(event: ActivationScheduled): void {
128128
);
129129

130130
activation.amount = activation.amount.plus(event.params.value);
131+
activation.createdAtBlock = event.block.number;
132+
activation.createdAtTimestamp = event.block.timestamp;
131133
activation.save();
132134

133135
let pool = createOrLoadPool();

0 commit comments

Comments
 (0)