Skip to content

Commit

Permalink
adjust code ot changes in API of cadence package
Browse files Browse the repository at this point in the history
  • Loading branch information
turbolent committed May 2, 2024
1 parent 2552f1a commit dc655f4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion gateway/mocks/gateway_mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
21 changes: 12 additions & 9 deletions tests/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}}

Expand Down

0 comments on commit dc655f4

Please sign in to comment.