@@ -44,14 +44,15 @@ describe('redis notifier', () => {
44
44
block_height : 1 ,
45
45
block_hash : '0x1234' ,
46
46
index_block_hash : '0x1234' ,
47
+ block_time : 1234 ,
47
48
} ) . build ( ) ;
48
49
await db . update ( block1 ) ;
49
50
50
51
expect ( messages . length ) . toBe ( 1 ) ;
51
- expect ( JSON . parse ( messages [ 0 ] ) . payload ) . toEqual ( {
52
+ expect ( JSON . parse ( messages [ 0 ] ) . payload ) . toContain ( {
52
53
chain : 'stacks' ,
53
54
network : 'mainnet' ,
54
- apply_blocks : [ { hash : '0x1234' , index : 1 } ] ,
55
+ apply_blocks : [ { hash : '0x1234' , index : 1 , time : 1234 } ] ,
55
56
rollback_blocks : [ ] ,
56
57
} ) ;
57
58
} ) ;
@@ -62,13 +63,14 @@ describe('redis notifier', () => {
62
63
block_height : 1 ,
63
64
block_hash : '0x1234' ,
64
65
index_block_hash : '0x1234' ,
66
+ block_time : 1234 ,
65
67
} ) . build ( )
66
68
) ;
67
69
expect ( messages . length ) . toBe ( 1 ) ;
68
- expect ( JSON . parse ( messages [ 0 ] ) . payload ) . toEqual ( {
70
+ expect ( JSON . parse ( messages [ 0 ] ) . payload ) . toContain ( {
69
71
chain : 'stacks' ,
70
72
network : 'mainnet' ,
71
- apply_blocks : [ { hash : '0x1234' , index : 1 } ] ,
73
+ apply_blocks : [ { hash : '0x1234' , index : 1 , time : 1234 } ] ,
72
74
rollback_blocks : [ ] ,
73
75
} ) ;
74
76
@@ -78,13 +80,14 @@ describe('redis notifier', () => {
78
80
block_hash : '0x1235' ,
79
81
index_block_hash : '0x1235' ,
80
82
parent_index_block_hash : '0x1234' ,
83
+ block_time : 1234 ,
81
84
} ) . build ( )
82
85
) ;
83
86
expect ( messages . length ) . toBe ( 2 ) ;
84
- expect ( JSON . parse ( messages [ 1 ] ) . payload ) . toEqual ( {
87
+ expect ( JSON . parse ( messages [ 1 ] ) . payload ) . toContain ( {
85
88
chain : 'stacks' ,
86
89
network : 'mainnet' ,
87
- apply_blocks : [ { hash : '0x1235' , index : 2 } ] ,
90
+ apply_blocks : [ { hash : '0x1235' , index : 2 , time : 1234 } ] ,
88
91
rollback_blocks : [ ] ,
89
92
} ) ;
90
93
@@ -95,6 +98,7 @@ describe('redis notifier', () => {
95
98
block_hash : '0x1235aa' ,
96
99
index_block_hash : '0x1235aa' ,
97
100
parent_index_block_hash : '0x1234' ,
101
+ block_time : 1234 ,
98
102
} ) . build ( )
99
103
) ;
100
104
expect ( messages . length ) . toBe ( 2 ) ;
@@ -106,17 +110,18 @@ describe('redis notifier', () => {
106
110
block_hash : '0x1236' ,
107
111
index_block_hash : '0x1236' ,
108
112
parent_index_block_hash : '0x1235aa' ,
113
+ block_time : 1234 ,
109
114
} ) . build ( )
110
115
) ;
111
116
expect ( messages . length ) . toBe ( 3 ) ;
112
- expect ( JSON . parse ( messages [ 2 ] ) . payload ) . toEqual ( {
117
+ expect ( JSON . parse ( messages [ 2 ] ) . payload ) . toContain ( {
113
118
chain : 'stacks' ,
114
119
network : 'mainnet' ,
115
120
apply_blocks : [
116
- { hash : '0x1235aa' , index : 2 } ,
117
- { hash : '0x1236' , index : 3 } ,
121
+ { hash : '0x1235aa' , index : 2 , time : 1234 } ,
122
+ { hash : '0x1236' , index : 3 , time : 1234 } ,
118
123
] ,
119
- rollback_blocks : [ { hash : '0x1235' , index : 2 } ] ,
124
+ rollback_blocks : [ { hash : '0x1235' , index : 2 , time : 1234 } ] ,
120
125
} ) ;
121
126
} ) ;
122
127
} ) ;
0 commit comments