Skip to content

Commit a0f0fc4

Browse files
authored
Merge pull request #348 from onflow/auto-update-onflow-cadence-v0.35.0
2 parents 424f74f + 21631e0 commit a0f0fc4

4 files changed

Lines changed: 43 additions & 3 deletions

File tree

access/grpc/convert_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,10 @@ func TestConvert_Event(t *testing.T) {
202202
eventB, err := messageToEvent(msg, nil)
203203
require.NoError(t, err)
204204

205+
// Force evaluation of type ID, which is cached in type.
206+
// Necessary for equality check below
207+
_ = eventB.Value.Type().ID()
208+
205209
assert.Equal(t, eventA, eventB)
206210
}
207211

@@ -264,5 +268,11 @@ func TestConvert_TransactionResult(t *testing.T) {
264268
resultB, err := messageToTransactionResult(msg, nil)
265269
require.NoError(t, err)
266270

271+
// Force evaluation of type ID, which is cached in type.
272+
// Necessary for equality check below
273+
for _, event := range resultB.Events {
274+
_ = event.Value.Type().ID()
275+
}
276+
267277
assert.Equal(t, resultA, resultB)
268278
}

access/grpc/grpc_test.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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())

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
github.com/aws/aws-sdk-go-v2/config v1.18.10
99
github.com/aws/aws-sdk-go-v2/service/kms v1.20.1
1010
github.com/ethereum/go-ethereum v1.9.13
11-
github.com/onflow/cadence v0.31.3
11+
github.com/onflow/cadence v0.35.0
1212
github.com/onflow/flow-go/crypto v0.24.4
1313
github.com/onflow/flow/protobuf/go/flow v0.3.1
1414
github.com/onflow/sdks v0.5.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,8 @@ github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXW
314314
github.com/olekukonko/tablewriter v0.0.2-0.20190409134802-7e037d187b0c/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
315315
github.com/onflow/atree v0.4.0 h1:+TbNisavAkukAKhgQ4plWnvR9o5+SkwPIsi3jaeAqKs=
316316
github.com/onflow/atree v0.4.0/go.mod h1:7Qe1xaW0YewvouLXrugzMFUYXNoRQ8MT/UsVAWx1Ndo=
317-
github.com/onflow/cadence v0.31.3 h1:lTHTBnoFi/ahGk1cQ9JAC+tfYir4kjRVIqtTVCjbe6E=
318-
github.com/onflow/cadence v0.31.3/go.mod h1:oRgWkvau1RH15m3NuDlZCPHFQzwvC72jEstCGu8OJ98=
317+
github.com/onflow/cadence v0.35.0 h1:MWq1phGfU8CjYm3UO0z/2xTKMpb9Z/vHH0RZdqIpyIE=
318+
github.com/onflow/cadence v0.35.0/go.mod h1:hhktaaXlJmxnfLgH2HG0cftcUWScdfjO/CTZkzaom/g=
319319
github.com/onflow/flow-go/crypto v0.24.4 h1:SwEtoVS2TidCIHYCZMgQ7U2YsqhI9upnw94fhdHTubM=
320320
github.com/onflow/flow-go/crypto v0.24.4/go.mod h1:dkVL98P6GHR48iD9zCB6XlnkJX8IQd00FKgt1reV90w=
321321
github.com/onflow/flow/protobuf/go/flow v0.3.1 h1:4I8ykG6naR3n8Or6eXrZDaGVaoztb3gP2KJ6XKyDufg=

0 commit comments

Comments
 (0)