Skip to content

Commit

Permalink
chore: add ApplicationModuleGenesisStateWithAccounts testutil
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanchriswhite committed Nov 30, 2023
1 parent 5721b51 commit 65d92e3
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions testutil/network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,27 @@ func DefaultApplicationModuleGenesisState(t *testing.T, n int) *apptypes.Genesis
return state
}

// TODO_IN_THIS_COMMIT: fix comment...
// ApplicationModuleGenesisStateWithAccount generates a GenesisState object with a single supplier with the given address.
func ApplicationModuleGenesisStateWithAccounts(t *testing.T, addresses []string) *apptypes.GenesisState {
t.Helper()
state := apptypes.DefaultGenesis()
for _, addr := range addresses {
application := apptypes.Application{
Address: addr,
Stake: &sdk.Coin{Denom: "upokt", Amount: sdk.NewInt(10000)},
ServiceConfigs: []*sharedtypes.ApplicationServiceConfig{
{
Service: &sharedtypes.Service{Id: "svc1"},
},
},
}
state.ApplicationList = append(state.ApplicationList, application)
}

return state
}

// DefaultGatewayModuleGenesisState generates a GenesisState object with a given number of gateways.
// It returns the populated GenesisState object.
func DefaultGatewayModuleGenesisState(t *testing.T, n int) *gatewaytypes.GenesisState {
Expand Down

0 comments on commit 65d92e3

Please sign in to comment.