From dc655f45f71be1be10468c49da507cdb0cf06f2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Thu, 2 May 2024 10:20:52 -0700 Subject: [PATCH] adjust code ot changes in API of cadence package --- gateway/mocks/gateway_mock.go | 2 +- tests/resources.go | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/gateway/mocks/gateway_mock.go b/gateway/mocks/gateway_mock.go index 0e351f13..17b54f8b 100644 --- a/gateway/mocks/gateway_mock.go +++ b/gateway/mocks/gateway_mock.go @@ -120,7 +120,7 @@ func DefaultMockGateway() *TestGateway { }) t.ExecuteScript.Run(func(args mock.Arguments) { - t.ExecuteScript.Return(cadence.MustConvertValue(""), nil) + t.ExecuteScript.Return(cadence.String(""), nil) }) t.GetTransaction.Return(tests.NewTransaction(), nil) diff --git a/tests/resources.go b/tests/resources.go index e7aae37f..f24f16e7 100644 --- a/tests/resources.go +++ b/tests/resources.go @@ -640,20 +640,23 @@ func NewTransactionResult(events []flow.Event) *flow.TransactionResult { } func NewAccountCreateResult(address flow.Address) *flow.TransactionResult { + eventType := cadence.NewEventType( + common.NewStringLocation(nil, flow.EventAccountCreated), + "", + []cadence.Field{{ + Identifier: "address", + Type: cadence.AddressType, + }}, + nil, + ) events := []flow.Event{{ Type: flow.EventAccountCreated, TransactionID: flow.Identifier{}, TransactionIndex: 0, EventIndex: 0, - Value: cadence.Event{ - EventType: cadence.NewEventType(common.NewStringLocation(nil, flow.EventAccountCreated), "", []cadence.Field{{ - Identifier: "address", - Type: cadence.AddressType, - }}, nil), - Fields: []cadence.Value{ - cadence.NewAddress(address), - }, - }, + Value: cadence.NewEvent([]cadence.Value{ + cadence.NewAddress(address), + }).WithType(eventType), Payload: nil, }}