We can use more table tests in the network methods and avoid calling the queryMock too much time. We should define a structure to carry the expected mock and call only one time in the tests.
type mocks struct {
coordByAddr profiletypes.QueryGetCoordinatorByAddressRequest
createChain launchtypes.MsgCreateChain
...
}
suite.ProfileQueryMock.
On(
"CoordinatorByAddress",
context.Background(),
tt.mocks.coordByAddr,
).
Return(nil, nil).
Once()