@@ -335,7 +335,7 @@ describe('KVArchiverDataStore', () => {
335335 await store . addCheckpoints ( publishedCheckpoints ) ;
336336 const lastCheckpoint = publishedCheckpoints [ publishedCheckpoints . length - 1 ] ;
337337 const lastBlock = lastCheckpoint . checkpoint . blocks [ 0 ] ;
338- const blockHash = ( await lastBlock . header . hash ( ) ) . toField ( ) ;
338+ const blockHash = await lastBlock . header . hash ( ) ;
339339 const archive = lastBlock . archive . root ;
340340
341341 // Verify block and header exist before removing
@@ -639,7 +639,7 @@ describe('KVArchiverDataStore', () => {
639639 // Check each block by its hash
640640 for ( let i = 0 ; i < checkpoint . checkpoint . blocks . length ; i ++ ) {
641641 const block = checkpoint . checkpoint . blocks [ i ] ;
642- const blockHash = ( await block . header . hash ( ) ) . toField ( ) ;
642+ const blockHash = await block . header . hash ( ) ;
643643 const retrievedBlock = await store . getCheckpointedBlockByHash ( blockHash ) ;
644644
645645 expect ( retrievedBlock ) . toBeDefined ( ) ;
@@ -797,8 +797,8 @@ describe('KVArchiverDataStore', () => {
797797 await store . addProposedBlocks ( [ block1 , block2 ] ) ;
798798
799799 // getBlockByHash should work for uncheckpointed blocks
800- const hash1 = ( await block1 . header . hash ( ) ) . toField ( ) ;
801- const hash2 = ( await block2 . header . hash ( ) ) . toField ( ) ;
800+ const hash1 = await block1 . header . hash ( ) ;
801+ const hash2 = await block2 . header . hash ( ) ;
802802
803803 const retrieved1 = await store . getBlockByHash ( hash1 ) ;
804804 expect ( retrieved1 ! . equals ( block1 ) ) . toBe ( true ) ;
@@ -874,7 +874,7 @@ describe('KVArchiverDataStore', () => {
874874 } ) ;
875875 await store . addProposedBlocks ( [ block1 ] ) ;
876876
877- const hash = ( await block1 . header . hash ( ) ) . toField ( ) ;
877+ const hash = await block1 . header . hash ( ) ;
878878
879879 // getCheckpointedBlockByHash should return undefined
880880 expect ( await store . getCheckpointedBlockByHash ( hash ) ) . toBeUndefined ( ) ;
@@ -1666,15 +1666,15 @@ describe('KVArchiverDataStore', () => {
16661666 it ( 'retrieves a block by its hash' , async ( ) => {
16671667 const expectedCheckpoint = publishedCheckpoints [ 5 ] ;
16681668 const expectedBlock = expectedCheckpoint . checkpoint . blocks [ 0 ] ;
1669- const blockHash = ( await expectedBlock . header . hash ( ) ) . toField ( ) ;
1669+ const blockHash = await expectedBlock . header . hash ( ) ;
16701670 const retrievedBlock = await store . getCheckpointedBlockByHash ( blockHash ) ;
16711671
16721672 expect ( retrievedBlock ) . toBeDefined ( ) ;
16731673 expectCheckpointedBlockEquals ( retrievedBlock ! , expectedBlock , expectedCheckpoint ) ;
16741674 } ) ;
16751675
16761676 it ( 'returns undefined for non-existent block hash' , async ( ) => {
1677- const nonExistentHash = Fr . random ( ) ;
1677+ const nonExistentHash = BlockHash . random ( ) ;
16781678 await expect ( store . getCheckpointedBlockByHash ( nonExistentHash ) ) . resolves . toBeUndefined ( ) ;
16791679 } ) ;
16801680 } ) ;
@@ -1707,15 +1707,15 @@ describe('KVArchiverDataStore', () => {
17071707
17081708 it ( 'retrieves a block header by its hash' , async ( ) => {
17091709 const expectedBlock = publishedCheckpoints [ 7 ] . checkpoint . blocks [ 0 ] ;
1710- const blockHash = ( await expectedBlock . header . hash ( ) ) . toField ( ) ;
1710+ const blockHash = await expectedBlock . header . hash ( ) ;
17111711 const retrievedHeader = await store . getBlockHeaderByHash ( blockHash ) ;
17121712
17131713 expect ( retrievedHeader ) . toBeDefined ( ) ;
17141714 expect ( retrievedHeader ! . equals ( expectedBlock . header ) ) . toBe ( true ) ;
17151715 } ) ;
17161716
17171717 it ( 'returns undefined for non-existent block hash' , async ( ) => {
1718- const nonExistentHash = Fr . random ( ) ;
1718+ const nonExistentHash = BlockHash . random ( ) ;
17191719 await expect ( store . getBlockHeaderByHash ( nonExistentHash ) ) . resolves . toBeUndefined ( ) ;
17201720 } ) ;
17211721 } ) ;
@@ -3320,7 +3320,7 @@ describe('KVArchiverDataStore', () => {
33203320 await store . addProposedBlocks ( [ block1 , block2 ] ) ;
33213321
33223322 // Verify block2 is retrievable by hash and archive before removal
3323- const block2Hash = ( await block2 . header . hash ( ) ) . toField ( ) ;
3323+ const block2Hash = await block2 . header . hash ( ) ;
33243324 const block2Archive = block2 . archive . root ;
33253325
33263326 expect ( await store . getBlockByHash ( block2Hash ) ) . toBeDefined ( ) ;
@@ -3346,7 +3346,7 @@ describe('KVArchiverDataStore', () => {
33463346 }
33473347
33483348 // Verify block1's data is still intact
3349- const block1Hash = ( await block1 . header . hash ( ) ) . toField ( ) ;
3349+ const block1Hash = await block1 . header . hash ( ) ;
33503350 const block1Archive = block1 . archive . root ;
33513351
33523352 expect ( await store . getBlockByHash ( block1Hash ) ) . toBeDefined ( ) ;
0 commit comments