@@ -420,6 +420,12 @@ func TestClient_GetTransactionResult(t *testing.T) {
420420 result , err := c .GetTransactionResult (ctx , txID )
421421 require .NoError (t , err )
422422
423+ // Force evaluation of type ID, which is cached in type.
424+ // Necessary for equality check below
425+ for _ , event := range result .Events {
426+ _ = event .Value .Type ().ID ()
427+ }
428+
423429 assert .Equal (t , expectedResult , * result )
424430
425431 }))
@@ -456,6 +462,14 @@ func TestClient_GetTransactionResultsByBlockID(t *testing.T) {
456462 results , err := c .GetTransactionResultsByBlockID (ctx , blockID )
457463 require .NoError (t , err )
458464
465+ // Force evaluation of type ID, which is cached in type.
466+ // Necessary for equality check below
467+ for _ , result := range results {
468+ for _ , event := range result .Events {
469+ _ = event .Value .Type ().ID ()
470+ }
471+ }
472+
459473 assert .Equal (t , len (results ), 1 )
460474 assert .Equal (t , expectedResult , * results [0 ])
461475 }))
@@ -763,6 +777,14 @@ func TestClient_GetEventsForHeightRange(t *testing.T) {
763777 })
764778 require .NoError (t , err )
765779
780+ // Force evaluation of type ID, which is cached in type.
781+ // Necessary for equality check below
782+ for _ , block := range blocks {
783+ for _ , event := range block .Events {
784+ _ = event .Value .Type ().ID ()
785+ }
786+ }
787+
766788 assert .Len (t , blocks , len (response .Results ))
767789
768790 assert .Equal (t , response .Results [0 ].BlockId , blocks [0 ].BlockID .Bytes ())
@@ -855,6 +877,14 @@ func TestClient_GetEventsForBlockIDs(t *testing.T) {
855877 blocks , err := c .GetEventsForBlockIDs (ctx , "foo" , []flow.Identifier {blockIDA , blockIDB })
856878 require .NoError (t , err )
857879
880+ // Force evaluation of type ID, which is cached in type.
881+ // Necessary for equality checks below
882+ for _ , block := range blocks {
883+ for _ , event := range block .Events {
884+ _ = event .Value .Type ().ID ()
885+ }
886+ }
887+
858888 assert .Len (t , blocks , len (response .Results ))
859889
860890 assert .Equal (t , response .Results [0 ].BlockId , blocks [0 ].BlockID .Bytes ())
0 commit comments