diff --git a/testutil/network/basenet/accounts.go b/testutil/network/basenet/accounts.go index f27350ce7..e8ef63e6d 100644 --- a/testutil/network/basenet/accounts.go +++ b/testutil/network/basenet/accounts.go @@ -107,10 +107,7 @@ func (memnet *BaseInMemoryNetwork) FundAddress( t.Helper() signerAccountNumber := 0 - // Validator's client context MUST be used for this CLI command because its keyring includes the validator's key clientCtx := memnet.GetClientCtx(t) - // MUST NOT use memnet.GetClientCtx(t) as its keyring does not include the validator's account - // TODO_UPNEXT(@bryanchriswhite): Ensure validator key is always available via the in-memory network's keyring. net := memnet.GetNetwork(t) val := net.Validators[0] diff --git a/testutil/network/gatewaynet/network.go b/testutil/network/gatewaynet/network.go index 1f4b91b7b..8a09e2f58 100644 --- a/testutil/network/gatewaynet/network.go +++ b/testutil/network/gatewaynet/network.go @@ -129,9 +129,8 @@ func (memnet *inMemoryNetworkWithGateways) Start(_ context.Context, t *testing.T } // configureGatewayModuleGenesisState generates and populates the in-memory network's -// application module's GenesisState object with the number of applications specified -// by the InMemoryConfig, each of which is staked for a unique service. It returns -// the genesis state object. +// gateway module's GenesisState object with the number of gateways specified by the +// InMemoryConfig. func (memnet *inMemoryNetworkWithGateways) configureGatewayModuleGenesisState(t *testing.T) { t.Helper() @@ -140,7 +139,6 @@ func (memnet *inMemoryNetworkWithGateways) configureGatewayModuleGenesisState(t stake := sdk.NewCoin("upokt", sdk.NewInt(10000)) preGeneratedAcct, ok := memnet.PreGeneratedAccountIterator.Next() require.Truef(t, ok, "pre-generated accounts iterator exhausted") - require.Truef(t, ok, "pre-generated accounts iterator exhausted") gateway := gatewaytypes.Gateway{ Address: preGeneratedAcct.Address.String(), @@ -153,10 +151,14 @@ func (memnet *inMemoryNetworkWithGateways) configureGatewayModuleGenesisState(t gatewayGenesisBuffer, err := memnet.GetCosmosNetworkConfig(t).Codec.MarshalJSON(gatewayGenesisState) require.NoError(t, err) - // Add supplier module genesis supplierGenesisState to the network config. + // Add gateway module genesis state to the network config. memnet.GetCosmosNetworkConfig(t).GenesisState[gatewaytypes.ModuleName] = gatewayGenesisBuffer } +// configureAppModuleGenesisState generates and populates the in-memory network's +// application module's GenesisState object with the number of applications specified +// by the InMemoryConfig, each of which is staked for a unique service. It returns +// the genesis state object. func (memnet *inMemoryNetworkWithGateways) configureAppModuleGenesisState(t *testing.T) { t.Helper() @@ -182,6 +184,6 @@ func (memnet *inMemoryNetworkWithGateways) configureAppModuleGenesisState(t *tes appGenesisBuffer, err := memnet.Config.CosmosCfg.Codec.MarshalJSON(appGenesisState) require.NoError(t, err) - // Add application module genesis appGenesisState to the network memnet cosmos config. + // Add application module genesis state to the network memnet cosmos config. memnet.GetCosmosNetworkConfig(t).GenesisState[apptypes.ModuleName] = appGenesisBuffer } diff --git a/testutil/network/genesis.go b/testutil/network/genesis.go index 2c9053012..d6ec94d74 100644 --- a/testutil/network/genesis.go +++ b/testutil/network/genesis.go @@ -17,7 +17,7 @@ func GetGenesisState[T proto.Message](t *testing.T, moduleName string, memnet In var genesisState T // NB: As this function is generic, it MUST use reflect in order to unmarshal - // the genesis state as the codec requries a reference to a concrete type pointer. + // the genesis state as the codec requires a reference to a concrete type pointer. genesisStateType := reflect.TypeOf(genesisState) genesisStateValue := reflect.New(genesisStateType.Elem()) genesisStatePtr := genesisStateValue.Interface().(proto.Message) diff --git a/testutil/network/sessionnet/genesis.go b/testutil/network/sessionnet/genesis.go index 86bf5b685..f387a2a56 100644 --- a/testutil/network/sessionnet/genesis.go +++ b/testutil/network/sessionnet/genesis.go @@ -51,18 +51,17 @@ func (memnet *inMemoryNetworkWithSessions) configureSupplierModuleGenesisState(t supplierGenesisBuffer, err := memnet.GetCosmosNetworkConfig(t).Codec.MarshalJSON(supplierGenesisState) require.NoError(t, err) - // Add supplier module genesis supplierGenesisState to the network config. + // Add supplier module genesis state to the network config. memnet.GetCosmosNetworkConfig(t).GenesisState[suppliertypes.ModuleName] = supplierGenesisBuffer return supplierGenesisState } // configureApplicationModuleGenesisState generates and populates the in-memory network's -// applicaion module's GenesisState object with a given number of applications, -// each of which is staked for a service such that -// memnet.Config.AppSupplierPairingRatio*NumSuppliers number of applications are staked -// for each genesis supplier's service (assumes that each supplier is staked for a unique -// service with no overlap). +// application module's GenesisState object with a given number of applications, each of +// which is staked for a service such that memnet.Config.AppSupplierPairingRatio*NumSuppliers +// number of applications are staked for each genesis supplier's service (assumes that each +// supplier is staked for a unique service with no overlap). func (memnet *inMemoryNetworkWithSessions) configureAppModuleGenesisState(t *testing.T) *apptypes.GenesisState { t.Helper()