@@ -49,11 +49,11 @@ describe("block height offset", () => {
4949 const [ zeroOffset ] = await executeScript ( "get-block-offset" )
5050 expect ( zeroOffset ) . toBe ( "0" )
5151
52- const offset = 42
52+ const offset = "42"
5353 await shallPass ( sendTransaction ( "set-block-offset" , [ manager ] , [ offset ] ) )
5454
5555 const [ newOffset ] = await executeScript ( "get-block-offset" )
56- expect ( newOffset ) . toBe ( String ( offset ) )
56+ expect ( newOffset ) . toBe ( offset )
5757 } )
5858
5959 it ( "should read offset with utility method" , async ( ) => {
@@ -65,11 +65,11 @@ describe("block height offset", () => {
6565 const [ oldOffset ] = await getBlockOffset ( )
6666 expect ( oldOffset ) . toBe ( "0" )
6767
68- const offset = 42
68+ const offset = "42"
6969 await shallPass ( setBlockOffset ( offset ) )
7070
7171 const [ newOffset ] = await getBlockOffset ( )
72- expect ( newOffset ) . toBe ( String ( offset ) )
72+ expect ( newOffset ) . toBe ( offset )
7373 } )
7474
7575 it ( "should update offset in contract" , async ( ) => {
@@ -87,7 +87,7 @@ describe("block height offset", () => {
8787 } )
8888 )
8989
90- const offset = 42
90+ const offset = "42"
9191 await shallPass ( manager . setBlockOffset ( offset ) )
9292
9393 const realBlock = await query ( {
@@ -110,7 +110,7 @@ describe("block height offset", () => {
110110 )
111111
112112 // Expect 1 higher than initial block height + offset due to sealed TX @ manager.setBlockOffset
113- expect ( Number ( currentBlock ) ) . toBe ( Number ( realBlock ) + offset )
113+ expect ( Number ( currentBlock ) ) . toBe ( Number ( realBlock ) + Number ( offset ) )
114114 } )
115115} )
116116
@@ -136,11 +136,11 @@ describe("block height offset utilities", () => {
136136 const [ offset ] = await shallResolve ( manager . getBlockOffset ( ) )
137137 expect ( offset ) . toBe ( "0" )
138138
139- const blockOffset = 42
139+ const blockOffset = "42"
140140 await shallPass ( manager . setBlockOffset ( blockOffset ) )
141141
142142 const [ newOffset ] = await shallResolve ( manager . getBlockOffset ( ) )
143- expect ( newOffset ) . toBe ( String ( blockOffset ) )
143+ expect ( newOffset ) . toBe ( blockOffset )
144144 } )
145145} )
146146
@@ -167,12 +167,12 @@ describe("timestamp offset", () => {
167167 const [ zeroOffset ] = await executeScript ( "get-timestamp-offset" )
168168 expect ( zeroOffset ) . toBe ( "0.00000000" )
169169
170- const offset = 42
170+ const offset = "42"
171171 await shallPass (
172172 sendTransaction ( "set-timestamp-offset" , [ manager ] , [ offset ] )
173173 )
174174 const [ newOffset ] = await executeScript ( "get-timestamp-offset" )
175- expect ( newOffset ) . toBe ( offset . toFixed ( 8 ) )
175+ expect ( newOffset ) . toBe ( Number ( offset ) . toFixed ( 8 ) )
176176 } )
177177
178178 it ( "should read offset with utility method" , async ( ) => {
@@ -184,11 +184,11 @@ describe("timestamp offset", () => {
184184 const [ oldOffset ] = await getTimestampOffset ( )
185185 expect ( oldOffset ) . toBe ( "0.00000000" )
186186
187- const offset = 42
187+ const offset = "42"
188188 await shallPass ( setTimestampOffset ( offset ) )
189189
190190 const [ newOffset ] = await getTimestampOffset ( )
191- expect ( newOffset ) . toBe ( offset . toFixed ( 8 ) )
191+ expect ( newOffset ) . toBe ( Number ( offset ) . toFixed ( 8 ) )
192192 } )
193193
194194 it ( "should update offset in contract" , async ( ) => {
@@ -206,7 +206,7 @@ describe("timestamp offset", () => {
206206 } )
207207 )
208208
209- const offset = 42
209+ const offset = "42"
210210 await shallPass ( manager . setTimestampOffset ( offset ) )
211211
212212 const realTimestamp = await query ( {
@@ -228,7 +228,9 @@ describe("timestamp offset", () => {
228228 } )
229229 )
230230
231- expect ( Number ( currentTimestamp ) ) . toBe ( Number ( realTimestamp ) + offset )
231+ expect ( Number ( currentTimestamp ) ) . toBe (
232+ Number ( realTimestamp ) + Number ( offset )
233+ )
232234 } )
233235} )
234236
@@ -254,11 +256,11 @@ describe("timestamp offset utilities", () => {
254256 const [ offset ] = await shallResolve ( manager . getTimestampOffset ( ) )
255257 expect ( offset ) . toBe ( "0.00000000" )
256258
257- const blockOffset = 42
259+ const blockOffset = "42"
258260 await shallPass ( manager . setTimestampOffset ( blockOffset ) )
259261
260262 const [ newOffset ] = await shallResolve ( manager . getTimestampOffset ( ) )
261- expect ( newOffset ) . toBe ( blockOffset . toFixed ( 8 ) )
263+ expect ( newOffset ) . toBe ( Number ( blockOffset ) . toFixed ( 8 ) )
262264 } )
263265} )
264266
@@ -281,11 +283,11 @@ describe("dev tests", () => {
281283 } )
282284
283285 it ( "should return proper offset, when changed" , async ( ) => {
284- const offset = 42
286+ const offset = "42"
285287 const manager = await getServiceAddress ( )
286288 await shallPass ( sendTransaction ( "set-block-offset" , [ manager ] , [ offset ] ) )
287289 const [ newOffset ] = await executeScript ( "get-block-offset" )
288- expect ( newOffset ) . toBe ( String ( offset ) )
290+ expect ( newOffset ) . toBe ( offset )
289291 } )
290292} )
291293
0 commit comments