Skip to content

feat(network/test): Reduce duplicated code #6

Description

@Pantani

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()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions