Skip to content

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

@Pantani

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    To Discuss

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions