Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem: sdk 0.50 is not used #1061

Merged
merged 42 commits into from
Jul 22, 2024
Merged
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
92494a6
Problem: sdk 0.50 is not used
mmsqe Jul 18, 2024
18063b9
fix build
yihuang Jul 18, 2024
f37b91d
fix build
yihuang Jul 18, 2024
a9be0f5
fix gomod2nix
yihuang Jul 18, 2024
e103091
fix rocksdb build
yihuang Jul 18, 2024
ed87c00
fix build
yihuang Jul 18, 2024
edacdde
fix module basic manager
yihuang Jul 18, 2024
456b40e
remove ModuleBasics
yihuang Jul 18, 2024
d5bbb72
fix encode
mmsqe Jul 18, 2024
ae7448c
fix keyring
mmsqe Jul 18, 2024
530fb3b
fix staking
mmsqe Jul 18, 2024
dc3b1c4
Problem: latest hermes is not used in integration tests
mmsqe Jul 18, 2024
b2150cf
Merge remote-tracking branch 'origin/master' into bump_hermes
mmsqe Jul 18, 2024
4832a7d
Merge remote-tracking branch 'origin/master' into sdk50
mmsqe Jul 18, 2024
9c92484
wait decimal fix
mmsqe Jul 18, 2024
6229313
fix tests
mmsqe Jul 18, 2024
5cf003e
fix pystarport
mmsqe Jul 18, 2024
a56a4d0
set mempool
mmsqe Jul 19, 2024
19640c1
test ci
mmsqe Jul 19, 2024
7ef4e44
skip priority
mmsqe Jul 19, 2024
c2f48fe
fix ibc
mmsqe Jul 19, 2024
dec8b69
Merge remote-tracking branch 'origin/bump_hermes' into sdk50
mmsqe Jul 19, 2024
ca5f855
fix ibc
mmsqe Jul 19, 2024
cf56991
cleanup
mmsqe Jul 19, 2024
e2df442
Revert "set mempool"
mmsqe Jul 19, 2024
cd73a77
fix hardware
mmsqe Jul 19, 2024
de29a5e
fix test
mmsqe Jul 19, 2024
86a444e
fix upgrade
mmsqe Jul 19, 2024
f48adb1
fix swagger
mmsqe Jul 20, 2024
8a1d7d6
fix sim
mmsqe Jul 20, 2024
f1ca537
subspace
mmsqe Jul 20, 2024
8062337
fix nft test
mmsqe Jul 20, 2024
a0c00b2
fix lint
yihuang Jul 22, 2024
7b0a4dd
ignore .direnv
yihuang Jul 22, 2024
0269a97
ibc-go 8.3
yihuang Jul 22, 2024
26ac3cc
use upstream sdk
yihuang Jul 22, 2024
3cb6395
update deps
yihuang Jul 22, 2024
e4a1e7b
fix build
yihuang Jul 22, 2024
e78e0a7
fix lint
yihuang Jul 22, 2024
5b45dc5
lint
mmsqe Jul 22, 2024
4ecb497
update pystarport
yihuang Jul 22, 2024
ea539c1
update pystarport
mmsqe Jul 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
lint
mmsqe committed Jul 22, 2024
commit 5b45dc5e93d3af9a4813697dd1a4527ce7195b5d
1 change: 0 additions & 1 deletion cmd/chain-maind/app/app.go
Original file line number Diff line number Diff line change
@@ -78,7 +78,6 @@
cmd.SetOut(cmd.OutOrStdout())
cmd.SetErr(cmd.ErrOrStderr())

//nolint: govet
initClientCtx, err := client.ReadPersistentCommandFlags(initClientCtx, cmd.Flags())
if err != nil {
return err
@@ -105,7 +104,7 @@
autoCliOpts.ClientCtx = initClientCtx

if err := autoCliOpts.EnhanceRootCommand(rootCmd); err != nil {
panic(err)

Check warning on line 107 in cmd/chain-maind/app/app.go

Codecov / codecov/patch

cmd/chain-maind/app/app.go#L107

Added line #L107 was not covered by tests
}

return rootCmd, encodingConfig
@@ -266,7 +265,7 @@
cmd := genutilcli.Commands(txConfig, basicManager, app.DefaultNodeHome)

for _, subCmd := range cmds {
cmd.AddCommand(subCmd)

Check warning on line 268 in cmd/chain-maind/app/app.go

Codecov / codecov/patch

cmd/chain-maind/app/app.go#L268

Added line #L268 was not covered by tests
}
return cmd
}
@@ -348,13 +347,13 @@

