diff --git a/internal/blocks/blocks_test.go b/internal/blocks/blocks_test.go index 04f6dd12d..077d2d8d3 100644 --- a/internal/blocks/blocks_test.go +++ b/internal/blocks/blocks_test.go @@ -46,8 +46,6 @@ func Test_GetBlock(t *testing.T) { assert.Equal(t, uint64(100), args.Get(3).(uint64)) }).Return(nil, nil) - srv.GetCollection.Return(nil, nil) - returnBlock := tests.NewBlock() returnBlock.Height = uint64(100) @@ -55,6 +53,24 @@ func Test_GetBlock(t *testing.T) { assert.Equal(t, uint64(100), args.Get(1).(flowkit.BlockQuery).Height) }).Return(returnBlock, nil) + returnCollection := tests.NewCollection() + transaction1 := tests.NewTransaction() + transaction2 := tests.NewTransaction() + returnCollection.TransactionIDs = []flow.Identifier{ + transaction1.ID(), + transaction2.ID(), + } + transactions := []*flow.Transaction{ + transaction1, + transaction2, + } + + srv.GetTransactionsByBlockID.Run(func(args mock.Arguments) { + assert.Equal(t, returnBlock.ID, args.Get(1).(flow.Identifier)) + }).Return(transactions, nil, nil) + + srv.GetCollection.Return(returnCollection, nil) + result, err := get(inArgs, command.GlobalFlags{}, util.NoLogger, rw, srv.Mock) assert.NotNil(t, result) assert.NoError(t, err)