Jürgen Eckel 4f5b1e5777
Multi validator setup in test cases (#333)
* Initializing rootDir of dao and machine keeper with the home path of the validator key material
* added Block height logging of context decorator
* removed SetRoot usage
* fixed data races of the attest machine go-routine
* reproduction of the issue
* fixed testing URL issue
* refactored the machine-nft functions/mock
* fixed keeper.param read-bug that increased the gas prices in an inconsistent way
* increased the validator number to 3 for all e2e tests
* added go routine to attest machine workflow

---------

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
Co-authored-by: Julian Strobl <jmastr@mailbox.org>
Co-authored-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2024-03-05 11:37:01 +01:00

65 lines
1.9 KiB
Go

package keeper
import (
"github.com/cometbft/cometbft/libs/log"
"github.com/cosmos/cosmos-sdk/codec"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
"github.com/planetmint/planetmint-go/x/machine/types"
)
type (
Keeper struct {
cdc codec.BinaryCodec
storeKey storetypes.StoreKey
taIndexStoreKey storetypes.StoreKey
issuerPlanetmintIndexStoreKey storetypes.StoreKey
issuerLiquidIndexStoreKey storetypes.StoreKey
taStoreKey storetypes.StoreKey
addressIndexStoreKey storetypes.StoreKey
memKey storetypes.StoreKey
paramstore paramtypes.Subspace
authority string
rootDir string
}
)
func NewKeeper(
cdc codec.BinaryCodec,
storeKey,
indexStoreKey,
issuerPlanetmintIndexStoreKey,
issuerLiquidIndexStoreKey,
taStoreKey,
addressIndexStoreKey,
memKey storetypes.StoreKey,
ps paramtypes.Subspace,
authority string,
rootDir string,
) *Keeper {
// set KeyTable if it has not already been set
if !ps.HasKeyTable() {
ps = ps.WithKeyTable(types.ParamKeyTable())
}
return &Keeper{
cdc: cdc,
storeKey: storeKey,
taIndexStoreKey: indexStoreKey,
issuerPlanetmintIndexStoreKey: issuerPlanetmintIndexStoreKey,
issuerLiquidIndexStoreKey: issuerLiquidIndexStoreKey,
taStoreKey: taStoreKey,
addressIndexStoreKey: addressIndexStoreKey,
memKey: memKey,
paramstore: ps,
authority: authority,
rootDir: rootDir,
}
}
func (k Keeper) Logger(ctx sdk.Context) log.Logger {
return ctx.Logger().With("module", "x/"+types.ModuleName)
}