Skip to content

Commit 91526e6

Browse files
authored
Fix subscribeEvents block timestamp (#1965)
1 parent b7a0782 commit 91526e6

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

.changeset/thin-baboons-itch.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@onflow/transport-http": patch
3+
---
4+
5+
Fix `subscribeEvents` block timestamp

packages/transport-http/src/connect-subscribe-events.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ describe("Subscribe Events", () => {
128128
emitter.emit("data", {
129129
BlockID: "abc123",
130130
Height: 1,
131-
Timestamp: "1",
131+
BlockTimestamp: "1",
132132
Events: [
133133
{
134134
Type: "A.7e60df042a9c0868.FlowToken.TokensWithdrawn",
@@ -143,7 +143,7 @@ describe("Subscribe Events", () => {
143143
emitter.emit("data", {
144144
BlockID: "def456",
145145
Height: 2,
146-
Timestamp: "2",
146+
BlockTimestamp: "2",
147147
Events: [],
148148
})
149149

@@ -278,7 +278,7 @@ describe("Subscribe Events", () => {
278278
emitter.emit("data", {
279279
BlockID: "abc123",
280280
Height: 1,
281-
Timestamp: "1",
281+
BlockTimestamp: "1",
282282
Events: [],
283283
})
284284

packages/transport-http/src/connect-subscribe-events.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function constructData(ix: Interaction, context: any, data: any) {
1919
? data.Events.map((event: any) => ({
2020
blockId: data.BlockID,
2121
blockHeight: Number(data.Height),
22-
blockTimestamp: data.Timestamp,
22+
blockTimestamp: data.BlockTimestamp,
2323
type: event.Type,
2424
transactionId: event.TransactionID,
2525
transactionIndex: Number(event.TransactionIndex),
@@ -32,7 +32,7 @@ function constructData(ix: Interaction, context: any, data: any) {
3232
response.heartbeat = {
3333
blockId: data.BlockID,
3434
blockHeight: Number(data.Height),
35-
blockTimestamp: data.Timestamp,
35+
blockTimestamp: data.BlockTimestamp,
3636
}
3737

3838
return response

0 commit comments

Comments
 (0)