Skip to content

Commit 88bbdeb

Browse files
committed
Updated services with getSystemTransaction function
1 parent ad004bd commit 88bbdeb

File tree

3 files changed

+53
-4
lines changed

3 files changed

+53
-4
lines changed

mocks/Services.go

+43-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mocks/services_mock.go

+8
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ const (
4040
getBlockFunc = "GetBlock"
4141
getTransactionByIDFunc = "GetTransactionByID"
4242
getTransactionsByBlockIDFunc = "GetTransactionsByBlockID"
43+
getSystemTransactionFunc = "GetSystemTransaction"
4344
networkFunc = "Network"
4445
pingFunc = "Ping"
4546
removeContractFunc = "RemoveContract"
@@ -62,6 +63,7 @@ type MockServices struct {
6263
GetBlock *mock.Call
6364
GetTransactionByID *mock.Call
6465
GetTransactionsByBlockID *mock.Call
66+
GetSystemTransaction *mock.Call
6567
Network *mock.Call
6668
Ping *mock.Call
6769
RemoveContract *mock.Call
@@ -199,6 +201,11 @@ func DefaultMockServices() *MockServices {
199201
Network: m.On(networkFunc),
200202
Ping: m.On(pingFunc),
201203
SetLogger: m.On(setLoggerFunc, mock.AnythingOfType("output.Logger")),
204+
GetSystemTransaction: m.On(
205+
getSystemTransactionFunc,
206+
mock.Anything,
207+
mock.AnythingOfType("flow.Identifier"),
208+
),
202209
}
203210

204211
t.GetAccount.Run(func(args mock.Arguments) {
@@ -211,6 +218,7 @@ func DefaultMockServices() *MockServices {
211218
})
212219

213220
t.GetTransactionByID.Return(tests.NewTransaction(), nil)
221+
t.GetSystemTransaction.Return(tests.NewTransaction(), nil)
214222
t.GetCollection.Return(tests.NewCollection(), nil)
215223
t.GetEvents.Return([]flow.BlockEvents{}, nil)
216224
t.GetBlock.Return(tests.NewBlock(), nil)

services.go

+2
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ type Services interface {
103103

104104
GetTransactionsByBlockID(context.Context, flow.Identifier) ([]*flow.Transaction, []*flow.TransactionResult, error)
105105

106+
GetSystemTransaction(context.Context, flow.Identifier) (*flow.Transaction, *flow.TransactionResult, error)
107+
106108
// BuildTransaction builds a new transaction type for later signing and submitting to the network.
107109
//
108110
// AddressesRoles type defines the address for each role (payer, proposer, authorizers) and the script defines the transaction content.

0 commit comments

Comments
 (0)