var a *app.ChainApp
if height != -1 {
a = app.New(logger, db, traceStore, false, appOpts)

Check warning on line 350 in cmd/chain-maind/app/app.go

Codecov / codecov/patch

cmd/chain-maind/app/app.go#L350

Added line #L350 was not covered by tests

if err := a.LoadHeight(height); err != nil {
return servertypes.ExportedApp{}, err
}
} else {
a = app.New(logger, db, traceStore, true, appOpts)

Check warning on line 356 in cmd/chain-maind/app/app.go

Codecov / codecov/patch

cmd/chain-maind/app/app.go#L356

Added line #L356 was not covered by tests
}

return a.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs, modulesToExport)
2 changes: 0 additions & 2 deletions x/chainmain/client/cli/genaccounts.go
Original file line number Diff line number Diff line change
@@ -58,7 +58,6 @@
}

// attempt to lookup address from Keybase if no address was provided
//nolint: govet
kb, err := keyring.New(sdk.KeyringServiceName(), keyringBackend, clientCtx.HomeDir, inBuf, clientCtx.Codec)
if err != nil {
return err
@@ -126,9 +125,9 @@
baseAccount := authtypes.NewBaseAccount(addr, nil, 0, 0)

if !vestingAmt.IsZero() {
baseVestingAccount, err := authvesting.NewBaseVestingAccount(baseAccount, vestingAmt.Sort(), vestingEnd)
if err != nil {
return fmt.Errorf("failed to create base vesting account: %w", err)

Check warning on line 130 in x/chainmain/client/cli/genaccounts.go

Codecov / codecov/patch

x/chainmain/client/cli/genaccounts.go#L128-L130

Added lines #L128 - L130 were not covered by tests
}
if (balances.Coins.IsZero() && !baseVestingAccount.OriginalVesting.IsZero()) ||
baseVestingAccount.OriginalVesting.IsAnyGT(balances.Coins) {
@@ -149,7 +148,6 @@
genAccount = baseAccount
}

//nolint: govet
if err := genAccount.Validate(); err != nil {
return fmt.Errorf("failed to validate new genesis account: %w", err)
}
9 changes: 0 additions & 9 deletions x/nft/client/cli/query.go
Original file line number Diff line number Diff line change
@@ -96,8 +96,6 @@ func GetCmdQueryOwner() *cobra.Command {
if err != nil {
return err
}

//nolint: govet
if _, err := sdk.AccAddressFromBech32(args[0]); err != nil {
return err
}
@@ -140,8 +138,6 @@ func GetCmdQueryCollection() *cobra.Command {
if err != nil {
return err
}

//nolint: govet
if err := types.ValidateDenomIDWithIBC(args[0]); err != nil {
return err
}
@@ -210,8 +206,6 @@ func GetCmdQueryDenom() *cobra.Command {
if err != nil {
return err
}

//nolint: govet
if err := types.ValidateDenomIDWithIBC(args[0]); err != nil {
return err
}
@@ -245,7 +239,6 @@ func GetCmdQueryDenomByName() *cobra.Command {
return err
}

//nolint: govet
if err := types.ValidateDenomName(args[0]); err != nil {
return err
}
@@ -279,12 +272,10 @@ func GetCmdQueryNFT() *cobra.Command {
return err
}

//nolint: govet
if err := types.ValidateDenomIDWithIBC(args[0]); err != nil {
return err
}

//nolint: govet
if err := types.ValidateTokenID(args[1]); err != nil {
return err
}

Unchanged files with check annotations Beta

// get skipUpgradeHeights from the app options
skipUpgradeHeights := map[int64]bool{}
for _, h := range cast.ToIntSlice(appOpts.Get(server.FlagUnsafeSkipUpgrades)) {
skipUpgradeHeights[int64(h)] = true

Check warning on line 412 in app/app.go

Codecov / codecov/patch

app/app.go#L412

Added line #L412 was not covered by tests
}
app.UpgradeKeeper = *upgradekeeper.NewKeeper(skipUpgradeHeights, runtime.NewKVStoreService(keys[upgradetypes.StoreKey]), appCodec, homePath, app.BaseApp, authAddr)
// wire up the versiondb's `StreamingService` and `MultiStore`.
// we don't support other streaming service, versiondb will override the streaming manager.
if cast.ToBool(appOpts.Get("versiondb.enable")) {
qms, err := app.setupVersionDB(homePath, keys, tkeys, memKeys)
if err != nil {
panic(err)

Check warning on line 749 in app/app.go

Codecov / codecov/patch

app/app.go#L747-L749

Added lines #L747 - L749 were not covered by tests
}
app.qms = qms.(RootMultiStore)

Check warning on line 751 in app/app.go

Codecov / codecov/patch

app/app.go#L751

Added line #L751 was not covered by tests
}
// initialize BaseApp
}
if app.qms != nil {
v1 := app.qms.LatestVersion()

Check warning on line 799 in app/app.go

Codecov / codecov/patch

app/app.go#L799

Added line #L799 was not covered by tests
v2 := app.LastBlockHeight()
if v1 > 0 && v1 != v2 {
tmos.Exit(fmt.Sprintf("versiondb lastest version %d don't match iavl latest version %d", v1, v2))
// allowed to receive external tokens.
func (app *ChainApp) BlockedAddrs() map[string]bool {
blockedAddrs := make(map[string]bool)
for acc := range maccPerms {
blockedAddrs[authtypes.NewModuleAddress(acc).String()] = !allowedReceivingModAcc[acc]
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
return blockedAddrs
}
// AutoCliOpts returns the autocli options for the app.
func (app *ChainApp) AutoCliOpts() autocli.AppOptions {
modules := make(map[string]appmodule.AppModule, 0)
for _, m := range app.ModuleManager.Modules {
if moduleWithName, ok := m.(module.HasName); ok {
moduleName := moduleWithName.Name()
if appModule, ok := moduleWithName.(appmodule.AppModule); ok {
modules[moduleName] = appModule
}
}
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
return autocli.AppOptions{
Modules: modules,
ModuleOptions: runtimeservices.ExtractAutoCLIOptions(app.ModuleManager.Modules),
genState, err := app.ModuleManager.ExportGenesisForModules(ctx, app.appCodec, modulesToExport)
if err != nil {
return servertypes.ExportedApp{}, err

Check warning on line 36 in app/export.go

Codecov / codecov/patch

app/export.go#L36

Added line #L36 was not covered by tests
}
appState, err := json.MarshalIndent(genState, "", " ")
if err != nil {
// NOTE zero height genesis is a temporary feature which will be deprecated
//
// in favour of export at a block height
func (app *ChainApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) error {

Check warning on line 59 in app/export.go

Codecov / codecov/patch

app/export.go#L59

Added line #L59 was not covered by tests
applyAllowedAddrs := false
// check if there is a allowed address list
// withdraw all validator commission
app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) {
valBz, err := app.StakingKeeper.ValidatorAddressCodec().StringToBytes(val.GetOperator())
if err != nil {
panic(err)

Check warning on line 83 in app/export.go

Codecov / codecov/patch

app/export.go#L81-L83

Added lines #L81 - L83 were not covered by tests
}
_, err = app.DistrKeeper.WithdrawValidatorCommission(ctx, valBz)

Check warning on line 85 in app/export.go

Codecov / codecov/patch

app/export.go#L85

Added line #L85 was not covered by tests
if err != nil {
log := app.DistrKeeper.Logger(ctx)
log.Error(fmt.Sprintf("Withdraw validator commission: %v", err))
})
// withdraw all delegator rewards
dels, err := app.StakingKeeper.GetAllDelegations(ctx)
if err != nil {
return err

Check warning on line 96 in app/export.go

Codecov / codecov/patch

app/export.go#L94-L96

Added lines #L94 - L96 were not covered by tests
}
for _, delegation := range dels {
valAddr, errv := sdk.ValAddressFromBech32(delegation.ValidatorAddress)
// reinitialize all validators
app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) {
valBz, err := app.StakingKeeper.ValidatorAddressCodec().StringToBytes(val.GetOperator())
if err != nil {
panic(err)

Check warning on line 129 in app/export.go

Codecov / codecov/patch

app/export.go#L127-L129

Added lines #L127 - L129 were not covered by tests
}
// donate any unwithdrawn outstanding reward fraction tokens to the community pool
scraps, err := app.DistrKeeper.GetValidatorOutstandingRewardsCoins(ctx, valBz)
if err != nil {
panic(err)

Check warning on line 134 in app/export.go

Codecov / codecov/patch

app/export.go#L132-L134

Added lines #L132 - L134 were not covered by tests
}
feePool, err := app.DistrKeeper.FeePool.Get(ctx)
if err != nil {
panic(err)

Check warning on line 138 in app/export.go

Codecov / codecov/patch

app/export.go#L136-L138

Added lines #L136 - L138 were not covered by tests
}
feePool.CommunityPool = feePool.CommunityPool.Add(scraps...)
if err := app.DistrKeeper.FeePool.Set(ctx, feePool); err != nil {
panic(err)

Check warning on line 142 in app/export.go

Codecov / codecov/patch

app/export.go#L141-L142

Added lines #L141 - L142 were not covered by tests
}
if err := app.DistrKeeper.Hooks().AfterValidatorCreated(ctx, valBz); err != nil {

Check warning on line 145 in app/export.go

Codecov / codecov/patch

app/export.go#L145

Added line #L145 was not covered by tests
panic(err)
}
return false
// Iterate through validators by power descending, reset bond heights, and
// update bond intra-tx counters.
store := ctx.KVStore(app.keys[stakingtypes.StoreKey])
iter := storetypes.KVStoreReversePrefixIterator(store, stakingtypes.ValidatorsKey)

Check warning on line 196 in app/export.go

Codecov / codecov/patch

app/export.go#L196

Added line #L196 was not covered by tests
counter := int16(0)
for ; iter.Valid(); iter.Next() {
addr := sdk.ValAddress(stakingtypes.AddressFromValidatorsKey(iter.Key()))
validator, err := app.StakingKeeper.GetValidator(ctx, addr)
if err != nil {
return fmt.Errorf("expected validator %s not found, %w", addr, err)

Check warning on line 203 in app/export.go

Codecov / codecov/patch

app/export.go#L201-L203

Added lines #L201 - L203 were not covered by tests
}
validator.UnbondingHeight = 0
log.Fatal(err)
}
if _, err := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx); err != nil {
return err

Check warning on line 220 in app/export.go

Codecov / codecov/patch

app/export.go#L219-L220

Added lines #L219 - L220 were not covered by tests
}
/* Handle slashing state. */
// reset start height on signing infos
return app.SlashingKeeper.IterateValidatorSigningInfos(

Check warning on line 226 in app/export.go

Codecov / codecov/patch

app/export.go#L226

Added line #L226 was not covered by tests
ctx,
func(addr sdk.ConsAddress, info slashingtypes.ValidatorSigningInfo) (stop bool) {
info.StartHeight = 0
// NewDefaultGenesisState generates the default state for the application.
func NewDefaultGenesisState(cdc codec.JSONCodec) GenesisState {
tempApp := New(
log.NewNopLogger(), dbm.NewMemDB(), nil, true,
simtestutil.NewAppOptionsWithFlagHome(DefaultNodeHome),
)
return tempApp.BasicModuleManager.DefaultGenesis(cdc)

Check warning on line 27 in app/genesis.go

Codecov / codecov/patch

app/genesis.go#L23-L27

Added lines #L23 - L27 were not covered by tests
}
SigningOptions: signingOptions,
})
if err != nil {
panic(err)

Check warning on line 29 in app/params/proto.go

Codecov / codecov/patch

app/params/proto.go#L29

Added line #L29 was not covered by tests
}
marshaler := codec.NewProtoCodec(interfaceRegistry)
txCfg := tx.NewTxConfig(marshaler, tx.DefaultSignModes)
func (app *ChainApp) RegisterUpgradeHandlers(cdc codec.BinaryCodec, clientKeeper clientkeeper.Keeper) {
planName := "v5.0"
app.UpgradeKeeper.SetUpgradeHandler(planName, func(ctx context.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
return app.ModuleManager.RunMigrations(ctx, app.configurator, fromVM)

Check warning on line 17 in app/upgrades.go

Codecov / codecov/patch

app/upgrades.go#L17

Added line #L17 was not covered by tests
})
upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk()
}
if upgradeInfo.Name == planName && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) {
// configure store loader that checks if version == upgradeHeight and applies store upgrades
app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storetypes.StoreUpgrades{}))

Check warning on line 26 in app/upgrades.go

Codecov / codecov/patch

app/upgrades.go#L26

Added line #L26 was not covered by tests
}
}
keys map[string]*storetypes.KVStoreKey,
tkeys map[string]*storetypes.TransientStoreKey,
memKeys map[string]*storetypes.MemoryStoreKey,
) (storetypes.MultiStore, error) {

Check warning on line 20 in app/versiondb.go

Codecov / codecov/patch

app/versiondb.go#L20

Added line #L20 was not covered by tests
dataDir := filepath.Join(homePath, "data", "versiondb")
if err := os.MkdirAll(dataDir, os.ModePerm); err != nil {
return nil, err
}
// always listen for all keys to simplify configuration
exposedKeys := make([]storetypes.StoreKey, 0, len(keys))
for _, key := range keys {
exposedKeys = append(exposedKeys, key)

Check warning on line 33 in app/versiondb.go

Codecov / codecov/patch

app/versiondb.go#L31-L33

Added lines #L31 - L33 were not covered by tests
}
app.CommitMultiStore().AddListeners(exposedKeys)

Check warning on line 35 in app/versiondb.go

Codecov / codecov/patch

app/versiondb.go#L35

Added line #L35 was not covered by tests
// register in app streaming manager
app.SetStreamingManager(storetypes.StreamingManager{
ABCIListeners: []storetypes.ABCIListener{versiondb.NewStreamingService(versionDB)},
StopNodeOnErr: true,
})

Check warning on line 41 in app/versiondb.go

Codecov / codecov/patch

app/versiondb.go#L38-L41

Added lines #L38 - L41 were not covered by tests
delegatedStoreKeys := make(map[storetypes.StoreKey]struct{})
for _, k := range tkeys {
delegatedStoreKeys[k] = struct{}{}

Check warning on line 45 in app/versiondb.go

Codecov / codecov/patch

app/versiondb.go#L43-L45

Added lines #L43 - L45 were not covered by tests
}
for _, k := range memKeys {
delegatedStoreKeys[k] = struct{}{}

Check warning on line 48 in app/versiondb.go

Codecov / codecov/patch

app/versiondb.go#L47-L48

Added lines #L47 - L48 were not covered by tests
}
verDB := versiondb.NewMultiStore(app.CommitMultiStore(), versionDB, keys, delegatedStoreKeys)

Check warning on line 51 in app/versiondb.go

Codecov / codecov/patch

app/versiondb.go#L51

Added line #L51 was not covered by tests
app.SetQueryMultiStore(verDB)
return verDB, nil
}
keys map[string]*storetypes.KVStoreKey,
tkeys map[string]*storetypes.TransientStoreKey,
memKeys map[string]*storetypes.MemoryStoreKey,
) (storetypes.MultiStore, error) {

Check warning on line 17 in app/versiondb_placeholder.go

Codecov / codecov/patch

app/versiondb_placeholder.go#L17

Added line #L17 was not covered by tests
return nil, errors.New("versiondb is not supported in this binary")
}
isCheckTx bool,
patch func(*app.ChainApp, app.GenesisState) app.GenesisState,
appOptions simtestutil.AppOptionsMap,
) *app.ChainApp {
return SetupWithDBAndOpts(isCheckTx, patch, dbm.NewMemDB(), appOptions)

Check warning on line 49 in testutil/app.go

Codecov / codecov/patch

testutil/app.go#L48-L49

Added lines #L48 - L49 were not covered by tests
}
const ChainID = "chainmain-1"
// init chain must be called to stop deliverState from being nil
genesisState := NewTestGenesisState(app.AppCodec(), app.DefaultGenesis())
if patch != nil {
genesisState = patch(app, genesisState)

Check warning on line 82 in testutil/app.go

Codecov / codecov/patch

testutil/app.go#L82

Added line #L82 was not covered by tests
}
stateBytes, err := json.MarshalIndent(genesisState, "", " ")
if err != nil {
panic(err)

Check warning on line 87 in testutil/app.go

Codecov / codecov/patch

testutil/app.go#L87

Added line #L87 was not covered by tests
}
// Initialize the chain
InitialHeight: initialHeight,
},
); err != nil {
panic(err)

Check warning on line 103 in testutil/app.go

Codecov / codecov/patch

testutil/app.go#L103

Added line #L103 was not covered by tests
}
}
if _, err := app.FinalizeBlock(&abci.RequestFinalizeBlock{
Height: app.LastBlockHeight() + 1,
Hash: app.LastCommitID().Hash,
}); err != nil {
panic(err)

Check warning on line 110 in testutil/app.go

Codecov / codecov/patch

testutil/app.go#L110

Added line #L110 was not covered by tests
}
return app
}
func StateFn(a *app.ChainApp) simtypes.AppStateFn {
return simtestutil.AppStateFnWithExtendedCb(
a.AppCodec(), a.SimulationManager(), a.DefaultGenesis(), nil,
)

Check warning on line 118 in testutil/app.go

Codecov / codecov/patch

testutil/app.go#L115-L118

Added lines #L115 - L118 were not covered by tests
}
privVal := mock.NewPV()
pubKey, err := privVal.GetPubKey()
if err != nil {
panic(err)

Check warning on line 34 in testutil/base_test_suite.go

Codecov / codecov/patch

testutil/base_test_suite.go#L34

Added line #L34 was not covered by tests
}
// create validator set with single validator
validator := tmtypes.NewValidator(pubKey, 1)
for _, val := range valSet.Validators {
pk, err := cryptocodec.FromCmtPubKeyInterface(val.PubKey)
if err != nil {
panic(err)

Check warning on line 66 in testutil/base_test_suite.go

Codecov / codecov/patch

testutil/base_test_suite.go#L66

Added line #L66 was not covered by tests
}
pkAny, err := codectypes.NewAnyWithValue(pk)
if err != nil {
panic(err)

Check warning on line 70 in testutil/base_test_suite.go

Codecov / codecov/patch

testutil/base_test_suite.go#L70

Added line #L70 was not covered by tests
}
validator := stakingtypes.Validator{
OperatorAddress: sdk.ValAddress(val.Address).String(),
return clientErr
}
params := banktypes.NewQueryAllBalancesRequest(addr, pageReq, false)

Check warning on line 141 in x/chainmain/client/cli/query.go

Codecov / codecov/patch

x/chainmain/client/cli/query.go#L141

Added line #L141 was not covered by tests
res, allBalancesErr := queryClient.AllBalances(context.Background(), params)
if allBalancesErr != nil {
return allBalancesErr
baseAccount := authtypes.NewBaseAccount(addr, nil, 0, 0)
if !vestingCoins.IsZero() {
baseVestingAccount, err := authvesting.NewBaseVestingAccount(baseAccount, vestingCoins.Sort(), int64(vestingEnd))
if err != nil {
return fmt.Errorf("failed to create base vesting account: %w", err)

Check warning on line 301 in x/chainmain/client/cli/testnet.go

Codecov / codecov/patch

x/chainmain/client/cli/testnet.go#L299-L301

Added lines #L299 - L301 were not covered by tests
}
if (genbalance.Coins.IsZero() && !baseVestingAccount.OriginalVesting.IsZero()) ||
baseVestingAccount.OriginalVesting.IsAnyGT(genbalance.Coins) {
genAccounts = append(genAccounts, genAccount)
createValMsg, err2 := stakingtypes.NewMsgCreateValidator(
addr.String(),

Check warning on line 330 in x/chainmain/client/cli/testnet.go

Codecov / codecov/patch

x/chainmain/client/cli/testnet.go#L330

Added line #L330 was not covered by tests
valPubKeys[i],
stakingCoin,
stakingtypes.NewDescription(nodeDirName, "", "", "", ""),
stakingtypes.NewCommissionRates(sdkmath.LegacyNewDecWithPrec(1, 1), sdkmath.LegacyNewDecWithPrec(2, 1), sdkmath.LegacyNewDecWithPrec(1, 2)),
sdkmath.OneInt(),

Check warning on line 335 in x/chainmain/client/cli/testnet.go

Codecov / codecov/patch

x/chainmain/client/cli/testnet.go#L334-L335

Added lines #L334 - L335 were not covered by tests
)
if err2 != nil {
return err2
WithKeybase(kb).
WithTxConfig(clientCtx.TxConfig)
if err = tx.Sign(context.Background(), txFactory, nodeDirName, txBuilder, true); err != nil {

Check warning on line 355 in x/chainmain/client/cli/testnet.go

Codecov / codecov/patch

x/chainmain/client/cli/testnet.go#L355

Added line #L355 was not covered by tests
return err
}
err = collectGenFiles(
clientCtx, nodeConfig, chainID, nodeIDs, valPubKeys, numValidators,
outputDir, nodeDirPrefix, nodeDaemonHome, genBalIterator,
clientCtx.InterfaceRegistry.SigningContext().ValidatorAddressCodec(),

Check warning on line 380 in x/chainmain/client/cli/testnet.go

Codecov / codecov/patch

x/chainmain/client/cli/testnet.go#L380

Added line #L380 was not covered by tests
)
if err != nil {
return err
nodeID, valPubKey := nodeIDs[i], valPubKeys[i]
initCfg := genutiltypes.NewInitConfig(chainID, gentxsDir, nodeID, valPubKey)
genDoc, err := genutiltypes.AppGenesisFromFile(nodeConfig.GenesisFile())

Check warning on line 482 in x/chainmain/client/cli/testnet.go

Codecov / codecov/patch

x/chainmain/client/cli/testnet.go#L482

Added line #L482 was not covered by tests
if err != nil {
return err
}
nodeAppState, err := genutil.GenAppStateFromConfig(
clientCtx.Codec, clientCtx.TxConfig,
nodeConfig, initCfg, genDoc, genBalIterator, genutiltypes.DefaultMessageValidator,
valAddrCodec,
)

Check warning on line 491 in x/chainmain/client/cli/testnet.go

Codecov / codecov/patch

x/chainmain/client/cli/testnet.go#L489-L491

Added lines #L489 - L491 were not covered by tests
if err != nil {
return err
}
}
stakingCoin := sdk.Coin{
Denom: baseDenom,
Amount: sdkmath.ZeroInt(),

Check warning on line 559 in x/chainmain/client/cli/testnet.go

Codecov / codecov/patch

x/chainmain/client/cli/testnet.go#L559

Added line #L559 was not covered by tests
}
if stakingAmount == "" {
stakingCoin.Amount = halfCoins(coins)
}
// IsAppModule implements the appmodule.AppModule interface.
func (am AppModule) IsAppModule() {}

Check warning on line 130 in x/chainmain/module.go

Codecov / codecov/patch

x/chainmain/module.go#L130

Added line #L130 was not covered by tests
// IsOnePerModuleType implements the depinject.OnePerModuleType interface.
func (am AppModule) IsOnePerModuleType() {}

Check warning on line 133 in x/chainmain/module.go

Codecov / codecov/patch

x/chainmain/module.go#L133

Added line #L133 was not covered by tests
func (AppModule) ConsensusVersion() uint64 { return 1 }
// IsAppModule implements the appmodule.AppModule interface.
func (am AppModule) IsAppModule() {}

Check warning on line 146 in x/icaauth/module.go

Codecov / codecov/patch

x/icaauth/module.go#L146

Added line #L146 was not covered by tests
// IsOnePerModuleType implements the depinject.OnePerModuleType interface.
func (am AppModule) IsOnePerModuleType() {}

Check warning on line 149 in x/icaauth/module.go

Codecov / codecov/patch

x/icaauth/module.go#L149

Added line #L149 was not covered by tests
func (AppModule) ConsensusVersion() uint64 { return 1 }
// IsAppModule implements the appmodule.AppModule interface.
func (am AppModule) IsAppModule() {}

Check warning on line 126 in x/nft-transfer/module.go

Codecov / codecov/patch

x/nft-transfer/module.go#L126

Added line #L126 was not covered by tests
// IsOnePerModuleType implements the depinject.OnePerModuleType interface.
func (am AppModule) IsOnePerModuleType() {}

Check warning on line 129 in x/nft-transfer/module.go

Codecov / codecov/patch

x/nft-transfer/module.go#L129

Added line #L129 was not covered by tests
// AppModuleSimulation functions
func RandomizedGenState(simState *module.SimulationState) {
var portID string
simState.AppParams.GetOrGenerate(
port, &portID, simState.Rand,

Check warning on line 27 in x/nft-transfer/simulation/genesis.go

Codecov / codecov/patch

x/nft-transfer/simulation/genesis.go#L27

Added line #L27 was not covered by tests
func(r *rand.Rand) { portID = strings.ToLower(simtypes.RandStringOfLength(r, 20)) },
)
ctx := val.GetCtx()
appConfig := val.GetAppConfig()
return app.New(
ctx.Logger, dbm.NewMemDB(), nil, true,

Check warning on line 31 in x/nft/client/testutil/test_helpers.go

Codecov / codecov/patch

x/nft/client/testutil/test_helpers.go#L31

Added line #L31 was not covered by tests
simtestutil.EmptyAppOptions{},
baseapp.SetPruning(pruningtypes.NewPruningOptionsFromString(appConfig.Pruning)),
baseapp.SetMinGasPrices(appConfig.MinGasPrices),
baseapp.SetChainID(apptestutil.ChainID),

Check warning on line 35 in x/nft/client/testutil/test_helpers.go

Codecov / codecov/patch

x/nft/client/testutil/test_helpers.go#L35

Added line #L35 was not covered by tests
)
}
// GetOwner gets all the ID collections owned by an address and denom ID
func (k Keeper) GetOwner(ctx sdk.Context, address sdk.AccAddress, denom string) (types.Owner, error) {
store := ctx.KVStore(k.storeKey)
iterator := storetypes.KVStorePrefixIterator(store, types.KeyOwner(address, denom, ""))

Check warning on line 14 in x/nft/keeper/owners.go

Codecov / codecov/patch

x/nft/keeper/owners.go#L14

Added line #L14 was not covered by tests
defer iterator.Close()
owner := types.Owner{
}
// IsAppModule implements the appmodule.AppModule interface.
func (am AppModule) IsAppModule() {}

Check warning on line 141 in x/nft/module.go

Codecov / codecov/patch

x/nft/module.go#L141

Added line #L141 was not covered by tests
// IsOnePerModuleType implements the depinject.OnePerModuleType interface.
func (am AppModule) IsOnePerModuleType() {}

Check warning on line 144 in x/nft/module.go

Codecov / codecov/patch

x/nft/module.go#L144

Added line #L144 was not covered by tests
// ____________________________________________________________________________
) simulation.WeightedOperations {
var weightMint, weightEdit, weightBurn, weightTransfer int
appParams.GetOrGenerate(
OpWeightMsgMintNFT, &weightMint, nil,

Check warning on line 36 in x/nft/simulation/operations.go

Codecov / codecov/patch

x/nft/simulation/operations.go#L36

Added line #L36 was not covered by tests
func(_ *rand.Rand) {
weightMint = 100
},
)
appParams.GetOrGenerate(
OpWeightMsgEditNFT, &weightEdit, nil,

Check warning on line 43 in x/nft/simulation/operations.go

Codecov / codecov/patch

x/nft/simulation/operations.go#L43

Added line #L43 was not covered by tests
func(_ *rand.Rand) {
weightEdit = 50
},
)
appParams.GetOrGenerate(
OpWeightMsgTransferNFT, &weightTransfer, nil,

Check warning on line 50 in x/nft/simulation/operations.go

Codecov / codecov/patch

x/nft/simulation/operations.go#L50

Added line #L50 was not covered by tests
func(_ *rand.Rand) {
weightTransfer = 50
},
)
appParams.GetOrGenerate(
OpWeightMsgBurnNFT, &weightBurn, nil,

Check warning on line 57 in x/nft/simulation/operations.go

Codecov / codecov/patch

x/nft/simulation/operations.go#L57

Added line #L57 was not covered by tests
func(_ *rand.Rand) {
weightBurn = 10
},
}
// IsAppModule implements the appmodule.AppModule interface.
func (am AppModule) IsAppModule() {}

Check warning on line 118 in x/supply/module.go

Codecov / codecov/patch

x/supply/module.go#L118

Added line #L118 was not covered by tests
// IsOnePerModuleType implements the depinject.OnePerModuleType interface.
func (am AppModule) IsOnePerModuleType() {}

Check warning on line 121 in x/supply/module.go

Codecov / codecov/patch

x/supply/module.go#L121

Added line #L121 was not covered by tests
// InitGenesis performs the capability module's genesis initialization It returns
// no validator updates.