diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index c203ffc10d..07b6720d2b 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/setup-go@v4 with: - go-version: 1.18 + go-version: "1.20" - uses: actions/checkout@v3 - name: golangci-lint uses: golangci/golangci-lint-action@v3 @@ -26,21 +26,6 @@ jobs: # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version version: latest - # Optional: working directory, useful for monorepos - # working-directory: somedir - # Optional: golangci-lint command line arguments. args: --timeout=20m --skip-dirs legacy_ibc_testing - # Optional: show only new issues if it's a pull request. The default value is `false`. - # only-new-issues: true - - # Optional: if set to true then the all caching functionality will be complete disabled, - # takes precedence over all other caching options. - # skip-cache: true - - # Optional: if set to true then the action don't cache or restore ~/go/pkg. - # skip-pkg-cache: true - - # Optional: if set to true then the action don't cache or restore ~/.cache/go-build. - # skip-build-cache: true \ No newline at end of file diff --git a/.github/workflows/gosec.yml b/.github/workflows/gosec.yml deleted file mode 100644 index e59b4a252b..0000000000 --- a/.github/workflows/gosec.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: gosec -on: - push: - branches: - - main - pull_request: - branches: - - main -jobs: - tests: - runs-on: ubuntu-latest - env: - GO111MODULE: on - steps: - - name: Checkout Source - uses: actions/checkout@v3 - - name: Run Gosec Security Scanner - uses: securego/gosec@master - with: - args: -exclude-dir=legacy_ibc_testing ./... -exclude-generated ./... diff --git a/.golangci.yml b/.golangci.yml index 8167fa16c3..213a6a0d68 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,5 +1,87 @@ +run: + tests: true + timeout: 5m + + +linters: + disable-all: true + enable: + - depguard + - exportloopref + - goconst + - gocritic + - gofumpt + - gosec + - gosimple + - govet + - ineffassign + - misspell + - nakedret + - nolintlint + - staticcheck + - revive + - stylecheck + - typecheck + - unconvert + - unused + +issues: + max-issues-per-linter: 10000 + max-same-issues: 10000 + + linters-settings: - staticcheck: - checks: - - all - - "-SA1019" # cosmosEd25519 allowed in tests + gofumpt: + # Module path which contains the source code being formatted. + # Default: "" + module-path: github.com/cosmos/interchain-security + # Choose whether to use the extra rules. + # Default: false + extra-rules: true + revive: + ignore-generated-header: true + severity: error + enable-all-rules: true + rules: + - name: function-result-limit + disabled: true + - name: argument-limit + disabled: true + - name: function-length + disabled: true + - name: cyclomatic + disabled: true + - name: file-header + disabled: true + - name: max-public-structs + disabled: true + - name: cognitive-complexity + disabled: true + - name: line-length-limit + disabled: true + - name: banned-characters + disabled: true + - name: unhandled-error + arguments : ["fmt.Printf", "fmt.Println"] + - name: add-constant + disabled: true + - name: flag-parameter + disabled: true + - name: comment-spacings + disabled: true + - name: deep-exit + disabled: true + - name: defer + disabled: true + - name: nested-structs + disabled: true + - name: early-return + disabled: true + + + + + + + + diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000..4f9f951352 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "go.formatTool": "gofumpt", + "go.lintOnSave": "workspace", + "go.lintTool": "golangci-lint" +} \ No newline at end of file diff --git a/app/consumer-democracy/ante/forbidden_proposals_ante.go b/app/consumer-democracy/ante/forbidden_proposals_ante.go index 1f5c5671fd..dd1b3d5e1e 100644 --- a/app/consumer-democracy/ante/forbidden_proposals_ante.go +++ b/app/consumer-democracy/ante/forbidden_proposals_ante.go @@ -20,7 +20,7 @@ func (decorator ForbiddenProposalsDecorator) AnteHandle(ctx sdk.Context, tx sdk. for _, msg := range tx.GetMsgs() { submitProposalMgs, ok := msg.(*govtypes.MsgSubmitProposal) - //if the message is MsgSubmitProposal, check if proposal is whitelisted + // if the message is MsgSubmitProposal, check if proposal is whitelisted if ok { if !decorator.IsProposalWhitelisted(submitProposalMgs.GetContent()) { return ctx, fmt.Errorf("tx contains unsupported proposal message types at height %d", currHeight) diff --git a/app/consumer-democracy/ante/forbidden_proposals_ante_test.go b/app/consumer-democracy/ante/forbidden_proposals_ante_test.go index 2912a4aa5d..fc03bbbcde 100644 --- a/app/consumer-democracy/ante/forbidden_proposals_ante_test.go +++ b/app/consumer-democracy/ante/forbidden_proposals_ante_test.go @@ -28,7 +28,7 @@ func TestForbiddenProposalsDecorator(t *testing.T) { ctx: sdk.Context{}, msgs: []sdk.Msg{ newParamChangeProposalMsg([]proposal.ParamChange{ - //only subspace and key are relevant for testing + // only subspace and key are relevant for testing {Subspace: banktypes.ModuleName, Key: "SendEnabled", Value: ""}, }), }, diff --git a/app/consumer-democracy/ante_handler.go b/app/consumer-democracy/ante_handler.go index 9a7e4b1c72..af809944f4 100644 --- a/app/consumer-democracy/ante_handler.go +++ b/app/consumer-democracy/ante_handler.go @@ -31,7 +31,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder") } - var sigGasConsumer = options.SigGasConsumer + sigGasConsumer := options.SigGasConsumer if sigGasConsumer == nil { sigGasConsumer = ante.DefaultSigVerificationGasConsumer } diff --git a/app/consumer-democracy/app.go b/app/consumer-democracy/app.go index 9d62521041..2dc02d4db5 100644 --- a/app/consumer-democracy/app.go +++ b/app/consumer-democracy/app.go @@ -54,6 +54,7 @@ import ( paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" + appparams "github.com/cosmos/interchain-security/app/consumer-democracy/params" "github.com/cosmos/cosmos-sdk/x/slashing" slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" @@ -74,7 +75,6 @@ import ( "github.com/gorilla/mux" "github.com/rakyll/statik/fs" "github.com/spf13/cast" - "github.com/tendermint/spm/cosmoscmd" abci "github.com/tendermint/tendermint/abci/types" tmjson "github.com/tendermint/tendermint/libs/json" "github.com/tendermint/tendermint/libs/log" @@ -145,7 +145,7 @@ var ( evidence.AppModuleBasic{}, transfer.AppModuleBasic{}, vesting.AppModuleBasic{}, - //router.AppModuleBasic{}, + // router.AppModuleBasic{}, consumer.AppModuleBasic{}, ) @@ -166,14 +166,13 @@ var ( var ( _ simapp.App = (*App)(nil) _ servertypes.Application = (*App)(nil) - _ cosmoscmd.CosmosApp = (*App)(nil) - _ ibctesting.TestingApp = (*App)(nil) + _ ibctesting.AppTest = (*App)(nil) ) // App extends an ABCI application, but with most of its parameters exported. // They are exported for convenience in creating helper functions, as object // capabilities aren't needed for testing. -type App struct { // nolint: golint +type App struct { //nolint: golint *baseapp.BaseApp legacyAmino *codec.LegacyAmino appCodec codec.Codec @@ -236,12 +235,11 @@ func New( skipUpgradeHeights map[int64]bool, homePath string, invCheckPeriod uint, - encodingConfig cosmoscmd.EncodingConfig, + encodingConfig appparams.EncodingConfig, appOpts servertypes.AppOptions, baseAppOptions ...func(*baseapp.BaseApp), -) cosmoscmd.App { - - appCodec := encodingConfig.Marshaler +) *App { + appCodec := encodingConfig.Codec legacyAmino := encodingConfig.Amino interfaceRegistry := encodingConfig.InterfaceRegistry @@ -694,7 +692,7 @@ func (app *App) LoadHeight(height int64) error { } // ModuleAccountAddrs returns all the app's module account addresses. -func (app *App) ModuleAccountAddrs() map[string]bool { +func (*App) ModuleAccountAddrs() map[string]bool { modAccAddrs := make(map[string]bool) for acc := range maccPerms { modAccAddrs[authtypes.NewModuleAddress(acc).String()] = true @@ -766,42 +764,42 @@ func (app *App) GetConsumerKeeper() consumerkeeper.Keeper { } // GetE2eBankKeeper implements the ConsumerApp interface. -func (app *App) GetE2eBankKeeper() e2e.E2eBankKeeper { +func (app *App) GetE2eBankKeeper() e2e.BankKeeper { return app.BankKeeper } // GetE2eAccountKeeper implements the ConsumerApp interface. -func (app *App) GetE2eAccountKeeper() e2e.E2eAccountKeeper { +func (app *App) GetE2eAccountKeeper() e2e.AccountKeeper { return app.AccountKeeper } // GetE2eSlashingKeeper implements the ConsumerApp interface. -func (app *App) GetE2eSlashingKeeper() e2e.E2eSlashingKeeper { +func (app *App) GetE2eSlashingKeeper() e2e.SlashingKeeper { return app.SlashingKeeper } // GetE2eEvidenceKeeper implements the ConsumerApp interface. -func (app *App) GetE2eEvidenceKeeper() e2e.E2eEvidenceKeeper { +func (app *App) GetE2eEvidenceKeeper() e2e.EvidenceKeeper { return app.EvidenceKeeper } // GetE2eStakingKeeper implements the ConsumerApp interface. -func (app *App) GetE2eStakingKeeper() e2e.E2eStakingKeeper { +func (app *App) GetE2eStakingKeeper() e2e.StakingKeeper { return app.StakingKeeper } // GetE2eDistributionKeeper implements the ConsumerApp interface. -func (app *App) GetE2eDistributionKeeper() e2e.E2eDistributionKeeper { +func (app *App) GetE2eDistributionKeeper() e2e.DistributionKeeper { return app.DistrKeeper } // GetE2eMintKeeper implements the ConsumerApp interface. -func (app *App) GetE2eMintKeeper() e2e.E2eMintKeeper { +func (app *App) GetE2eMintKeeper() e2e.MintKeeper { return app.MintKeeper } // GetE2eGovKeeper implements the ConsumerApp interface. -func (app *App) GetE2eGovKeeper() e2e.E2eGovKeeper { +func (app *App) GetE2eGovKeeper() e2e.GovKeeper { return app.GovKeeper } @@ -828,13 +826,13 @@ func (app *App) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper { } // GetTxConfig implements the TestingApp interface. -func (app *App) GetTxConfig() client.TxConfig { - return cosmoscmd.MakeEncodingConfig(ModuleBasics).TxConfig +func (*App) GetTxConfig() client.TxConfig { + return appparams.MakeEncodingConfig().TxConfig } // RegisterAPIRoutes registers all application module routes with the provided // API server. -func (app *App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { +func (*App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { clientCtx := apiSvr.ClientCtx rpc.RegisterRoutes(clientCtx, apiSvr.Router) // Register legacy tx routes. diff --git a/app/consumer-democracy/export.go b/app/consumer-democracy/export.go index 6f7f565239..bd4fc7802b 100644 --- a/app/consumer-democracy/export.go +++ b/app/consumer-democracy/export.go @@ -15,9 +15,8 @@ import ( // ExportAppStateAndValidators exports the state of the application for a genesis // file. func (app *App) ExportAppStateAndValidators( - forZeroHeight bool, jailAllowedAddrs []string, + forZeroHeight bool, _ []string, ) (servertypes.ExportedApp, error) { - // as if they could withdraw from the start of the next block ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()}) @@ -26,7 +25,7 @@ func (app *App) ExportAppStateAndValidators( height := app.LastBlockHeight() + 1 if forZeroHeight { height = 0 - app.prepForZeroHeightGenesis(ctx, jailAllowedAddrs) + app.prepForZeroHeightGenesis(ctx) } genState := app.MM.ExportGenesis(ctx, app.appCodec) @@ -51,7 +50,7 @@ func (app *App) ExportAppStateAndValidators( // NOTE zero height genesis is a temporary feature which will be deprecated // // in favour of export at a block height -func (app *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) { +func (app *App) prepForZeroHeightGenesis(ctx sdk.Context) { // applyAllowedAddrs := false // check if there is a allowed address list diff --git a/app/consumer-democracy/params/config.go b/app/consumer-democracy/params/config.go new file mode 100644 index 0000000000..1cd7461fba --- /dev/null +++ b/app/consumer-democracy/params/config.go @@ -0,0 +1,35 @@ +package params + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var ( + Bech32Prefix = "democracy" + + // Bech32PrefixAccAddr defines the Bech32 prefix of an account's address + Bech32PrefixAccAddr = Bech32Prefix + // Bech32PrefixAccPub defines the Bech32 prefix of an account's public key + Bech32PrefixAccPub = Bech32Prefix + sdk.PrefixPublic + // Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address + Bech32PrefixValAddr = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixOperator + // Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key + Bech32PrefixValPub = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixOperator + sdk.PrefixPublic + // Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address + Bech32PrefixConsAddr = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus + // Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key + Bech32PrefixConsPub = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus + sdk.PrefixPublic +) + +// SetAddressPrefixes builds the Config with Bech32 addressPrefix and publKeyPrefix for accounts, validators, and consensus nodes and verifies that addreeses have correct format. +// Not sealed yet +func SetAddressPrefixes() { + cfg := sdk.GetConfig() + cfg.SetBech32PrefixForAccount(Bech32PrefixAccAddr, Bech32PrefixAccPub) + cfg.SetBech32PrefixForValidator(Bech32PrefixValAddr, Bech32PrefixValPub) + cfg.SetBech32PrefixForConsensusNode(Bech32PrefixConsAddr, Bech32PrefixConsPub) +} + +func init() { + SetAddressPrefixes() +} diff --git a/app/consumer-democracy/params/doc.go b/app/consumer-democracy/params/doc.go new file mode 100644 index 0000000000..7c6035cadc --- /dev/null +++ b/app/consumer-democracy/params/doc.go @@ -0,0 +1,19 @@ +/* +Package params defines the simulation parameters in the gaia. + +It contains the default weights used for each transaction used on the module's +simulation. These weights define the chance for a transaction to be simulated at +any gived operation. + +You can repace the default values for the weights by providing a params.json +file with the weights defined for each of the transaction operations: + + { + "op_weight_msg_send": 60, + "op_weight_msg_delegate": 100, + } + +In the example above, the `MsgSend` has 60% chance to be simulated, while the +`MsgDelegate` will always be simulated. +*/ +package params diff --git a/app/consumer-democracy/params/encoding.go b/app/consumer-democracy/params/encoding.go new file mode 100644 index 0000000000..8ff9ea04b3 --- /dev/null +++ b/app/consumer-democracy/params/encoding.go @@ -0,0 +1,16 @@ +package params + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/types" +) + +// EncodingConfig specifies the concrete encoding types to use for a given app. +// This is provided for compatibility between protobuf and amino implementations. +type EncodingConfig struct { + InterfaceRegistry types.InterfaceRegistry + Codec codec.Codec + TxConfig client.TxConfig + Amino *codec.LegacyAmino +} diff --git a/app/consumer-democracy/params/params.go b/app/consumer-democracy/params/params.go new file mode 100644 index 0000000000..b6aa5fb55e --- /dev/null +++ b/app/consumer-democracy/params/params.go @@ -0,0 +1,7 @@ +package params + +// Simulation parameter constants +const ( + StakePerAccount = "stake_per_account" + InitiallyBondedValidators = "initially_bonded_validators" +) diff --git a/app/consumer-democracy/params/proto.go b/app/consumer-democracy/params/proto.go new file mode 100644 index 0000000000..a0e34aab16 --- /dev/null +++ b/app/consumer-democracy/params/proto.go @@ -0,0 +1,22 @@ +package params + +import ( + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/x/auth/tx" +) + +// MakeEncodingConfig creates an EncodingConfig for an amino based test configuration. +func MakeEncodingConfig() EncodingConfig { + amino := codec.NewLegacyAmino() + interfaceRegistry := types.NewInterfaceRegistry() + chainCodec := codec.NewProtoCodec(interfaceRegistry) + txCfg := tx.NewTxConfig(chainCodec, tx.DefaultSignModes) + + return EncodingConfig{ + InterfaceRegistry: interfaceRegistry, + Codec: chainCodec, + TxConfig: txCfg, + Amino: amino, + } +} diff --git a/app/consumer-democracy/params/weights.go b/app/consumer-democracy/params/weights.go new file mode 100644 index 0000000000..4e5452c9b2 --- /dev/null +++ b/app/consumer-democracy/params/weights.go @@ -0,0 +1,42 @@ +package params + +// Default simulation operation weights for messages and gov proposals +const ( + DefaultWeightMsgSend int = 100 + DefaultWeightMsgMultiSend int = 10 + DefaultWeightMsgSetWithdrawAddress int = 50 + DefaultWeightMsgWithdrawDelegationReward int = 50 + DefaultWeightMsgWithdrawValidatorCommission int = 50 + DefaultWeightMsgFundCommunityPool int = 50 + DefaultWeightMsgDeposit int = 100 + DefaultWeightMsgVote int = 67 + DefaultWeightMsgUnjail int = 100 + DefaultWeightMsgCreateValidator int = 100 + DefaultWeightMsgEditValidator int = 5 + DefaultWeightMsgDelegate int = 100 + DefaultWeightMsgUndelegate int = 100 + DefaultWeightMsgBeginRedelegate int = 100 + + DefaultWeightCommunitySpendProposal int = 5 + DefaultWeightTextProposal int = 5 + DefaultWeightParamChangeProposal int = 5 + + DefaultWeightMsgStoreCode int = 50 + DefaultWeightMsgInstantiateContract int = 100 + DefaultWeightMsgExecuteContract int = 100 + DefaultWeightMsgUpdateAdmin int = 25 + DefaultWeightMsgClearAdmin int = 10 + DefaultWeightMsgMigrateContract int = 50 + + DefaultWeightStoreCodeProposal int = 5 + DefaultWeightInstantiateContractProposal int = 5 + DefaultWeightUpdateAdminProposal int = 5 + DefaultWeightExecuteContractProposal int = 5 + DefaultWeightClearAdminProposal int = 5 + DefaultWeightMigrateContractProposal int = 5 + DefaultWeightSudoContractProposal int = 5 + DefaultWeightPinCodesProposal int = 5 + DefaultWeightUnpinCodesProposal int = 5 + DefaultWeightUpdateInstantiateConfigProposal int = 5 + DefaultWeightStoreAndInstantiateContractProposal int = 5 +) diff --git a/app/consumer-democracy/proposals_whitelisting.go b/app/consumer-democracy/proposals_whitelisting.go index 337e141ce6..3f6f65b17f 100644 --- a/app/consumer-democracy/proposals_whitelisting.go +++ b/app/consumer-democracy/proposals_whitelisting.go @@ -11,7 +11,6 @@ import ( ) func IsProposalWhitelisted(content govtypes.Content) bool { - switch c := content.(type) { case *proposal.ParameterChangeProposal: return isParamChangeWhitelisted(c.Changes) @@ -19,7 +18,6 @@ func IsProposalWhitelisted(content govtypes.Content) bool { default: return false } - } func isParamChangeWhitelisted(paramChanges []proposal.ParamChange) bool { @@ -37,32 +35,32 @@ type paramChangeKey struct { } var WhitelistedParams = map[paramChangeKey]struct{}{ - //bank + // bank {Subspace: banktypes.ModuleName, Key: "SendEnabled"}: {}, - //governance - {Subspace: govtypes.ModuleName, Key: "depositparams"}: {}, //min_deposit, max_deposit_period - {Subspace: govtypes.ModuleName, Key: "votingparams"}: {}, //voting_period - {Subspace: govtypes.ModuleName, Key: "tallyparams"}: {}, //quorum,threshold,veto_threshold - //staking + // governance + {Subspace: govtypes.ModuleName, Key: "depositparams"}: {}, // min_deposit, max_deposit_period + {Subspace: govtypes.ModuleName, Key: "votingparams"}: {}, // voting_period + {Subspace: govtypes.ModuleName, Key: "tallyparams"}: {}, // quorum,threshold,veto_threshold + // staking {Subspace: stakingtypes.ModuleName, Key: "UnbondingTime"}: {}, {Subspace: stakingtypes.ModuleName, Key: "MaxValidators"}: {}, {Subspace: stakingtypes.ModuleName, Key: "MaxEntries"}: {}, {Subspace: stakingtypes.ModuleName, Key: "HistoricalEntries"}: {}, {Subspace: stakingtypes.ModuleName, Key: "BondDenom"}: {}, - //distribution + // distribution {Subspace: distrtypes.ModuleName, Key: "communitytax"}: {}, {Subspace: distrtypes.ModuleName, Key: "baseproposerreward"}: {}, {Subspace: distrtypes.ModuleName, Key: "bonusproposerreward"}: {}, {Subspace: distrtypes.ModuleName, Key: "withdrawaddrenabled"}: {}, - //mint + // mint {Subspace: minttypes.ModuleName, Key: "MintDenom"}: {}, {Subspace: minttypes.ModuleName, Key: "InflationRateChange"}: {}, {Subspace: minttypes.ModuleName, Key: "InflationMax"}: {}, {Subspace: minttypes.ModuleName, Key: "InflationMin"}: {}, {Subspace: minttypes.ModuleName, Key: "GoalBonded"}: {}, {Subspace: minttypes.ModuleName, Key: "BlocksPerYear"}: {}, - //ibc transfer + // ibc transfer {Subspace: ibctransfertypes.ModuleName, Key: "SendEnabled"}: {}, {Subspace: ibctransfertypes.ModuleName, Key: "ReceiveEnabled"}: {}, - //add interchain account params(HostEnabled, AllowedMessages) once the module is added to the consumer app + // add interchain account params(HostEnabled, AllowedMessages) once the module is added to the consumer app } diff --git a/app/consumer-democracy/proposals_whitelisting_test.go b/app/consumer-democracy/proposals_whitelisting_test.go index a485881b81..d3240e8556 100644 --- a/app/consumer-democracy/proposals_whitelisting_test.go +++ b/app/consumer-democracy/proposals_whitelisting_test.go @@ -5,7 +5,7 @@ import ( appConsumer "github.com/cosmos/interchain-security/app/consumer-democracy" ibctesting "github.com/cosmos/interchain-security/legacy_ibc_testing/testing" - icstestingutils "github.com/cosmos/interchain-security/testutil/ibc_testing" + icstestingutils "github.com/cosmos/interchain-security/testutil/ibctesting" "github.com/stretchr/testify/require" ) diff --git a/app/consumer/ante/disabled_modules_ante_test.go b/app/consumer/ante/disabled_modules_ante_test.go index 31316f5856..f1c37a4899 100644 --- a/app/consumer/ante/disabled_modules_ante_test.go +++ b/app/consumer/ante/disabled_modules_ante_test.go @@ -8,14 +8,13 @@ import ( evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" ibcclienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" - appconsumer "github.com/cosmos/interchain-security/app/consumer" "github.com/cosmos/interchain-security/app/consumer/ante" + appparams "github.com/cosmos/interchain-security/app/consumer/params" "github.com/stretchr/testify/require" - "github.com/tendermint/spm/cosmoscmd" ) func TestDisabledModulesDecorator(t *testing.T) { - txCfg := cosmoscmd.MakeEncodingConfig(appconsumer.ModuleBasics).TxConfig + txCfg := appparams.MakeEncodingConfig().TxConfig testCases := []struct { name string diff --git a/app/consumer/ante/msg_filter_ante_test.go b/app/consumer/ante/msg_filter_ante_test.go index 517415147c..d7c7f5f1c3 100644 --- a/app/consumer/ante/msg_filter_ante_test.go +++ b/app/consumer/ante/msg_filter_ante_test.go @@ -6,10 +6,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" ibcclienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" - appconsumer "github.com/cosmos/interchain-security/app/consumer" "github.com/cosmos/interchain-security/app/consumer/ante" + appparams "github.com/cosmos/interchain-security/app/consumer/params" "github.com/stretchr/testify/require" - "github.com/tendermint/spm/cosmoscmd" ) type consumerKeeper struct { @@ -27,7 +26,7 @@ func noOpAnteDecorator() sdk.AnteHandler { } func TestMsgFilterDecorator(t *testing.T) { - txCfg := cosmoscmd.MakeEncodingConfig(appconsumer.ModuleBasics).TxConfig + txCfg := appparams.MakeEncodingConfig().TxConfig testCases := []struct { name string diff --git a/app/consumer/ante_handler.go b/app/consumer/ante_handler.go index 4e4df1fe48..66fcae73c7 100644 --- a/app/consumer/ante_handler.go +++ b/app/consumer/ante_handler.go @@ -30,7 +30,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder") } - var sigGasConsumer = options.SigGasConsumer + sigGasConsumer := options.SigGasConsumer if sigGasConsumer == nil { sigGasConsumer = ante.DefaultSigVerificationGasConsumer } diff --git a/app/consumer/app.go b/app/consumer/app.go index 00cfe5b27d..49e046e7ac 100644 --- a/app/consumer/app.go +++ b/app/consumer/app.go @@ -66,12 +66,12 @@ import ( porttypes "github.com/cosmos/ibc-go/v4/modules/core/05-port/types" ibchost "github.com/cosmos/ibc-go/v4/modules/core/24-host" ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper" + appparams "github.com/cosmos/interchain-security/app/consumer/params" ibctestingcore "github.com/cosmos/interchain-security/legacy_ibc_testing/core" ibctesting "github.com/cosmos/interchain-security/legacy_ibc_testing/testing" "github.com/gorilla/mux" "github.com/rakyll/statik/fs" "github.com/spf13/cast" - "github.com/tendermint/spm/cosmoscmd" abci "github.com/tendermint/tendermint/abci/types" tmjson "github.com/tendermint/tendermint/libs/json" "github.com/tendermint/tendermint/libs/log" @@ -114,7 +114,7 @@ var ( evidence.AppModuleBasic{}, transfer.AppModuleBasic{}, vesting.AppModuleBasic{}, - //router.AppModuleBasic{}, + // router.AppModuleBasic{}, ibcconsumer.AppModuleBasic{}, ) @@ -130,14 +130,13 @@ var ( var ( _ simapp.App = (*App)(nil) _ servertypes.Application = (*App)(nil) - _ cosmoscmd.CosmosApp = (*App)(nil) - _ ibctesting.TestingApp = (*App)(nil) + _ ibctesting.AppTest = (*App)(nil) ) // App extends an ABCI application, but with most of its parameters exported. // They are exported for convenience in creating helper functions, as object // capabilities aren't needed for testing. -type App struct { // nolint: golint +type App struct { //nolint: golint *baseapp.BaseApp legacyAmino *codec.LegacyAmino appCodec codec.Codec @@ -157,7 +156,7 @@ type App struct { // nolint: golint SlashingKeeper slashingkeeper.Keeper // NOTE the distribution keeper should either be removed - // from consumer chain or set to use an independant + // from consumer chain or set to use an independent // different fee-pool from the consumer chain ConsumerKeeper CrisisKeeper crisiskeeper.Keeper @@ -201,12 +200,11 @@ func New( skipUpgradeHeights map[int64]bool, homePath string, invCheckPeriod uint, - encodingConfig cosmoscmd.EncodingConfig, + encodingConfig appparams.EncodingConfig, appOpts servertypes.AppOptions, baseAppOptions ...func(*baseapp.BaseApp), -) cosmoscmd.App { - - appCodec := encodingConfig.Marshaler +) *App { + appCodec := encodingConfig.Codec legacyAmino := encodingConfig.Amino interfaceRegistry := encodingConfig.InterfaceRegistry @@ -582,7 +580,7 @@ func (app *App) LoadHeight(height int64) error { } // ModuleAccountAddrs returns all the app's module account addresses. -func (app *App) ModuleAccountAddrs() map[string]bool { +func (*App) ModuleAccountAddrs() map[string]bool { modAccAddrs := make(map[string]bool) for acc := range maccPerms { modAccAddrs[authtypes.NewModuleAddress(acc).String()] = true @@ -654,22 +652,22 @@ func (app *App) GetConsumerKeeper() ibcconsumerkeeper.Keeper { } // GetE2eBankKeeper implements the ConsumerApp interface. -func (app *App) GetE2eBankKeeper() e2e.E2eBankKeeper { +func (app *App) GetE2eBankKeeper() e2e.BankKeeper { return app.BankKeeper } // GetE2eAccountKeeper implements the ConsumerApp interface. -func (app *App) GetE2eAccountKeeper() e2e.E2eAccountKeeper { +func (app *App) GetE2eAccountKeeper() e2e.AccountKeeper { return app.AccountKeeper } // GetE2eSlashingKeeper implements the ConsumerApp interface. -func (app *App) GetE2eSlashingKeeper() e2e.E2eSlashingKeeper { +func (app *App) GetE2eSlashingKeeper() e2e.SlashingKeeper { return app.SlashingKeeper } // GetE2eEvidenceKeeper implements the ConsumerApp interface. -func (app *App) GetE2eEvidenceKeeper() e2e.E2eEvidenceKeeper { +func (app *App) GetE2eEvidenceKeeper() e2e.EvidenceKeeper { return app.EvidenceKeeper } @@ -696,13 +694,13 @@ func (app *App) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper { } // GetTxConfig implements the TestingApp interface. -func (app *App) GetTxConfig() client.TxConfig { - return cosmoscmd.MakeEncodingConfig(ModuleBasics).TxConfig +func (*App) GetTxConfig() client.TxConfig { + return appparams.MakeEncodingConfig().TxConfig } // RegisterAPIRoutes registers all application module routes with the provided // API server. -func (app *App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { +func (*App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { clientCtx := apiSvr.ClientCtx rpc.RegisterRoutes(clientCtx, apiSvr.Router) // Register legacy tx routes. diff --git a/app/consumer/export.go b/app/consumer/export.go index 297072cf1c..c5a1eff8ab 100644 --- a/app/consumer/export.go +++ b/app/consumer/export.go @@ -15,9 +15,8 @@ import ( // ExportAppStateAndValidators implements the simapp app interface // by exporting the state of the application func (app *App) ExportAppStateAndValidators( - forZeroHeight bool, jailAllowedAddrs []string, + forZeroHeight bool, _ []string, ) (servertypes.ExportedApp, error) { - // as if they could withdraw from the start of the next block ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()}) @@ -26,7 +25,7 @@ func (app *App) ExportAppStateAndValidators( height := app.LastBlockHeight() + 1 if forZeroHeight { height = 0 - app.prepForZeroHeightGenesis(ctx, jailAllowedAddrs) + app.prepForZeroHeightGenesis(ctx) } genState := app.MM.ExportGenesis(ctx, app.appCodec) @@ -52,8 +51,7 @@ func (app *App) ExportAppStateAndValidators( // NOTE zero height genesis is a temporary feature which will be deprecated // // in favour of export at a block height -func (app *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) { - +func (app *App) prepForZeroHeightGenesis(ctx sdk.Context) { /* Just to be safe, assert the invariants on current state. */ app.CrisisKeeper.AssertInvariants(ctx) diff --git a/app/consumer/params/config.go b/app/consumer/params/config.go new file mode 100644 index 0000000000..ff85f2e9fc --- /dev/null +++ b/app/consumer/params/config.go @@ -0,0 +1,35 @@ +package params + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var ( + Bech32Prefix = "consumer" + + // Bech32PrefixAccAddr defines the Bech32 prefix of an account's address + Bech32PrefixAccAddr = Bech32Prefix + // Bech32PrefixAccPub defines the Bech32 prefix of an account's public key + Bech32PrefixAccPub = Bech32Prefix + sdk.PrefixPublic + // Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address + Bech32PrefixValAddr = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixOperator + // Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key + Bech32PrefixValPub = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixOperator + sdk.PrefixPublic + // Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address + Bech32PrefixConsAddr = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus + // Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key + Bech32PrefixConsPub = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus + sdk.PrefixPublic +) + +// SetAddressPrefixes builds the Config with Bech32 addressPrefix and publKeyPrefix for accounts, validators, and consensus nodes and verifies that addreeses have correct format. +// Not sealed yet +func SetAddressPrefixes() { + cfg := sdk.GetConfig() + cfg.SetBech32PrefixForAccount(Bech32PrefixAccAddr, Bech32PrefixAccPub) + cfg.SetBech32PrefixForValidator(Bech32PrefixValAddr, Bech32PrefixValPub) + cfg.SetBech32PrefixForConsensusNode(Bech32PrefixConsAddr, Bech32PrefixConsPub) +} + +func init() { + SetAddressPrefixes() +} diff --git a/app/consumer/params/doc.go b/app/consumer/params/doc.go new file mode 100644 index 0000000000..7c6035cadc --- /dev/null +++ b/app/consumer/params/doc.go @@ -0,0 +1,19 @@ +/* +Package params defines the simulation parameters in the gaia. + +It contains the default weights used for each transaction used on the module's +simulation. These weights define the chance for a transaction to be simulated at +any gived operation. + +You can repace the default values for the weights by providing a params.json +file with the weights defined for each of the transaction operations: + + { + "op_weight_msg_send": 60, + "op_weight_msg_delegate": 100, + } + +In the example above, the `MsgSend` has 60% chance to be simulated, while the +`MsgDelegate` will always be simulated. +*/ +package params diff --git a/app/consumer/params/encoding.go b/app/consumer/params/encoding.go new file mode 100644 index 0000000000..8ff9ea04b3 --- /dev/null +++ b/app/consumer/params/encoding.go @@ -0,0 +1,16 @@ +package params + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/types" +) + +// EncodingConfig specifies the concrete encoding types to use for a given app. +// This is provided for compatibility between protobuf and amino implementations. +type EncodingConfig struct { + InterfaceRegistry types.InterfaceRegistry + Codec codec.Codec + TxConfig client.TxConfig + Amino *codec.LegacyAmino +} diff --git a/app/consumer/params/params.go b/app/consumer/params/params.go new file mode 100644 index 0000000000..b6aa5fb55e --- /dev/null +++ b/app/consumer/params/params.go @@ -0,0 +1,7 @@ +package params + +// Simulation parameter constants +const ( + StakePerAccount = "stake_per_account" + InitiallyBondedValidators = "initially_bonded_validators" +) diff --git a/app/consumer/params/proto.go b/app/consumer/params/proto.go new file mode 100644 index 0000000000..a0e34aab16 --- /dev/null +++ b/app/consumer/params/proto.go @@ -0,0 +1,22 @@ +package params + +import ( + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/x/auth/tx" +) + +// MakeEncodingConfig creates an EncodingConfig for an amino based test configuration. +func MakeEncodingConfig() EncodingConfig { + amino := codec.NewLegacyAmino() + interfaceRegistry := types.NewInterfaceRegistry() + chainCodec := codec.NewProtoCodec(interfaceRegistry) + txCfg := tx.NewTxConfig(chainCodec, tx.DefaultSignModes) + + return EncodingConfig{ + InterfaceRegistry: interfaceRegistry, + Codec: chainCodec, + TxConfig: txCfg, + Amino: amino, + } +} diff --git a/app/consumer/params/weights.go b/app/consumer/params/weights.go new file mode 100644 index 0000000000..4e5452c9b2 --- /dev/null +++ b/app/consumer/params/weights.go @@ -0,0 +1,42 @@ +package params + +// Default simulation operation weights for messages and gov proposals +const ( + DefaultWeightMsgSend int = 100 + DefaultWeightMsgMultiSend int = 10 + DefaultWeightMsgSetWithdrawAddress int = 50 + DefaultWeightMsgWithdrawDelegationReward int = 50 + DefaultWeightMsgWithdrawValidatorCommission int = 50 + DefaultWeightMsgFundCommunityPool int = 50 + DefaultWeightMsgDeposit int = 100 + DefaultWeightMsgVote int = 67 + DefaultWeightMsgUnjail int = 100 + DefaultWeightMsgCreateValidator int = 100 + DefaultWeightMsgEditValidator int = 5 + DefaultWeightMsgDelegate int = 100 + DefaultWeightMsgUndelegate int = 100 + DefaultWeightMsgBeginRedelegate int = 100 + + DefaultWeightCommunitySpendProposal int = 5 + DefaultWeightTextProposal int = 5 + DefaultWeightParamChangeProposal int = 5 + + DefaultWeightMsgStoreCode int = 50 + DefaultWeightMsgInstantiateContract int = 100 + DefaultWeightMsgExecuteContract int = 100 + DefaultWeightMsgUpdateAdmin int = 25 + DefaultWeightMsgClearAdmin int = 10 + DefaultWeightMsgMigrateContract int = 50 + + DefaultWeightStoreCodeProposal int = 5 + DefaultWeightInstantiateContractProposal int = 5 + DefaultWeightUpdateAdminProposal int = 5 + DefaultWeightExecuteContractProposal int = 5 + DefaultWeightClearAdminProposal int = 5 + DefaultWeightMigrateContractProposal int = 5 + DefaultWeightSudoContractProposal int = 5 + DefaultWeightPinCodesProposal int = 5 + DefaultWeightUnpinCodesProposal int = 5 + DefaultWeightUpdateInstantiateConfigProposal int = 5 + DefaultWeightStoreAndInstantiateContractProposal int = 5 +) diff --git a/app/provider/ante_handler.go b/app/provider/ante_handler.go index 3c468ce840..7e306ddd00 100644 --- a/app/provider/ante_handler.go +++ b/app/provider/ante_handler.go @@ -27,7 +27,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder") } - var sigGasConsumer = options.SigGasConsumer + sigGasConsumer := options.SigGasConsumer if sigGasConsumer == nil { sigGasConsumer = ante.DefaultSigVerificationGasConsumer } diff --git a/app/provider/app.go b/app/provider/app.go index 2037ee131a..243d3c0ccf 100644 --- a/app/provider/app.go +++ b/app/provider/app.go @@ -81,12 +81,14 @@ import ( porttypes "github.com/cosmos/ibc-go/v4/modules/core/05-port/types" ibchost "github.com/cosmos/ibc-go/v4/modules/core/24-host" ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper" + appparams "github.com/cosmos/interchain-security/app/provider/params" ibctestingcore "github.com/cosmos/interchain-security/legacy_ibc_testing/core" ibctesting "github.com/cosmos/interchain-security/legacy_ibc_testing/testing" "github.com/gorilla/mux" "github.com/rakyll/statik/fs" "github.com/spf13/cast" + "github.com/tendermint/spm/cosmoscmd" abci "github.com/tendermint/tendermint/abci/types" tmjson "github.com/tendermint/tendermint/libs/json" "github.com/tendermint/tendermint/libs/log" @@ -100,8 +102,6 @@ import ( e2e "github.com/cosmos/interchain-security/testutil/e2e" - "github.com/tendermint/spm/cosmoscmd" - // unnamed import of statik for swagger UI support _ "github.com/cosmos/cosmos-sdk/client/docs/statik" ) @@ -148,7 +148,7 @@ var ( evidence.AppModuleBasic{}, transfer.AppModuleBasic{}, vesting.AppModuleBasic{}, - //router.AppModuleBasic{}, + // router.AppModuleBasic{}, ibcprovider.AppModuleBasic{}, ) @@ -167,14 +167,13 @@ var ( var ( _ simapp.App = (*App)(nil) _ servertypes.Application = (*App)(nil) - _ cosmoscmd.CosmosApp = (*App)(nil) - _ ibctesting.TestingApp = (*App)(nil) + _ ibctesting.AppTest = (*App)(nil) ) // App extends an ABCI application, but with most of its parameters exported. // They are exported for convenience in creating helper functions, as object // capabilities aren't needed for testing. -type App struct { // nolint: golint +type App struct { //nolint: golint *baseapp.BaseApp legacyAmino *codec.LegacyAmino appCodec codec.Codec @@ -196,7 +195,7 @@ type App struct { // nolint: golint MintKeeper mintkeeper.Keeper // NOTE the distribution keeper should either be removed - // from consumer chain or set to use an independant + // from consumer chain or set to use an independent // different fee-pool from the consumer chain ConsumerKeeper DistrKeeper distrkeeper.Keeper @@ -240,12 +239,11 @@ func New( skipUpgradeHeights map[int64]bool, homePath string, invCheckPeriod uint, - encodingConfig cosmoscmd.EncodingConfig, + encodingConfig appparams.EncodingConfig, appOpts servertypes.AppOptions, baseAppOptions ...func(*baseapp.BaseApp), -) cosmoscmd.App { - - appCodec := encodingConfig.Marshaler +) *App { + appCodec := encodingConfig.Codec legacyAmino := encodingConfig.Amino interfaceRegistry := encodingConfig.InterfaceRegistry @@ -687,7 +685,7 @@ func (app *App) LoadHeight(height int64) error { } // ModuleAccountAddrs returns all the app's module account addresses. -func (app *App) ModuleAccountAddrs() map[string]bool { +func (*App) ModuleAccountAddrs() map[string]bool { modAccAddrs := make(map[string]bool) for acc := range maccPerms { modAccAddrs[authtypes.NewModuleAddress(acc).String()] = true @@ -759,22 +757,22 @@ func (app *App) GetProviderKeeper() ibcproviderkeeper.Keeper { } // GetE2eStakingKeeper implements the ProviderApp interface. -func (app *App) GetE2eStakingKeeper() e2e.E2eStakingKeeper { +func (app *App) GetE2eStakingKeeper() e2e.StakingKeeper { return app.StakingKeeper } // GetE2eBankKeeper implements the ProviderApp interface. -func (app *App) GetE2eBankKeeper() e2e.E2eBankKeeper { +func (app *App) GetE2eBankKeeper() e2e.BankKeeper { return app.BankKeeper } // GetE2eSlashingKeeper implements the ProviderApp interface. -func (app *App) GetE2eSlashingKeeper() e2e.E2eSlashingKeeper { +func (app *App) GetE2eSlashingKeeper() e2e.SlashingKeeper { return app.SlashingKeeper } // GetE2eDistributionKeeper implements the ProviderApp interface. -func (app *App) GetE2eDistributionKeeper() e2e.E2eDistributionKeeper { +func (app *App) GetE2eDistributionKeeper() e2e.DistributionKeeper { return app.DistrKeeper } @@ -801,13 +799,13 @@ func (app *App) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper { } // GetTxConfig implements the TestingApp interface. -func (app *App) GetTxConfig() client.TxConfig { +func (*App) GetTxConfig() client.TxConfig { return cosmoscmd.MakeEncodingConfig(ModuleBasics).TxConfig } // RegisterAPIRoutes registers all application module routes with the provided // API server. -func (app *App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { +func (*App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { clientCtx := apiSvr.ClientCtx rpc.RegisterRoutes(clientCtx, apiSvr.Router) // Register legacy tx routes. diff --git a/app/provider/export.go b/app/provider/export.go index 5ea9b63755..f0b3e3ed76 100644 --- a/app/provider/export.go +++ b/app/provider/export.go @@ -18,7 +18,6 @@ import ( func (app *App) ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, ) (servertypes.ExportedApp, error) { - // as if they could withdraw from the start of the next block ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()}) diff --git a/app/provider/params/config.go b/app/provider/params/config.go new file mode 100644 index 0000000000..8158dc805c --- /dev/null +++ b/app/provider/params/config.go @@ -0,0 +1,35 @@ +package params + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var ( + Bech32Prefix = "provider" + + // Bech32PrefixAccAddr defines the Bech32 prefix of an account's address + Bech32PrefixAccAddr = Bech32Prefix + // Bech32PrefixAccPub defines the Bech32 prefix of an account's public key + Bech32PrefixAccPub = Bech32Prefix + sdk.PrefixPublic + // Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address + Bech32PrefixValAddr = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixOperator + // Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key + Bech32PrefixValPub = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixOperator + sdk.PrefixPublic + // Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address + Bech32PrefixConsAddr = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus + // Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key + Bech32PrefixConsPub = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus + sdk.PrefixPublic +) + +// SetAddressPrefixes builds the Config with Bech32 addressPrefix and publKeyPrefix for accounts, validators, and consensus nodes and verifies that addreeses have correct format. +// Not sealed yet +func SetAddressPrefixes() { + cfg := sdk.GetConfig() + cfg.SetBech32PrefixForAccount(Bech32PrefixAccAddr, Bech32PrefixAccPub) + cfg.SetBech32PrefixForValidator(Bech32PrefixValAddr, Bech32PrefixValPub) + cfg.SetBech32PrefixForConsensusNode(Bech32PrefixConsAddr, Bech32PrefixConsPub) +} + +func init() { + SetAddressPrefixes() +} diff --git a/app/provider/params/doc.go b/app/provider/params/doc.go new file mode 100644 index 0000000000..7c6035cadc --- /dev/null +++ b/app/provider/params/doc.go @@ -0,0 +1,19 @@ +/* +Package params defines the simulation parameters in the gaia. + +It contains the default weights used for each transaction used on the module's +simulation. These weights define the chance for a transaction to be simulated at +any gived operation. + +You can repace the default values for the weights by providing a params.json +file with the weights defined for each of the transaction operations: + + { + "op_weight_msg_send": 60, + "op_weight_msg_delegate": 100, + } + +In the example above, the `MsgSend` has 60% chance to be simulated, while the +`MsgDelegate` will always be simulated. +*/ +package params diff --git a/app/provider/params/encoding.go b/app/provider/params/encoding.go new file mode 100644 index 0000000000..8ff9ea04b3 --- /dev/null +++ b/app/provider/params/encoding.go @@ -0,0 +1,16 @@ +package params + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/types" +) + +// EncodingConfig specifies the concrete encoding types to use for a given app. +// This is provided for compatibility between protobuf and amino implementations. +type EncodingConfig struct { + InterfaceRegistry types.InterfaceRegistry + Codec codec.Codec + TxConfig client.TxConfig + Amino *codec.LegacyAmino +} diff --git a/app/provider/params/params.go b/app/provider/params/params.go new file mode 100644 index 0000000000..b6aa5fb55e --- /dev/null +++ b/app/provider/params/params.go @@ -0,0 +1,7 @@ +package params + +// Simulation parameter constants +const ( + StakePerAccount = "stake_per_account" + InitiallyBondedValidators = "initially_bonded_validators" +) diff --git a/app/provider/params/proto.go b/app/provider/params/proto.go new file mode 100644 index 0000000000..a0e34aab16 --- /dev/null +++ b/app/provider/params/proto.go @@ -0,0 +1,22 @@ +package params + +import ( + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/x/auth/tx" +) + +// MakeEncodingConfig creates an EncodingConfig for an amino based test configuration. +func MakeEncodingConfig() EncodingConfig { + amino := codec.NewLegacyAmino() + interfaceRegistry := types.NewInterfaceRegistry() + chainCodec := codec.NewProtoCodec(interfaceRegistry) + txCfg := tx.NewTxConfig(chainCodec, tx.DefaultSignModes) + + return EncodingConfig{ + InterfaceRegistry: interfaceRegistry, + Codec: chainCodec, + TxConfig: txCfg, + Amino: amino, + } +} diff --git a/app/provider/params/weights.go b/app/provider/params/weights.go new file mode 100644 index 0000000000..4e5452c9b2 --- /dev/null +++ b/app/provider/params/weights.go @@ -0,0 +1,42 @@ +package params + +// Default simulation operation weights for messages and gov proposals +const ( + DefaultWeightMsgSend int = 100 + DefaultWeightMsgMultiSend int = 10 + DefaultWeightMsgSetWithdrawAddress int = 50 + DefaultWeightMsgWithdrawDelegationReward int = 50 + DefaultWeightMsgWithdrawValidatorCommission int = 50 + DefaultWeightMsgFundCommunityPool int = 50 + DefaultWeightMsgDeposit int = 100 + DefaultWeightMsgVote int = 67 + DefaultWeightMsgUnjail int = 100 + DefaultWeightMsgCreateValidator int = 100 + DefaultWeightMsgEditValidator int = 5 + DefaultWeightMsgDelegate int = 100 + DefaultWeightMsgUndelegate int = 100 + DefaultWeightMsgBeginRedelegate int = 100 + + DefaultWeightCommunitySpendProposal int = 5 + DefaultWeightTextProposal int = 5 + DefaultWeightParamChangeProposal int = 5 + + DefaultWeightMsgStoreCode int = 50 + DefaultWeightMsgInstantiateContract int = 100 + DefaultWeightMsgExecuteContract int = 100 + DefaultWeightMsgUpdateAdmin int = 25 + DefaultWeightMsgClearAdmin int = 10 + DefaultWeightMsgMigrateContract int = 50 + + DefaultWeightStoreCodeProposal int = 5 + DefaultWeightInstantiateContractProposal int = 5 + DefaultWeightUpdateAdminProposal int = 5 + DefaultWeightExecuteContractProposal int = 5 + DefaultWeightClearAdminProposal int = 5 + DefaultWeightMigrateContractProposal int = 5 + DefaultWeightSudoContractProposal int = 5 + DefaultWeightPinCodesProposal int = 5 + DefaultWeightUnpinCodesProposal int = 5 + DefaultWeightUpdateInstantiateConfigProposal int = 5 + DefaultWeightStoreAndInstantiateContractProposal int = 5 +) diff --git a/cmd/interchain-security-cd/cmd/genaccounts.go b/cmd/interchain-security-cd/cmd/genaccounts.go new file mode 100644 index 0000000000..c3340dccad --- /dev/null +++ b/cmd/interchain-security-cd/cmd/genaccounts.go @@ -0,0 +1,180 @@ +package cmd + +import ( + "bufio" + "encoding/json" + "errors" + "fmt" + + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/crypto/keyring" + "github.com/cosmos/cosmos-sdk/server" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + authvesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/cosmos/cosmos-sdk/x/genutil" + genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" +) + +const ( + flagVestingStart = "vesting-start-time" + flagVestingEnd = "vesting-end-time" + flagVestingAmt = "vesting-amount" +) + +// AddGenesisAccountCmd returns add-genesis-account cobra Command. +func AddGenesisAccountCmd(defaultNodeHome string) *cobra.Command { + cmd := &cobra.Command{ + Use: "add-genesis-account [address_or_key_name] [coin][,[coin]]", + Short: "Add a genesis account to genesis.json", + Long: `Add a genesis account to genesis.json. The provided account must specify +the account address or key name and a list of initial coins. If a key name is given, +the address will be looked up in the local Keybase. The list of initial tokens must +contain valid denominations. Accounts may optionally be supplied with vesting parameters. +`, + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + serverCtx := server.GetServerContextFromCmd(cmd) + config := serverCtx.Config + + config.SetRoot(clientCtx.HomeDir) + + var kr keyring.Keyring + addr, err := sdk.AccAddressFromBech32(args[0]) + if err != nil { + inBuf := bufio.NewReader(cmd.InOrStdin()) + keyringBackend, _ := cmd.Flags().GetString(flags.FlagKeyringBackend) + if keyringBackend != "" && clientCtx.Keyring == nil { + var err error + kr, err = keyring.New(sdk.KeyringServiceName(), keyringBackend, clientCtx.HomeDir, inBuf) + if err != nil { + return err + } + } else { + kr = clientCtx.Keyring + } + + info, err := kr.Key(args[0]) + if err != nil { + return fmt.Errorf("failed to get address from Keyring: %w", err) + } + addr = info.GetAddress() + } + + coins, err := sdk.ParseCoinsNormalized(args[1]) + if err != nil { + return fmt.Errorf("failed to parse coins: %w", err) + } + + vestingStart, _ := cmd.Flags().GetInt64(flagVestingStart) + vestingEnd, _ := cmd.Flags().GetInt64(flagVestingEnd) + vestingAmtStr, _ := cmd.Flags().GetString(flagVestingAmt) + + vestingAmt, err := sdk.ParseCoinsNormalized(vestingAmtStr) + if err != nil { + return fmt.Errorf("failed to parse vesting amount: %w", err) + } + + // create concrete account type based on input parameters + var genAccount authtypes.GenesisAccount + + balances := banktypes.Balance{Address: addr.String(), Coins: coins.Sort()} + baseAccount := authtypes.NewBaseAccount(addr, nil, 0, 0) + + if !vestingAmt.IsZero() { + baseVestingAccount := authvesting.NewBaseVestingAccount(baseAccount, vestingAmt.Sort(), vestingEnd) + + if (balances.Coins.IsZero() && !baseVestingAccount.OriginalVesting.IsZero()) || + baseVestingAccount.OriginalVesting.IsAnyGT(balances.Coins) { + return errors.New("vesting amount cannot be greater than total amount") + } + + switch { + case vestingStart != 0 && vestingEnd != 0: + genAccount = authvesting.NewContinuousVestingAccountRaw(baseVestingAccount, vestingStart) + + case vestingEnd != 0: + genAccount = authvesting.NewDelayedVestingAccountRaw(baseVestingAccount) + + default: + return errors.New("invalid vesting parameters; must supply start and end time or end time") + } + } else { + genAccount = baseAccount + } + + if err := genAccount.Validate(); err != nil { + return fmt.Errorf("failed to validate new genesis account: %w", err) + } + + genFile := config.GenesisFile() + appState, genDoc, err := genutiltypes.GenesisStateFromGenFile(genFile) + if err != nil { + return fmt.Errorf("failed to unmarshal genesis state: %w", err) + } + + authGenState := authtypes.GetGenesisStateFromAppState(clientCtx.Codec, appState) + + accs, err := authtypes.UnpackAccounts(authGenState.Accounts) + if err != nil { + return fmt.Errorf("failed to get accounts from any: %w", err) + } + + if accs.Contains(addr) { + return fmt.Errorf("cannot add account at existing address %s", addr) + } + + // Add the new account to the set of genesis accounts and sanitize the + // accounts afterwards. + accs = append(accs, genAccount) + accs = authtypes.SanitizeGenesisAccounts(accs) + + genAccs, err := authtypes.PackAccounts(accs) + if err != nil { + return fmt.Errorf("failed to convert accounts into any's: %w", err) + } + authGenState.Accounts = genAccs + + authGenStateBz, err := clientCtx.Codec.MarshalJSON(&authGenState) + if err != nil { + return fmt.Errorf("failed to marshal auth genesis state: %w", err) + } + + appState[authtypes.ModuleName] = authGenStateBz + + bankGenState := banktypes.GetGenesisStateFromAppState(clientCtx.Codec, appState) + bankGenState.Balances = append(bankGenState.Balances, balances) + bankGenState.Balances = banktypes.SanitizeGenesisBalances(bankGenState.Balances) + bankGenState.Supply = bankGenState.Supply.Add(balances.Coins...) + + bankGenStateBz, err := clientCtx.Codec.MarshalJSON(bankGenState) + if err != nil { + return fmt.Errorf("failed to marshal bank genesis state: %w", err) + } + + appState[banktypes.ModuleName] = bankGenStateBz + + appStateJSON, err := json.Marshal(appState) + if err != nil { + return fmt.Errorf("failed to marshal application genesis state: %w", err) + } + + genDoc.AppState = appStateJSON + return genutil.ExportGenesisFile(genDoc, genFile) + }, + } + + cmd.Flags().String(flags.FlagHome, defaultNodeHome, "The application home directory") + cmd.Flags().String(flags.FlagKeyringBackend, flags.DefaultKeyringBackend, "Select keyring's backend (os|file|kwallet|pass|test)") + cmd.Flags().String(flagVestingAmt, "", "amount of coins for vesting accounts") + cmd.Flags().Int64(flagVestingStart, 0, "schedule start time (unix epoch) for vesting accounts") + cmd.Flags().Int64(flagVestingEnd, 0, "schedule end time (unix epoch) for vesting accounts") + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/cmd/interchain-security-cd/cmd/root.go b/cmd/interchain-security-cd/cmd/root.go new file mode 100644 index 0000000000..7fc6118aad --- /dev/null +++ b/cmd/interchain-security-cd/cmd/root.go @@ -0,0 +1,305 @@ +package cmd + +import ( + "errors" + "io" + "os" + + "github.com/spf13/cast" + + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/version" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + + "github.com/spf13/cobra" + tmcli "github.com/tendermint/tendermint/libs/cli" + "github.com/tendermint/tendermint/libs/log" + dbm "github.com/tendermint/tm-db" + + "github.com/cosmos/cosmos-sdk/store" + sdk "github.com/cosmos/cosmos-sdk/types" + app "github.com/cosmos/interchain-security/app/consumer" + "github.com/cosmos/interchain-security/app/consumer/params" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/config" + "github.com/cosmos/cosmos-sdk/client/debug" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/keys" + "github.com/cosmos/cosmos-sdk/client/pruning" + "github.com/cosmos/cosmos-sdk/client/rpc" + "github.com/cosmos/cosmos-sdk/server" + serverconfig "github.com/cosmos/cosmos-sdk/server/config" + servertypes "github.com/cosmos/cosmos-sdk/server/types" + + authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/cosmos/cosmos-sdk/x/crisis" + genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" +) + +// NewRootCmd creates a new root command for wasmd. It is called once in the +// main function. +func NewRootCmd() (*cobra.Command, params.EncodingConfig) { + encodingConfig := params.MakeEncodingConfig() + + initClientCtx := client.Context{}. + WithCodec(encodingConfig.Codec). + WithInterfaceRegistry(encodingConfig.InterfaceRegistry). + WithTxConfig(encodingConfig.TxConfig). + WithLegacyAmino(encodingConfig.Amino). + WithInput(os.Stdin). + WithAccountRetriever(authtypes.AccountRetriever{}). + WithBroadcastMode(flags.BroadcastBlock). + WithHomeDir(app.DefaultNodeHome). + WithViper("") + + rootCmd := &cobra.Command{ + Use: version.AppName, + Short: "Kujira Daemon (server)", + PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { + // set the default command outputs + cmd.SetOut(cmd.OutOrStdout()) + cmd.SetErr(cmd.ErrOrStderr()) + + initClientCtx, err := client.ReadPersistentCommandFlags(initClientCtx, cmd.Flags()) + if err != nil { + return err + } + + initClientCtx, err = config.ReadFromClientConfig(initClientCtx) + if err != nil { + return err + } + + if err := client.SetCmdClientContextHandler(initClientCtx, cmd); err != nil { + return err + } + + customAppTemplate, customAppConfig := initAppConfig() + + return server.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig) + }, + } + + initRootCmd(rootCmd, encodingConfig) + + return rootCmd, encodingConfig +} + +// initAppConfig helps to override default appConfig template and configs. +// return "", nil if no custom configuration is required for the application. +func initAppConfig() (string, any) { + // The following code snippet is just for reference. + + // WASMConfig defines configuration for the wasm module. + type WASMConfig struct { + // This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries + QueryGasLimit uint64 `mapstructure:"query_gas_limit"` + + // Address defines the gRPC-web server to listen on + LruSize uint64 `mapstructure:"lru_size"` + } + + type CustomAppConfig struct { + serverconfig.Config + + WASM WASMConfig `mapstructure:"wasm"` + } + + // Optionally allow the chain developer to overwrite the SDK's default + // server config. + srvCfg := serverconfig.DefaultConfig() + // The SDK's default minimum gas price is set to "" (empty value) inside + // app.toml. If left empty by validators, the node will halt on startup. + // However, the chain developer can set a default app.toml value for their + // validators here. + // + // In summary: + // - if you leave srvCfg.MinGasPrices = "", all validators MUST tweak their + // own app.toml config, + // - if you set srvCfg.MinGasPrices non-empty, validators CAN tweak their + // own app.toml to override, or use this default value. + // + // In simapp, we set the min gas prices to 0. + srvCfg.MinGasPrices = "0whale" + // srvCfg.BaseConfig.IAVLDisableFastNode = true // disable fastnode by default + + customAppConfig := CustomAppConfig{ + Config: *srvCfg, + WASM: WASMConfig{ + LruSize: 1, + QueryGasLimit: 300000, + }, + } + + customAppTemplate := serverconfig.DefaultConfigTemplate + ` +[wasm] +# This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries +query_gas_limit = 300000 +# This is the number of wasm vm instances we keep cached in memory for speed-up +# Warning: this is currently unstable and may lead to crashes, best to keep for 0 unless testing locally +lru_size = 0` + + return customAppTemplate, customAppConfig +} + +func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) { + a := appCreator{encodingConfig} + rootCmd.AddCommand( + genutilcli.InitCmd(app.ModuleBasics, app.DefaultNodeHome), + genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome), + genutilcli.MigrateGenesisCmd(), + genutilcli.GenTxCmd(app.ModuleBasics, encodingConfig.TxConfig, banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome), + genutilcli.ValidateGenesisCmd(app.ModuleBasics), + AddGenesisAccountCmd(app.DefaultNodeHome), + tmcli.NewCompletionCmd(rootCmd, true), + debug.Cmd(), + config.Cmd(), + pruning.PruningCmd(a.newApp), + ) + + server.AddCommands(rootCmd, app.DefaultNodeHome, a.newApp, a.appExport, addModuleInitFlags) + + // add keybase, auxiliary RPC, query, and tx child commands + rootCmd.AddCommand( + rpc.StatusCommand(), + queryCommand(), + txCommand(), + keys.Commands(app.DefaultNodeHome), + ) + + // add rosetta + rootCmd.AddCommand(server.RosettaCommand(encodingConfig.InterfaceRegistry, encodingConfig.Codec)) +} + +func addModuleInitFlags(startCmd *cobra.Command) { + crisis.AddModuleInitFlags(startCmd) +} + +func queryCommand() *cobra.Command { + cmd := &cobra.Command{ + Use: "query", + Aliases: []string{"q"}, + Short: "Querying subcommands", + DisableFlagParsing: false, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand( + authcmd.GetAccountCmd(), + rpc.ValidatorCommand(), + rpc.BlockCommand(), + authcmd.QueryTxsByEventsCmd(), + authcmd.QueryTxCmd(), + ) + + app.ModuleBasics.AddQueryCommands(cmd) + cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") + + return cmd +} + +func txCommand() *cobra.Command { + cmd := &cobra.Command{ + Use: "tx", + Short: "Transactions subcommands", + DisableFlagParsing: false, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand( + authcmd.GetSignCommand(), + authcmd.GetSignBatchCommand(), + authcmd.GetMultiSignCommand(), + authcmd.GetMultiSignBatchCmd(), + authcmd.GetValidateSignaturesCommand(), + authcmd.GetBroadcastCommand(), + authcmd.GetEncodeCommand(), + authcmd.GetDecodeCommand(), + ) + + app.ModuleBasics.AddTxCommands(cmd) + cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") + + return cmd +} + +type appCreator struct { + encCfg params.EncodingConfig +} + +// newApp is an appCreator +func (a appCreator) newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, appOpts servertypes.AppOptions) servertypes.Application { + var cache sdk.MultiStorePersistentCache + + if cast.ToBool(appOpts.Get(server.FlagInterBlockCache)) { + cache = store.NewCommitKVStoreCacheManager() + } + + pruningOpts, err := server.GetPruningOptionsFromFlags(appOpts) + if err != nil { + panic(err) + } + + skipUpgradeHeights := make(map[int64]bool) + for _, h := range cast.ToIntSlice(appOpts.Get(server.FlagUnsafeSkipUpgrades)) { + skipUpgradeHeights[int64(h)] = true + } + + return app.New( + logger, + db, + traceStore, + true, + skipUpgradeHeights, + cast.ToString(appOpts.Get(flags.FlagHome)), + cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)), + a.encCfg, + appOpts, + baseapp.SetPruning(pruningOpts), + baseapp.SetInterBlockCache(cache), + baseapp.SetMinGasPrices(cast.ToString(appOpts.Get(server.FlagMinGasPrices))), + baseapp.SetHaltHeight(cast.ToUint64(appOpts.Get(server.FlagHaltHeight))), + baseapp.SetHaltTime(cast.ToUint64(appOpts.Get(server.FlagHaltTime))), + baseapp.SetMinRetainBlocks(cast.ToUint64(appOpts.Get(server.FlagMinRetainBlocks))), + baseapp.SetInterBlockCache(cache), + baseapp.SetTrace(cast.ToBool(appOpts.Get(server.FlagTrace))), + baseapp.SetIndexEvents(cast.ToStringSlice(appOpts.Get(server.FlagIndexEvents))), + ) +} + +// appExport creates a new cdApp (optionally at a given height) +// and exports state. +func (a appCreator) appExport( + logger log.Logger, db dbm.DB, traceStore io.Writer, height int64, forZeroHeight bool, jailAllowedAddrs []string, appOpts servertypes.AppOptions, +) (servertypes.ExportedApp, error) { + var cdApp *app.App + homePath, ok := appOpts.Get(flags.FlagHome).(string) + if !ok || homePath == "" { + return servertypes.ExportedApp{}, errors.New("application home is not set") + } + + loadLatest := height == -1 + cdApp = app.New( + logger, + db, + traceStore, + loadLatest, + map[int64]bool{}, + homePath, + cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)), + a.encCfg, + appOpts, + ) + + if height != -1 { + if err := cdApp.LoadHeight(height); err != nil { + return servertypes.ExportedApp{}, err + } + } + + return cdApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs) +} diff --git a/cmd/interchain-security-cd/main.go b/cmd/interchain-security-cd/main.go index 655753b476..737a618cb6 100644 --- a/cmd/interchain-security-cd/main.go +++ b/cmd/interchain-security-cd/main.go @@ -6,19 +6,11 @@ import ( "github.com/cosmos/cosmos-sdk/server" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" app "github.com/cosmos/interchain-security/app/consumer" - "github.com/tendermint/spm/cosmoscmd" + "github.com/cosmos/interchain-security/cmd/interchain-security-cd/cmd" ) func main() { - rootCmd, _ := cosmoscmd.NewRootCmd( - app.AppName, - app.AccountAddressPrefix, - app.DefaultNodeHome, - app.AppName, - app.ModuleBasics, - app.New, - // this line is used by starport scaffolding # root/arguments - ) + rootCmd, _ := cmd.NewRootCmd() if err := svrcmd.Execute(rootCmd, app.DefaultNodeHome); err != nil { switch e := err.(type) { diff --git a/cmd/interchain-security-cdd/cmd/genaccounts.go b/cmd/interchain-security-cdd/cmd/genaccounts.go new file mode 100644 index 0000000000..c3340dccad --- /dev/null +++ b/cmd/interchain-security-cdd/cmd/genaccounts.go @@ -0,0 +1,180 @@ +package cmd + +import ( + "bufio" + "encoding/json" + "errors" + "fmt" + + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/crypto/keyring" + "github.com/cosmos/cosmos-sdk/server" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + authvesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/cosmos/cosmos-sdk/x/genutil" + genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" +) + +const ( + flagVestingStart = "vesting-start-time" + flagVestingEnd = "vesting-end-time" + flagVestingAmt = "vesting-amount" +) + +// AddGenesisAccountCmd returns add-genesis-account cobra Command. +func AddGenesisAccountCmd(defaultNodeHome string) *cobra.Command { + cmd := &cobra.Command{ + Use: "add-genesis-account [address_or_key_name] [coin][,[coin]]", + Short: "Add a genesis account to genesis.json", + Long: `Add a genesis account to genesis.json. The provided account must specify +the account address or key name and a list of initial coins. If a key name is given, +the address will be looked up in the local Keybase. The list of initial tokens must +contain valid denominations. Accounts may optionally be supplied with vesting parameters. +`, + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + serverCtx := server.GetServerContextFromCmd(cmd) + config := serverCtx.Config + + config.SetRoot(clientCtx.HomeDir) + + var kr keyring.Keyring + addr, err := sdk.AccAddressFromBech32(args[0]) + if err != nil { + inBuf := bufio.NewReader(cmd.InOrStdin()) + keyringBackend, _ := cmd.Flags().GetString(flags.FlagKeyringBackend) + if keyringBackend != "" && clientCtx.Keyring == nil { + var err error + kr, err = keyring.New(sdk.KeyringServiceName(), keyringBackend, clientCtx.HomeDir, inBuf) + if err != nil { + return err + } + } else { + kr = clientCtx.Keyring + } + + info, err := kr.Key(args[0]) + if err != nil { + return fmt.Errorf("failed to get address from Keyring: %w", err) + } + addr = info.GetAddress() + } + + coins, err := sdk.ParseCoinsNormalized(args[1]) + if err != nil { + return fmt.Errorf("failed to parse coins: %w", err) + } + + vestingStart, _ := cmd.Flags().GetInt64(flagVestingStart) + vestingEnd, _ := cmd.Flags().GetInt64(flagVestingEnd) + vestingAmtStr, _ := cmd.Flags().GetString(flagVestingAmt) + + vestingAmt, err := sdk.ParseCoinsNormalized(vestingAmtStr) + if err != nil { + return fmt.Errorf("failed to parse vesting amount: %w", err) + } + + // create concrete account type based on input parameters + var genAccount authtypes.GenesisAccount + + balances := banktypes.Balance{Address: addr.String(), Coins: coins.Sort()} + baseAccount := authtypes.NewBaseAccount(addr, nil, 0, 0) + + if !vestingAmt.IsZero() { + baseVestingAccount := authvesting.NewBaseVestingAccount(baseAccount, vestingAmt.Sort(), vestingEnd) + + if (balances.Coins.IsZero() && !baseVestingAccount.OriginalVesting.IsZero()) || + baseVestingAccount.OriginalVesting.IsAnyGT(balances.Coins) { + return errors.New("vesting amount cannot be greater than total amount") + } + + switch { + case vestingStart != 0 && vestingEnd != 0: + genAccount = authvesting.NewContinuousVestingAccountRaw(baseVestingAccount, vestingStart) + + case vestingEnd != 0: + genAccount = authvesting.NewDelayedVestingAccountRaw(baseVestingAccount) + + default: + return errors.New("invalid vesting parameters; must supply start and end time or end time") + } + } else { + genAccount = baseAccount + } + + if err := genAccount.Validate(); err != nil { + return fmt.Errorf("failed to validate new genesis account: %w", err) + } + + genFile := config.GenesisFile() + appState, genDoc, err := genutiltypes.GenesisStateFromGenFile(genFile) + if err != nil { + return fmt.Errorf("failed to unmarshal genesis state: %w", err) + } + + authGenState := authtypes.GetGenesisStateFromAppState(clientCtx.Codec, appState) + + accs, err := authtypes.UnpackAccounts(authGenState.Accounts) + if err != nil { + return fmt.Errorf("failed to get accounts from any: %w", err) + } + + if accs.Contains(addr) { + return fmt.Errorf("cannot add account at existing address %s", addr) + } + + // Add the new account to the set of genesis accounts and sanitize the + // accounts afterwards. + accs = append(accs, genAccount) + accs = authtypes.SanitizeGenesisAccounts(accs) + + genAccs, err := authtypes.PackAccounts(accs) + if err != nil { + return fmt.Errorf("failed to convert accounts into any's: %w", err) + } + authGenState.Accounts = genAccs + + authGenStateBz, err := clientCtx.Codec.MarshalJSON(&authGenState) + if err != nil { + return fmt.Errorf("failed to marshal auth genesis state: %w", err) + } + + appState[authtypes.ModuleName] = authGenStateBz + + bankGenState := banktypes.GetGenesisStateFromAppState(clientCtx.Codec, appState) + bankGenState.Balances = append(bankGenState.Balances, balances) + bankGenState.Balances = banktypes.SanitizeGenesisBalances(bankGenState.Balances) + bankGenState.Supply = bankGenState.Supply.Add(balances.Coins...) + + bankGenStateBz, err := clientCtx.Codec.MarshalJSON(bankGenState) + if err != nil { + return fmt.Errorf("failed to marshal bank genesis state: %w", err) + } + + appState[banktypes.ModuleName] = bankGenStateBz + + appStateJSON, err := json.Marshal(appState) + if err != nil { + return fmt.Errorf("failed to marshal application genesis state: %w", err) + } + + genDoc.AppState = appStateJSON + return genutil.ExportGenesisFile(genDoc, genFile) + }, + } + + cmd.Flags().String(flags.FlagHome, defaultNodeHome, "The application home directory") + cmd.Flags().String(flags.FlagKeyringBackend, flags.DefaultKeyringBackend, "Select keyring's backend (os|file|kwallet|pass|test)") + cmd.Flags().String(flagVestingAmt, "", "amount of coins for vesting accounts") + cmd.Flags().Int64(flagVestingStart, 0, "schedule start time (unix epoch) for vesting accounts") + cmd.Flags().Int64(flagVestingEnd, 0, "schedule end time (unix epoch) for vesting accounts") + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/cmd/interchain-security-cdd/cmd/root.go b/cmd/interchain-security-cdd/cmd/root.go new file mode 100644 index 0000000000..deb63a1d66 --- /dev/null +++ b/cmd/interchain-security-cdd/cmd/root.go @@ -0,0 +1,305 @@ +package cmd + +import ( + "errors" + "io" + "os" + + "github.com/spf13/cast" + + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/version" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + + "github.com/spf13/cobra" + tmcli "github.com/tendermint/tendermint/libs/cli" + "github.com/tendermint/tendermint/libs/log" + dbm "github.com/tendermint/tm-db" + + "github.com/cosmos/cosmos-sdk/store" + sdk "github.com/cosmos/cosmos-sdk/types" + app "github.com/cosmos/interchain-security/app/consumer-democracy" + "github.com/cosmos/interchain-security/app/consumer-democracy/params" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/config" + "github.com/cosmos/cosmos-sdk/client/debug" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/keys" + "github.com/cosmos/cosmos-sdk/client/pruning" + "github.com/cosmos/cosmos-sdk/client/rpc" + "github.com/cosmos/cosmos-sdk/server" + serverconfig "github.com/cosmos/cosmos-sdk/server/config" + servertypes "github.com/cosmos/cosmos-sdk/server/types" + + authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/cosmos/cosmos-sdk/x/crisis" + genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" +) + +// NewRootCmd creates a new root command for wasmd. It is called once in the +// main function. +func NewRootCmd() (*cobra.Command, params.EncodingConfig) { + encodingConfig := params.MakeEncodingConfig() + + initClientCtx := client.Context{}. + WithCodec(encodingConfig.Codec). + WithInterfaceRegistry(encodingConfig.InterfaceRegistry). + WithTxConfig(encodingConfig.TxConfig). + WithLegacyAmino(encodingConfig.Amino). + WithInput(os.Stdin). + WithAccountRetriever(authtypes.AccountRetriever{}). + WithBroadcastMode(flags.BroadcastBlock). + WithHomeDir(app.DefaultNodeHome). + WithViper("") + + rootCmd := &cobra.Command{ + Use: version.AppName, + Short: "Kujira Daemon (server)", + PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { + // set the default command outputs + cmd.SetOut(cmd.OutOrStdout()) + cmd.SetErr(cmd.ErrOrStderr()) + + initClientCtx, err := client.ReadPersistentCommandFlags(initClientCtx, cmd.Flags()) + if err != nil { + return err + } + + initClientCtx, err = config.ReadFromClientConfig(initClientCtx) + if err != nil { + return err + } + + if err := client.SetCmdClientContextHandler(initClientCtx, cmd); err != nil { + return err + } + + customAppTemplate, customAppConfig := initAppConfig() + + return server.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig) + }, + } + + initRootCmd(rootCmd, encodingConfig) + + return rootCmd, encodingConfig +} + +// initAppConfig helps to override default appConfig template and configs. +// return "", nil if no custom configuration is required for the application. +func initAppConfig() (string, any) { + // The following code snippet is just for reference. + + // WASMConfig defines configuration for the wasm module. + type WASMConfig struct { + // This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries + QueryGasLimit uint64 `mapstructure:"query_gas_limit"` + + // Address defines the gRPC-web server to listen on + LruSize uint64 `mapstructure:"lru_size"` + } + + type CustomAppConfig struct { + serverconfig.Config + + WASM WASMConfig `mapstructure:"wasm"` + } + + // Optionally allow the chain developer to overwrite the SDK's default + // server config. + srvCfg := serverconfig.DefaultConfig() + // The SDK's default minimum gas price is set to "" (empty value) inside + // app.toml. If left empty by validators, the node will halt on startup. + // However, the chain developer can set a default app.toml value for their + // validators here. + // + // In summary: + // - if you leave srvCfg.MinGasPrices = "", all validators MUST tweak their + // own app.toml config, + // - if you set srvCfg.MinGasPrices non-empty, validators CAN tweak their + // own app.toml to override, or use this default value. + // + // In simapp, we set the min gas prices to 0. + srvCfg.MinGasPrices = "0whale" + // srvCfg.BaseConfig.IAVLDisableFastNode = true // disable fastnode by default + + customAppConfig := CustomAppConfig{ + Config: *srvCfg, + WASM: WASMConfig{ + LruSize: 1, + QueryGasLimit: 300000, + }, + } + + customAppTemplate := serverconfig.DefaultConfigTemplate + ` +[wasm] +# This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries +query_gas_limit = 300000 +# This is the number of wasm vm instances we keep cached in memory for speed-up +# Warning: this is currently unstable and may lead to crashes, best to keep for 0 unless testing locally +lru_size = 0` + + return customAppTemplate, customAppConfig +} + +func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) { + a := appCreator{encodingConfig} + rootCmd.AddCommand( + genutilcli.InitCmd(app.ModuleBasics, app.DefaultNodeHome), + genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome), + genutilcli.MigrateGenesisCmd(), + genutilcli.GenTxCmd(app.ModuleBasics, encodingConfig.TxConfig, banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome), + genutilcli.ValidateGenesisCmd(app.ModuleBasics), + AddGenesisAccountCmd(app.DefaultNodeHome), + tmcli.NewCompletionCmd(rootCmd, true), + debug.Cmd(), + config.Cmd(), + pruning.PruningCmd(a.newApp), + ) + + server.AddCommands(rootCmd, app.DefaultNodeHome, a.newApp, a.appExport, addModuleInitFlags) + + // add keybase, auxiliary RPC, query, and tx child commands + rootCmd.AddCommand( + rpc.StatusCommand(), + queryCommand(), + txCommand(), + keys.Commands(app.DefaultNodeHome), + ) + + // add rosetta + rootCmd.AddCommand(server.RosettaCommand(encodingConfig.InterfaceRegistry, encodingConfig.Codec)) +} + +func addModuleInitFlags(startCmd *cobra.Command) { + crisis.AddModuleInitFlags(startCmd) +} + +func queryCommand() *cobra.Command { + cmd := &cobra.Command{ + Use: "query", + Aliases: []string{"q"}, + Short: "Querying subcommands", + DisableFlagParsing: false, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand( + authcmd.GetAccountCmd(), + rpc.ValidatorCommand(), + rpc.BlockCommand(), + authcmd.QueryTxsByEventsCmd(), + authcmd.QueryTxCmd(), + ) + + app.ModuleBasics.AddQueryCommands(cmd) + cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") + + return cmd +} + +func txCommand() *cobra.Command { + cmd := &cobra.Command{ + Use: "tx", + Short: "Transactions subcommands", + DisableFlagParsing: false, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand( + authcmd.GetSignCommand(), + authcmd.GetSignBatchCommand(), + authcmd.GetMultiSignCommand(), + authcmd.GetMultiSignBatchCmd(), + authcmd.GetValidateSignaturesCommand(), + authcmd.GetBroadcastCommand(), + authcmd.GetEncodeCommand(), + authcmd.GetDecodeCommand(), + ) + + app.ModuleBasics.AddTxCommands(cmd) + cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") + + return cmd +} + +type appCreator struct { + encCfg params.EncodingConfig +} + +// newApp is an appCreator +func (a appCreator) newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, appOpts servertypes.AppOptions) servertypes.Application { + var cache sdk.MultiStorePersistentCache + + if cast.ToBool(appOpts.Get(server.FlagInterBlockCache)) { + cache = store.NewCommitKVStoreCacheManager() + } + + pruningOpts, err := server.GetPruningOptionsFromFlags(appOpts) + if err != nil { + panic(err) + } + + skipUpgradeHeights := make(map[int64]bool) + for _, h := range cast.ToIntSlice(appOpts.Get(server.FlagUnsafeSkipUpgrades)) { + skipUpgradeHeights[int64(h)] = true + } + + return app.New( + logger, + db, + traceStore, + true, + skipUpgradeHeights, + cast.ToString(appOpts.Get(flags.FlagHome)), + cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)), + a.encCfg, + appOpts, + baseapp.SetPruning(pruningOpts), + baseapp.SetInterBlockCache(cache), + baseapp.SetMinGasPrices(cast.ToString(appOpts.Get(server.FlagMinGasPrices))), + baseapp.SetHaltHeight(cast.ToUint64(appOpts.Get(server.FlagHaltHeight))), + baseapp.SetHaltTime(cast.ToUint64(appOpts.Get(server.FlagHaltTime))), + baseapp.SetMinRetainBlocks(cast.ToUint64(appOpts.Get(server.FlagMinRetainBlocks))), + baseapp.SetInterBlockCache(cache), + baseapp.SetTrace(cast.ToBool(appOpts.Get(server.FlagTrace))), + baseapp.SetIndexEvents(cast.ToStringSlice(appOpts.Get(server.FlagIndexEvents))), + ) +} + +// appExport creates a new cddApp (optionally at a given height) +// and exports state. +func (a appCreator) appExport( + logger log.Logger, db dbm.DB, traceStore io.Writer, height int64, forZeroHeight bool, jailAllowedAddrs []string, appOpts servertypes.AppOptions, +) (servertypes.ExportedApp, error) { + var cddApp *app.App + homePath, ok := appOpts.Get(flags.FlagHome).(string) + if !ok || homePath == "" { + return servertypes.ExportedApp{}, errors.New("application home is not set") + } + + loadLatest := height == -1 + cddApp = app.New( + logger, + db, + traceStore, + loadLatest, + map[int64]bool{}, + homePath, + cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)), + a.encCfg, + appOpts, + ) + + if height != -1 { + if err := cddApp.LoadHeight(height); err != nil { + return servertypes.ExportedApp{}, err + } + } + + return cddApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs) +} diff --git a/cmd/interchain-security-cdd/main.go b/cmd/interchain-security-cdd/main.go index 6b9bbffe60..3ca199c480 100644 --- a/cmd/interchain-security-cdd/main.go +++ b/cmd/interchain-security-cdd/main.go @@ -6,19 +6,11 @@ import ( "github.com/cosmos/cosmos-sdk/server" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" app "github.com/cosmos/interchain-security/app/consumer-democracy" - "github.com/tendermint/spm/cosmoscmd" + "github.com/cosmos/interchain-security/cmd/interchain-security-cdd/cmd" ) func main() { - rootCmd, _ := cosmoscmd.NewRootCmd( - app.AppName, - app.AccountAddressPrefix, - app.DefaultNodeHome, - app.AppName, - app.ModuleBasics, - app.New, - // this line is used by starport scaffolding # root/arguments - ) + rootCmd, _ := cmd.NewRootCmd() if err := svrcmd.Execute(rootCmd, app.DefaultNodeHome); err != nil { switch e := err.(type) { diff --git a/cmd/interchain-security-pd/cmd/genaccounts.go b/cmd/interchain-security-pd/cmd/genaccounts.go new file mode 100644 index 0000000000..c3340dccad --- /dev/null +++ b/cmd/interchain-security-pd/cmd/genaccounts.go @@ -0,0 +1,180 @@ +package cmd + +import ( + "bufio" + "encoding/json" + "errors" + "fmt" + + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/crypto/keyring" + "github.com/cosmos/cosmos-sdk/server" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + authvesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/cosmos/cosmos-sdk/x/genutil" + genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" +) + +const ( + flagVestingStart = "vesting-start-time" + flagVestingEnd = "vesting-end-time" + flagVestingAmt = "vesting-amount" +) + +// AddGenesisAccountCmd returns add-genesis-account cobra Command. +func AddGenesisAccountCmd(defaultNodeHome string) *cobra.Command { + cmd := &cobra.Command{ + Use: "add-genesis-account [address_or_key_name] [coin][,[coin]]", + Short: "Add a genesis account to genesis.json", + Long: `Add a genesis account to genesis.json. The provided account must specify +the account address or key name and a list of initial coins. If a key name is given, +the address will be looked up in the local Keybase. The list of initial tokens must +contain valid denominations. Accounts may optionally be supplied with vesting parameters. +`, + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + serverCtx := server.GetServerContextFromCmd(cmd) + config := serverCtx.Config + + config.SetRoot(clientCtx.HomeDir) + + var kr keyring.Keyring + addr, err := sdk.AccAddressFromBech32(args[0]) + if err != nil { + inBuf := bufio.NewReader(cmd.InOrStdin()) + keyringBackend, _ := cmd.Flags().GetString(flags.FlagKeyringBackend) + if keyringBackend != "" && clientCtx.Keyring == nil { + var err error + kr, err = keyring.New(sdk.KeyringServiceName(), keyringBackend, clientCtx.HomeDir, inBuf) + if err != nil { + return err + } + } else { + kr = clientCtx.Keyring + } + + info, err := kr.Key(args[0]) + if err != nil { + return fmt.Errorf("failed to get address from Keyring: %w", err) + } + addr = info.GetAddress() + } + + coins, err := sdk.ParseCoinsNormalized(args[1]) + if err != nil { + return fmt.Errorf("failed to parse coins: %w", err) + } + + vestingStart, _ := cmd.Flags().GetInt64(flagVestingStart) + vestingEnd, _ := cmd.Flags().GetInt64(flagVestingEnd) + vestingAmtStr, _ := cmd.Flags().GetString(flagVestingAmt) + + vestingAmt, err := sdk.ParseCoinsNormalized(vestingAmtStr) + if err != nil { + return fmt.Errorf("failed to parse vesting amount: %w", err) + } + + // create concrete account type based on input parameters + var genAccount authtypes.GenesisAccount + + balances := banktypes.Balance{Address: addr.String(), Coins: coins.Sort()} + baseAccount := authtypes.NewBaseAccount(addr, nil, 0, 0) + + if !vestingAmt.IsZero() { + baseVestingAccount := authvesting.NewBaseVestingAccount(baseAccount, vestingAmt.Sort(), vestingEnd) + + if (balances.Coins.IsZero() && !baseVestingAccount.OriginalVesting.IsZero()) || + baseVestingAccount.OriginalVesting.IsAnyGT(balances.Coins) { + return errors.New("vesting amount cannot be greater than total amount") + } + + switch { + case vestingStart != 0 && vestingEnd != 0: + genAccount = authvesting.NewContinuousVestingAccountRaw(baseVestingAccount, vestingStart) + + case vestingEnd != 0: + genAccount = authvesting.NewDelayedVestingAccountRaw(baseVestingAccount) + + default: + return errors.New("invalid vesting parameters; must supply start and end time or end time") + } + } else { + genAccount = baseAccount + } + + if err := genAccount.Validate(); err != nil { + return fmt.Errorf("failed to validate new genesis account: %w", err) + } + + genFile := config.GenesisFile() + appState, genDoc, err := genutiltypes.GenesisStateFromGenFile(genFile) + if err != nil { + return fmt.Errorf("failed to unmarshal genesis state: %w", err) + } + + authGenState := authtypes.GetGenesisStateFromAppState(clientCtx.Codec, appState) + + accs, err := authtypes.UnpackAccounts(authGenState.Accounts) + if err != nil { + return fmt.Errorf("failed to get accounts from any: %w", err) + } + + if accs.Contains(addr) { + return fmt.Errorf("cannot add account at existing address %s", addr) + } + + // Add the new account to the set of genesis accounts and sanitize the + // accounts afterwards. + accs = append(accs, genAccount) + accs = authtypes.SanitizeGenesisAccounts(accs) + + genAccs, err := authtypes.PackAccounts(accs) + if err != nil { + return fmt.Errorf("failed to convert accounts into any's: %w", err) + } + authGenState.Accounts = genAccs + + authGenStateBz, err := clientCtx.Codec.MarshalJSON(&authGenState) + if err != nil { + return fmt.Errorf("failed to marshal auth genesis state: %w", err) + } + + appState[authtypes.ModuleName] = authGenStateBz + + bankGenState := banktypes.GetGenesisStateFromAppState(clientCtx.Codec, appState) + bankGenState.Balances = append(bankGenState.Balances, balances) + bankGenState.Balances = banktypes.SanitizeGenesisBalances(bankGenState.Balances) + bankGenState.Supply = bankGenState.Supply.Add(balances.Coins...) + + bankGenStateBz, err := clientCtx.Codec.MarshalJSON(bankGenState) + if err != nil { + return fmt.Errorf("failed to marshal bank genesis state: %w", err) + } + + appState[banktypes.ModuleName] = bankGenStateBz + + appStateJSON, err := json.Marshal(appState) + if err != nil { + return fmt.Errorf("failed to marshal application genesis state: %w", err) + } + + genDoc.AppState = appStateJSON + return genutil.ExportGenesisFile(genDoc, genFile) + }, + } + + cmd.Flags().String(flags.FlagHome, defaultNodeHome, "The application home directory") + cmd.Flags().String(flags.FlagKeyringBackend, flags.DefaultKeyringBackend, "Select keyring's backend (os|file|kwallet|pass|test)") + cmd.Flags().String(flagVestingAmt, "", "amount of coins for vesting accounts") + cmd.Flags().Int64(flagVestingStart, 0, "schedule start time (unix epoch) for vesting accounts") + cmd.Flags().Int64(flagVestingEnd, 0, "schedule end time (unix epoch) for vesting accounts") + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/cmd/interchain-security-pd/cmd/root.go b/cmd/interchain-security-pd/cmd/root.go new file mode 100644 index 0000000000..a815f3ce60 --- /dev/null +++ b/cmd/interchain-security-pd/cmd/root.go @@ -0,0 +1,305 @@ +package cmd + +import ( + "errors" + "io" + "os" + + "github.com/spf13/cast" + + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/version" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + + "github.com/spf13/cobra" + tmcli "github.com/tendermint/tendermint/libs/cli" + "github.com/tendermint/tendermint/libs/log" + dbm "github.com/tendermint/tm-db" + + "github.com/cosmos/cosmos-sdk/store" + sdk "github.com/cosmos/cosmos-sdk/types" + app "github.com/cosmos/interchain-security/app/provider" + "github.com/cosmos/interchain-security/app/provider/params" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/config" + "github.com/cosmos/cosmos-sdk/client/debug" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/keys" + "github.com/cosmos/cosmos-sdk/client/pruning" + "github.com/cosmos/cosmos-sdk/client/rpc" + "github.com/cosmos/cosmos-sdk/server" + serverconfig "github.com/cosmos/cosmos-sdk/server/config" + servertypes "github.com/cosmos/cosmos-sdk/server/types" + + authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/cosmos/cosmos-sdk/x/crisis" + genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" +) + +// NewRootCmd creates a new root command for wasmd. It is called once in the +// main function. +func NewRootCmd() (*cobra.Command, params.EncodingConfig) { + encodingConfig := params.MakeEncodingConfig() + + initClientCtx := client.Context{}. + WithCodec(encodingConfig.Codec). + WithInterfaceRegistry(encodingConfig.InterfaceRegistry). + WithTxConfig(encodingConfig.TxConfig). + WithLegacyAmino(encodingConfig.Amino). + WithInput(os.Stdin). + WithAccountRetriever(authtypes.AccountRetriever{}). + WithBroadcastMode(flags.BroadcastBlock). + WithHomeDir(app.DefaultNodeHome). + WithViper("") + + rootCmd := &cobra.Command{ + Use: version.AppName, + Short: "Kujira Daemon (server)", + PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { + // set the default command outputs + cmd.SetOut(cmd.OutOrStdout()) + cmd.SetErr(cmd.ErrOrStderr()) + + initClientCtx, err := client.ReadPersistentCommandFlags(initClientCtx, cmd.Flags()) + if err != nil { + return err + } + + initClientCtx, err = config.ReadFromClientConfig(initClientCtx) + if err != nil { + return err + } + + if err := client.SetCmdClientContextHandler(initClientCtx, cmd); err != nil { + return err + } + + customAppTemplate, customAppConfig := initAppConfig() + + return server.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig) + }, + } + + initRootCmd(rootCmd, encodingConfig) + + return rootCmd, encodingConfig +} + +// initAppConfig helps to override default appConfig template and configs. +// return "", nil if no custom configuration is required for the application. +func initAppConfig() (string, any) { + // The following code snippet is just for reference. + + // WASMConfig defines configuration for the wasm module. + type WASMConfig struct { + // This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries + QueryGasLimit uint64 `mapstructure:"query_gas_limit"` + + // Address defines the gRPC-web server to listen on + LruSize uint64 `mapstructure:"lru_size"` + } + + type CustomAppConfig struct { + serverconfig.Config + + WASM WASMConfig `mapstructure:"wasm"` + } + + // Optionally allow the chain developer to overwrite the SDK's default + // server config. + srvCfg := serverconfig.DefaultConfig() + // The SDK's default minimum gas price is set to "" (empty value) inside + // app.toml. If left empty by validators, the node will halt on startup. + // However, the chain developer can set a default app.toml value for their + // validators here. + // + // In summary: + // - if you leave srvCfg.MinGasPrices = "", all validators MUST tweak their + // own app.toml config, + // - if you set srvCfg.MinGasPrices non-empty, validators CAN tweak their + // own app.toml to override, or use this default value. + // + // In simapp, we set the min gas prices to 0. + srvCfg.MinGasPrices = "0whale" + // srvCfg.BaseConfig.IAVLDisableFastNode = true // disable fastnode by default + + customAppConfig := CustomAppConfig{ + Config: *srvCfg, + WASM: WASMConfig{ + LruSize: 1, + QueryGasLimit: 300000, + }, + } + + customAppTemplate := serverconfig.DefaultConfigTemplate + ` +[wasm] +# This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries +query_gas_limit = 300000 +# This is the number of wasm vm instances we keep cached in memory for speed-up +# Warning: this is currently unstable and may lead to crashes, best to keep for 0 unless testing locally +lru_size = 0` + + return customAppTemplate, customAppConfig +} + +func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) { + a := appCreator{encodingConfig} + rootCmd.AddCommand( + genutilcli.InitCmd(app.ModuleBasics, app.DefaultNodeHome), + genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome), + genutilcli.MigrateGenesisCmd(), + genutilcli.GenTxCmd(app.ModuleBasics, encodingConfig.TxConfig, banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome), + genutilcli.ValidateGenesisCmd(app.ModuleBasics), + AddGenesisAccountCmd(app.DefaultNodeHome), + tmcli.NewCompletionCmd(rootCmd, true), + debug.Cmd(), + config.Cmd(), + pruning.PruningCmd(a.newApp), + ) + + server.AddCommands(rootCmd, app.DefaultNodeHome, a.newApp, a.appExport, addModuleInitFlags) + + // add keybase, auxiliary RPC, query, and tx child commands + rootCmd.AddCommand( + rpc.StatusCommand(), + queryCommand(), + txCommand(), + keys.Commands(app.DefaultNodeHome), + ) + + // add rosetta + rootCmd.AddCommand(server.RosettaCommand(encodingConfig.InterfaceRegistry, encodingConfig.Codec)) +} + +func addModuleInitFlags(startCmd *cobra.Command) { + crisis.AddModuleInitFlags(startCmd) +} + +func queryCommand() *cobra.Command { + cmd := &cobra.Command{ + Use: "query", + Aliases: []string{"q"}, + Short: "Querying subcommands", + DisableFlagParsing: false, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand( + authcmd.GetAccountCmd(), + rpc.ValidatorCommand(), + rpc.BlockCommand(), + authcmd.QueryTxsByEventsCmd(), + authcmd.QueryTxCmd(), + ) + + app.ModuleBasics.AddQueryCommands(cmd) + cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") + + return cmd +} + +func txCommand() *cobra.Command { + cmd := &cobra.Command{ + Use: "tx", + Short: "Transactions subcommands", + DisableFlagParsing: false, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand( + authcmd.GetSignCommand(), + authcmd.GetSignBatchCommand(), + authcmd.GetMultiSignCommand(), + authcmd.GetMultiSignBatchCmd(), + authcmd.GetValidateSignaturesCommand(), + authcmd.GetBroadcastCommand(), + authcmd.GetEncodeCommand(), + authcmd.GetDecodeCommand(), + ) + + app.ModuleBasics.AddTxCommands(cmd) + cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") + + return cmd +} + +type appCreator struct { + encCfg params.EncodingConfig +} + +// newApp is an appCreator +func (a appCreator) newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, appOpts servertypes.AppOptions) servertypes.Application { + var cache sdk.MultiStorePersistentCache + + if cast.ToBool(appOpts.Get(server.FlagInterBlockCache)) { + cache = store.NewCommitKVStoreCacheManager() + } + + pruningOpts, err := server.GetPruningOptionsFromFlags(appOpts) + if err != nil { + panic(err) + } + + skipUpgradeHeights := make(map[int64]bool) + for _, h := range cast.ToIntSlice(appOpts.Get(server.FlagUnsafeSkipUpgrades)) { + skipUpgradeHeights[int64(h)] = true + } + + return app.New( + logger, + db, + traceStore, + true, + skipUpgradeHeights, + cast.ToString(appOpts.Get(flags.FlagHome)), + cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)), + a.encCfg, + appOpts, + baseapp.SetPruning(pruningOpts), + baseapp.SetInterBlockCache(cache), + baseapp.SetMinGasPrices(cast.ToString(appOpts.Get(server.FlagMinGasPrices))), + baseapp.SetHaltHeight(cast.ToUint64(appOpts.Get(server.FlagHaltHeight))), + baseapp.SetHaltTime(cast.ToUint64(appOpts.Get(server.FlagHaltTime))), + baseapp.SetMinRetainBlocks(cast.ToUint64(appOpts.Get(server.FlagMinRetainBlocks))), + baseapp.SetInterBlockCache(cache), + baseapp.SetTrace(cast.ToBool(appOpts.Get(server.FlagTrace))), + baseapp.SetIndexEvents(cast.ToStringSlice(appOpts.Get(server.FlagIndexEvents))), + ) +} + +// appExport creates a pdApp (optionally at a given height) +// and exports state. +func (a appCreator) appExport( + logger log.Logger, db dbm.DB, traceStore io.Writer, height int64, forZeroHeight bool, jailAllowedAddrs []string, appOpts servertypes.AppOptions, +) (servertypes.ExportedApp, error) { + var pdApp *app.App + homePath, ok := appOpts.Get(flags.FlagHome).(string) + if !ok || homePath == "" { + return servertypes.ExportedApp{}, errors.New("application home is not set") + } + + loadLatest := height == -1 + pdApp = app.New( + logger, + db, + traceStore, + loadLatest, + map[int64]bool{}, + homePath, + cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)), + a.encCfg, + appOpts, + ) + + if height != -1 { + if err := pdApp.LoadHeight(height); err != nil { + return servertypes.ExportedApp{}, err + } + } + + return pdApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs) +} diff --git a/cmd/interchain-security-pd/main.go b/cmd/interchain-security-pd/main.go index 648c4fc7b9..879e65a06b 100644 --- a/cmd/interchain-security-pd/main.go +++ b/cmd/interchain-security-pd/main.go @@ -6,19 +6,11 @@ import ( "github.com/cosmos/cosmos-sdk/server" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" app "github.com/cosmos/interchain-security/app/provider" - "github.com/tendermint/spm/cosmoscmd" + "github.com/cosmos/interchain-security/cmd/interchain-security-pd/cmd" ) func main() { - rootCmd, _ := cosmoscmd.NewRootCmd( - app.AppName, - app.AccountAddressPrefix, - app.DefaultNodeHome, - app.AppName, - app.ModuleBasics, - app.New, - // this line is used by starport scaffolding # root/arguments - ) + rootCmd, _ := cmd.NewRootCmd() if err := svrcmd.Execute(rootCmd, app.DefaultNodeHome); err != nil { switch e := err.(type) { diff --git a/docs/docs/adrs/adr-001-key-assignment.md b/docs/docs/adrs/adr-001-key-assignment.md index 66d983132b..58a37e532f 100644 --- a/docs/docs/adrs/adr-001-key-assignment.md +++ b/docs/docs/adrs/adr-001-key-assignment.md @@ -53,7 +53,7 @@ if _, found := GetValidatorByConsumerAddr(ChainID, consumerAddr); found { // check whether the consumer chain is already registered // i.e., a client to the consumer was already created -if _, consumerRegistered := GetConsumerClientId(chainID); consumerRegistered { +if _, consumerRegistered := GetConsumerClientID(chainID); consumerRegistered { // get the previous key assigned for this validator on this consumer chain oldConsumerKey, found := GetValidatorConsumerPubKey(chainID, providerConsAddr) if found { diff --git a/go.mod b/go.mod index 9cf6f6c8db..d80794023f 100644 --- a/go.mod +++ b/go.mod @@ -3,54 +3,62 @@ module github.com/cosmos/interchain-security go 1.18 require ( - github.com/cosmos/cosmos-sdk v0.45.11 + github.com/confio/ics23/go v0.9.0 + github.com/cosmos/cosmos-sdk v0.45.15 + github.com/cosmos/ibc-go/v4 v4.3.0 github.com/gogo/protobuf v1.3.3 + github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.3 github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/kylelemons/godebug v1.1.0 + github.com/oxyno-zeta/gomock-extra-matcher v1.1.0 github.com/rakyll/statik v0.1.7 + github.com/regen-network/cosmos-proto v0.3.1 github.com/spf13/cast v1.5.0 github.com/spf13/cobra v1.6.1 github.com/stretchr/testify v1.8.1 github.com/tendermint/spm v0.1.9 - github.com/tendermint/tendermint v0.34.26 + github.com/tendermint/tendermint v0.34.27 github.com/tendermint/tm-db v0.6.7 github.com/tidwall/gjson v1.14.4 golang.org/x/crypto v0.5.0 // indirect + golang.org/x/exp v0.0.0-20221019170559-20944726eadf golang.org/x/net v0.7.0 // indirect golang.org/x/sys v0.5.0 // indirect - google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e - google.golang.org/grpc v1.50.1 + google.golang.org/genproto v0.0.0-20230125152338-dcaf20b6aeaa + google.golang.org/grpc v1.52.3 google.golang.org/protobuf v1.30.0 gopkg.in/yaml.v2 v2.4.0 ) require ( - github.com/confio/ics23/go v0.9.0 - github.com/cosmos/ibc-go/v4 v4.2.0 - github.com/golang/mock v1.6.0 - github.com/oxyno-zeta/gomock-extra-matcher v1.1.0 - github.com/regen-network/cosmos-proto v0.3.1 - golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e -) - -require ( + cosmossdk.io/api v0.2.6 // indirect + cosmossdk.io/core v0.5.1 // indirect + cosmossdk.io/depinject v1.0.0-alpha.3 // indirect filippo.io/edwards25519 v1.0.0-rc.1 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect + github.com/DataDog/zstd v1.5.0 // indirect + github.com/HdrHistogram/hdrhistogram-go v1.1.2 // indirect github.com/Workiva/go-datastructures v1.0.53 // indirect - github.com/armon/go-metrics v0.4.0 // indirect + github.com/armon/go-metrics v0.4.1 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect - github.com/btcsuite/btcd v0.23.0 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/cockroachdb/errors v1.9.1 // indirect + github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect + github.com/cockroachdb/pebble v0.0.0-20220817183557-09c6e030a677 // indirect + github.com/cockroachdb/redact v1.1.3 // indirect github.com/coinbase/rosetta-sdk-go v0.7.9 // indirect + github.com/cometbft/cometbft-db v0.7.0 // indirect github.com/cosmos/btcutil v1.0.4 // indirect + github.com/cosmos/cosmos-db v0.0.0-20221226095112-f3c38ecb5e32 // indirect + github.com/cosmos/cosmos-proto v1.0.0-beta.1 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gorocksdb v1.2.0 // indirect github.com/cosmos/iavl v0.19.5 // indirect @@ -67,6 +75,7 @@ require ( github.com/dvsekhvalnov/jose2go v1.5.0 // indirect github.com/felixge/httpsnoop v1.0.2 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/getsentry/sentry-go v0.17.0 // indirect github.com/go-kit/kit v0.12.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.5.1 // indirect @@ -74,7 +83,7 @@ require ( github.com/gogo/gateway v1.1.0 // indirect github.com/golang/glog v1.0.0 // indirect github.com/golang/snappy v0.0.4 // indirect - github.com/google/btree v1.0.1 // indirect + github.com/google/btree v1.1.2 // indirect github.com/google/orderedcode v0.0.1 // indirect github.com/gorilla/handlers v1.5.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect @@ -90,8 +99,11 @@ require ( github.com/inconshreveable/mousetrap v1.0.1 // indirect github.com/jmhodges/levigo v1.0.0 // indirect github.com/klauspost/compress v1.15.11 // indirect + github.com/kr/pretty v0.3.1 // indirect + github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.6 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect + github.com/linxGnu/grocksdb v1.7.10 // indirect github.com/magiconair/properties v1.8.6 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.16 // indirect @@ -110,6 +122,7 @@ require ( github.com/prometheus/common v0.37.0 // indirect github.com/prometheus/procfs v0.8.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect + github.com/rogpeppe/go-internal v1.9.0 // indirect github.com/rs/cors v1.8.2 // indirect github.com/rs/zerolog v1.27.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect @@ -117,9 +130,9 @@ require ( github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/viper v1.14.0 // indirect - github.com/stretchr/objx v0.5.0 // indirect github.com/subosito/gotenv v1.4.1 // indirect github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect + github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect github.com/tendermint/go-amino v0.16.0 // indirect github.com/tidwall/btree v1.5.0 // indirect github.com/tidwall/match v1.1.1 // indirect @@ -135,10 +148,9 @@ require ( ) replace ( - github.com/btcsuite/btcd => github.com/btcsuite/btcd v0.22.2 //indirect - github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.45.13-ics + github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.45.15-ics github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/stretchr/testify => github.com/stretchr/testify v1.7.1 - github.com/tendermint/tendermint => github.com/informalsystems/tendermint v0.34.26 + github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.27 google.golang.org/grpc => google.golang.org/grpc v1.33.2 ) diff --git a/go.sum b/go.sum index 1743a87dcf..1c111b9d37 100644 --- a/go.sum +++ b/go.sum @@ -40,26 +40,53 @@ cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= cloud.google.com/go v0.98.0/go.mod h1:ua6Ush4NALrHk5QXDWnjvZHN93OuF0HfuEPq9I1X0cM= cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= +cloud.google.com/go v0.100.1/go.mod h1:fs4QogzfH5n2pBXBP9vRiU+eCny7lD2vmFZy79Iuw1U= cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= +cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM= +cloud.google.com/go/accessapproval v1.4.0/go.mod h1:zybIuC3KpDOvotz59lFe5qxRZx6C75OtwbisN56xYB4= +cloud.google.com/go/accessapproval v1.5.0/go.mod h1:HFy3tuiGvMdcd/u+Cu5b9NkO1pEICJ46IR82PoUdplw= +cloud.google.com/go/accesscontextmanager v1.3.0/go.mod h1:TgCBehyr5gNMz7ZaH9xubp+CE8dkrszb4oK9CWyvD4o= +cloud.google.com/go/accesscontextmanager v1.4.0/go.mod h1:/Kjh7BBu/Gh83sv+K60vN9QE5NJcd80sU33vIe2IFPE= cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= +cloud.google.com/go/aiplatform v1.27.0/go.mod h1:Bvxqtl40l0WImSb04d0hXFU7gDOiq9jQmorivIiWcKg= cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= cloud.google.com/go/analytics v0.12.0/go.mod h1:gkfj9h6XRf9+TS4bmuhPEShsh3hH8PAZzm/41OOhQd4= +cloud.google.com/go/apigateway v1.3.0/go.mod h1:89Z8Bhpmxu6AmUxuVRg/ECRGReEdiP3vQtk4Z1J9rJk= +cloud.google.com/go/apigateway v1.4.0/go.mod h1:pHVY9MKGaH9PQ3pJ4YLzoj6U5FUDeDFBllIz7WmzJoc= +cloud.google.com/go/apigeeconnect v1.3.0/go.mod h1:G/AwXFAKo0gIXkPTVfZDd2qA1TxBXJ3MgMRBQkIi9jc= +cloud.google.com/go/apigeeconnect v1.4.0/go.mod h1:kV4NwOKqjvt2JYR0AoIWo2QGfoRtn/pkS3QlHp0Ni04= +cloud.google.com/go/appengine v1.4.0/go.mod h1:CS2NhuBuDXM9f+qscZ6V86m1MIIqPj3WC/UoEuR1Sno= +cloud.google.com/go/appengine v1.5.0/go.mod h1:TfasSozdkFI0zeoxW3PTBLiNqRmzraodCWatWI9Dmak= cloud.google.com/go/area120 v0.5.0/go.mod h1:DE/n4mp+iqVyvxHN41Vf1CR602GiHQjFPusMFW6bGR4= cloud.google.com/go/area120 v0.6.0/go.mod h1:39yFJqWVgm0UZqWTOdqkLhjoC7uFfgXRC8g/ZegeAh0= cloud.google.com/go/artifactregistry v1.6.0/go.mod h1:IYt0oBPSAGYj/kprzsBjZ/4LnG/zOcHyFHjWPCi6SAQ= cloud.google.com/go/artifactregistry v1.7.0/go.mod h1:mqTOFOnGZx8EtSqK/ZWcsm/4U8B77rbcLP6ruDU2Ixk= +cloud.google.com/go/artifactregistry v1.8.0/go.mod h1:w3GQXkJX8hiKN0v+at4b0qotwijQbYUqF2GWkZzAhC0= +cloud.google.com/go/artifactregistry v1.9.0/go.mod h1:2K2RqvA2CYvAeARHRkLDhMDJ3OXy26h3XW+3/Jh2uYc= cloud.google.com/go/asset v1.5.0/go.mod h1:5mfs8UvcM5wHhqtSv8J1CtxxaQq3AdBxxQi2jGW/K4o= cloud.google.com/go/asset v1.7.0/go.mod h1:YbENsRK4+xTiL+Ofoj5Ckf+O17kJtgp3Y3nn4uzZz5s= cloud.google.com/go/asset v1.8.0/go.mod h1:mUNGKhiqIdbr8X7KNayoYvyc4HbbFO9URsjbytpUaW0= +cloud.google.com/go/asset v1.9.0/go.mod h1:83MOE6jEJBMqFKadM9NLRcs80Gdw76qGuHn8m3h8oHQ= +cloud.google.com/go/asset v1.10.0/go.mod h1:pLz7uokL80qKhzKr4xXGvBQXnzHn5evJAEAtZiIb0wY= cloud.google.com/go/assuredworkloads v1.5.0/go.mod h1:n8HOZ6pff6re5KYfBXcFvSViQjDwxFkAkmUFffJRbbY= cloud.google.com/go/assuredworkloads v1.6.0/go.mod h1:yo2YOk37Yc89Rsd5QMVECvjaMKymF9OP+QXWlKXUkXw= cloud.google.com/go/assuredworkloads v1.7.0/go.mod h1:z/736/oNmtGAyU47reJgGN+KVoYoxeLBoj4XkKYscNI= +cloud.google.com/go/assuredworkloads v1.8.0/go.mod h1:AsX2cqyNCOvEQC8RMPnoc0yEarXQk6WEKkxYfL6kGIo= +cloud.google.com/go/assuredworkloads v1.9.0/go.mod h1:kFuI1P78bplYtT77Tb1hi0FMxM0vVpRC7VVoJC3ZoT0= cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0= cloud.google.com/go/automl v1.6.0/go.mod h1:ugf8a6Fx+zP0D59WLhqgTDsQI9w07o64uf/Is3Nh5p8= +cloud.google.com/go/automl v1.7.0/go.mod h1:RL9MYCCsJEOmt0Wf3z9uzG0a7adTT1fe+aObgSpkCt8= +cloud.google.com/go/automl v1.8.0/go.mod h1:xWx7G/aPEe/NP+qzYXktoBSDfjO+vnKMGgsApGJJquM= +cloud.google.com/go/baremetalsolution v0.3.0/go.mod h1:XOrocE+pvK1xFfleEnShBlNAXf+j5blPPxrhjKgnIFc= +cloud.google.com/go/baremetalsolution v0.4.0/go.mod h1:BymplhAadOO/eBa7KewQ0Ppg4A4Wplbn+PsFKRLo0uI= +cloud.google.com/go/batch v0.3.0/go.mod h1:TR18ZoAekj1GuirsUsR1ZTKN3FC/4UDnScjT8NXImFE= +cloud.google.com/go/batch v0.4.0/go.mod h1:WZkHnP43R/QCGQsZ+0JyG4i79ranE2u8xvjq/9+STPE= +cloud.google.com/go/beyondcorp v0.2.0/go.mod h1:TB7Bd+EEtcw9PCPQhCJtJGjk/7TC6ckmnSFS+xwTfm4= +cloud.google.com/go/beyondcorp v0.3.0/go.mod h1:E5U5lcrcXMsCuoDNyGrpyTm/hn7ne941Jz2vmksAxW8= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -67,13 +94,29 @@ cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUM cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/bigquery v1.42.0/go.mod h1:8dRTJxhtG+vwBKzE5OseQn/hiydoQN3EedCaOdYmxRA= +cloud.google.com/go/bigquery v1.43.0/go.mod h1:ZMQcXHsl+xmU1z36G2jNGZmKp9zNY5BUua5wDgmNCfw= +cloud.google.com/go/bigquery v1.44.0/go.mod h1:0Y33VqXTEsbamHJvJHdFmtqHvMIY28aK1+dFsvaChGc= cloud.google.com/go/bigtable v1.2.0/go.mod h1:JcVAOl45lrTmQfLj7T6TxyMzIN/3FGGcFm+2xVAli2o= cloud.google.com/go/billing v1.4.0/go.mod h1:g9IdKBEFlItS8bTtlrZdVLWSSdSyFUZKXNS02zKMOZY= cloud.google.com/go/billing v1.5.0/go.mod h1:mztb1tBc3QekhjSgmpf/CV4LzWXLzCArwpLmP2Gm88s= +cloud.google.com/go/billing v1.6.0/go.mod h1:WoXzguj+BeHXPbKfNWkqVtDdzORazmCjraY+vrxcyvI= +cloud.google.com/go/billing v1.7.0/go.mod h1:q457N3Hbj9lYwwRbnlD7vUpyjq6u5U1RAOArInEiD5Y= cloud.google.com/go/binaryauthorization v1.1.0/go.mod h1:xwnoWu3Y84jbuHa0zd526MJYmtnVXn0syOjaJgy4+dM= cloud.google.com/go/binaryauthorization v1.2.0/go.mod h1:86WKkJHtRcv5ViNABtYMhhNWRrD1Vpi//uKEy7aYEfI= +cloud.google.com/go/binaryauthorization v1.3.0/go.mod h1:lRZbKgjDIIQvzYQS1p99A7/U1JqvqeZg0wiI5tp6tg0= +cloud.google.com/go/binaryauthorization v1.4.0/go.mod h1:tsSPQrBd77VLplV70GUhBf/Zm3FsKmgSqgm4UmiDItk= +cloud.google.com/go/certificatemanager v1.3.0/go.mod h1:n6twGDvcUBFu9uBgt4eYvvf3sQ6My8jADcOVwHmzadg= +cloud.google.com/go/certificatemanager v1.4.0/go.mod h1:vowpercVFyqs8ABSmrdV+GiFf2H/ch3KyudYQEMM590= +cloud.google.com/go/channel v1.8.0/go.mod h1:W5SwCXDJsq/rg3tn3oG0LOxpAo6IMxNa09ngphpSlnk= +cloud.google.com/go/channel v1.9.0/go.mod h1:jcu05W0my9Vx4mt3/rEHpfxc9eKi9XwsdDL8yBMbKUk= +cloud.google.com/go/cloudbuild v1.3.0/go.mod h1:WequR4ULxlqvMsjDEEEFnOG5ZSRSgWOywXYDb1vPE6U= +cloud.google.com/go/cloudbuild v1.4.0/go.mod h1:5Qwa40LHiOXmz3386FrjrYM93rM/hdRr7b53sySrTqA= +cloud.google.com/go/clouddms v1.3.0/go.mod h1:oK6XsCDdW4Ib3jCCBugx+gVjevp2TMXFtgxvPSee3OM= +cloud.google.com/go/clouddms v1.4.0/go.mod h1:Eh7sUGCC+aKry14O1NRljhjyrr0NFC0G2cjwX0cByRk= cloud.google.com/go/cloudtasks v1.5.0/go.mod h1:fD92REy1x5woxkKEkLdvavGnPJGEn8Uic9nWuLzqCpY= cloud.google.com/go/cloudtasks v1.6.0/go.mod h1:C6Io+sxuke9/KNRkbQpihnW93SWDU3uXt92nu85HkYI= +cloud.google.com/go/cloudtasks v1.7.0/go.mod h1:ImsfdYWwlWNJbdgPIIGJWC+gemEGTBK/SunNQQNCAb4= +cloud.google.com/go/cloudtasks v1.8.0/go.mod h1:gQXUIwCSOI4yPVK7DgTVFiiP0ZW/eQkydWzwVMdHxrI= cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= @@ -83,69 +126,158 @@ cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQH cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= cloud.google.com/go/compute v1.12.0/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= cloud.google.com/go/compute v1.12.1/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= +cloud.google.com/go/compute v1.13.0/go.mod h1:5aPTS0cUNMIc1CE546K+Th6weJUNQErARyZtRXDJ8GE= cloud.google.com/go/compute/metadata v0.1.0/go.mod h1:Z1VN+bulIf6bt4P/C37K4DyZYZEXYonfTBHHFPO/4UU= cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= +cloud.google.com/go/contactcenterinsights v1.3.0/go.mod h1:Eu2oemoePuEFc/xKFPjbTuPSj0fYJcPls9TFlPNnHHY= +cloud.google.com/go/contactcenterinsights v1.4.0/go.mod h1:L2YzkGbPsv+vMQMCADxJoT9YiTTnSEd6fEvCeHTYVck= +cloud.google.com/go/container v1.6.0/go.mod h1:Xazp7GjJSeUYo688S+6J5V+n/t+G5sKBTFkKNudGRxg= +cloud.google.com/go/container v1.7.0/go.mod h1:Dp5AHtmothHGX3DwwIHPgq45Y8KmNsgN3amoYfxVkLo= cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0= cloud.google.com/go/datacatalog v1.5.0/go.mod h1:M7GPLNQeLfWqeIm3iuiruhPzkt65+Bx8dAKvScX8jvs= cloud.google.com/go/datacatalog v1.6.0/go.mod h1:+aEyF8JKg+uXcIdAmmaMUmZ3q1b/lKLtXCmXdnc0lbc= +cloud.google.com/go/datacatalog v1.7.0/go.mod h1:9mEl4AuDYWw81UGc41HonIHH7/sn52H0/tc8f8ZbZIE= +cloud.google.com/go/datacatalog v1.8.0/go.mod h1:KYuoVOv9BM8EYz/4eMFxrr4DUKhGIOXxZoKYF5wdISM= cloud.google.com/go/dataflow v0.6.0/go.mod h1:9QwV89cGoxjjSR9/r7eFDqqjtvbKxAK2BaYU6PVk9UM= cloud.google.com/go/dataflow v0.7.0/go.mod h1:PX526vb4ijFMesO1o202EaUmouZKBpjHsTlCtB4parQ= cloud.google.com/go/dataform v0.3.0/go.mod h1:cj8uNliRlHpa6L3yVhDOBrUXH+BPAO1+KFMQQNSThKo= cloud.google.com/go/dataform v0.4.0/go.mod h1:fwV6Y4Ty2yIFL89huYlEkwUPtS7YZinZbzzj5S9FzCE= +cloud.google.com/go/dataform v0.5.0/go.mod h1:GFUYRe8IBa2hcomWplodVmUx/iTL0FrsauObOM3Ipr0= +cloud.google.com/go/datafusion v1.4.0/go.mod h1:1Zb6VN+W6ALo85cXnM1IKiPw+yQMKMhB9TsTSRDo/38= +cloud.google.com/go/datafusion v1.5.0/go.mod h1:Kz+l1FGHB0J+4XF2fud96WMmRiq/wj8N9u007vyXZ2w= cloud.google.com/go/datalabeling v0.5.0/go.mod h1:TGcJ0G2NzcsXSE/97yWjIZO0bXj0KbVlINXMG9ud42I= cloud.google.com/go/datalabeling v0.6.0/go.mod h1:WqdISuk/+WIGeMkpw/1q7bK/tFEZxsrFJOJdY2bXvTQ= +cloud.google.com/go/dataplex v1.3.0/go.mod h1:hQuRtDg+fCiFgC8j0zV222HvzFQdRd+SVX8gdmFcZzA= +cloud.google.com/go/dataplex v1.4.0/go.mod h1:X51GfLXEMVJ6UN47ESVqvlsRplbLhcsAt0kZCCKsU0A= +cloud.google.com/go/dataproc v1.7.0/go.mod h1:CKAlMjII9H90RXaMpSxQ8EU6dQx6iAYNPcYPOkSbi8s= +cloud.google.com/go/dataproc v1.8.0/go.mod h1:5OW+zNAH0pMpw14JVrPONsxMQYMBqJuzORhIBfBn9uI= cloud.google.com/go/dataqna v0.5.0/go.mod h1:90Hyk596ft3zUQ8NkFfvICSIfHFh1Bc7C4cK3vbhkeo= cloud.google.com/go/dataqna v0.6.0/go.mod h1:1lqNpM7rqNLVgWBJyk5NF6Uen2PHym0jtVJonplVsDA= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/datastore v1.10.0/go.mod h1:PC5UzAmDEkAmkfaknstTYbNpgE49HAgW2J1gcgUfmdM= cloud.google.com/go/datastream v1.2.0/go.mod h1:i/uTP8/fZwgATHS/XFu0TcNUhuA0twZxxQ3EyCUQMwo= cloud.google.com/go/datastream v1.3.0/go.mod h1:cqlOX8xlyYF/uxhiKn6Hbv6WjwPPuI9W2M9SAXwaLLQ= +cloud.google.com/go/datastream v1.4.0/go.mod h1:h9dpzScPhDTs5noEMQVWP8Wx8AFBRyS0s8KWPx/9r0g= +cloud.google.com/go/datastream v1.5.0/go.mod h1:6TZMMNPwjUqZHBKPQ1wwXpb0d5VDVPl2/XoS5yi88q4= +cloud.google.com/go/deploy v1.4.0/go.mod h1:5Xghikd4VrmMLNaF6FiRFDlHb59VM59YoDQnOUdsH/c= +cloud.google.com/go/deploy v1.5.0/go.mod h1:ffgdD0B89tToyW/U/D2eL0jN2+IEV/3EMuXHA0l4r+s= cloud.google.com/go/dialogflow v1.15.0/go.mod h1:HbHDWs33WOGJgn6rfzBW1Kv807BE3O1+xGbn59zZWI4= cloud.google.com/go/dialogflow v1.16.1/go.mod h1:po6LlzGfK+smoSmTBnbkIZY2w8ffjz/RcGSS+sh1el0= cloud.google.com/go/dialogflow v1.17.0/go.mod h1:YNP09C/kXA1aZdBgC/VtXX74G/TKn7XVCcVumTflA+8= +cloud.google.com/go/dialogflow v1.18.0/go.mod h1:trO7Zu5YdyEuR+BhSNOqJezyFQ3aUzz0njv7sMx/iek= +cloud.google.com/go/dialogflow v1.19.0/go.mod h1:JVmlG1TwykZDtxtTXujec4tQ+D8SBFMoosgy+6Gn0s0= +cloud.google.com/go/dlp v1.6.0/go.mod h1:9eyB2xIhpU0sVwUixfBubDoRwP+GjeUoxxeueZmqvmM= +cloud.google.com/go/dlp v1.7.0/go.mod h1:68ak9vCiMBjbasxeVD17hVPxDEck+ExiHavX8kiHG+Q= cloud.google.com/go/documentai v1.7.0/go.mod h1:lJvftZB5NRiFSX4moiye1SMxHx0Bc3x1+p9e/RfXYiU= cloud.google.com/go/documentai v1.8.0/go.mod h1:xGHNEB7CtsnySCNrCFdCyyMz44RhFEEX2Q7UD0c5IhU= +cloud.google.com/go/documentai v1.9.0/go.mod h1:FS5485S8R00U10GhgBC0aNGrJxBP8ZVpEeJ7PQDZd6k= +cloud.google.com/go/documentai v1.10.0/go.mod h1:vod47hKQIPeCfN2QS/jULIvQTugbmdc0ZvxxfQY1bg4= cloud.google.com/go/domains v0.6.0/go.mod h1:T9Rz3GasrpYk6mEGHh4rymIhjlnIuB4ofT1wTxDeT4Y= cloud.google.com/go/domains v0.7.0/go.mod h1:PtZeqS1xjnXuRPKE/88Iru/LdfoRyEHYA9nFQf4UKpg= cloud.google.com/go/edgecontainer v0.1.0/go.mod h1:WgkZ9tp10bFxqO8BLPqv2LlfmQF1X8lZqwW4r1BTajk= cloud.google.com/go/edgecontainer v0.2.0/go.mod h1:RTmLijy+lGpQ7BXuTDa4C4ssxyXT34NIuHIgKuP4s5w= +cloud.google.com/go/errorreporting v0.3.0/go.mod h1:xsP2yaAp+OAW4OIm60An2bbLpqIhKXdWR/tawvl7QzU= +cloud.google.com/go/essentialcontacts v1.3.0/go.mod h1:r+OnHa5jfj90qIfZDO/VztSFqbQan7HV75p8sA+mdGI= +cloud.google.com/go/essentialcontacts v1.4.0/go.mod h1:8tRldvHYsmnBCHdFpvU+GL75oWiBKl80BiqlFh9tp+8= +cloud.google.com/go/eventarc v1.7.0/go.mod h1:6ctpF3zTnaQCxUjHUdcfgcA1A2T309+omHZth7gDfmc= +cloud.google.com/go/eventarc v1.8.0/go.mod h1:imbzxkyAU4ubfsaKYdQg04WS1NvncblHEup4kvF+4gw= +cloud.google.com/go/filestore v1.3.0/go.mod h1:+qbvHGvXU1HaKX2nD0WEPo92TP/8AQuCVEBXNY9z0+w= +cloud.google.com/go/filestore v1.4.0/go.mod h1:PaG5oDfo9r224f8OYXURtAsY+Fbyq/bLYoINEK8XQAI= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/firestore v1.6.1/go.mod h1:asNXNOzBdyVQmEU+ggO8UPodTkEVFW5Qx+rwHnAz+EY= cloud.google.com/go/firestore v1.8.0/go.mod h1:r3KB8cAdRIe8znzoPWLw8S6gpDVd9treohhn8b09424= +cloud.google.com/go/firestore v1.9.0/go.mod h1:HMkjKHNTtRyZNiMzu7YAsLr9K3X2udY2AMwDaMEQiiE= cloud.google.com/go/functions v1.6.0/go.mod h1:3H1UA3qiIPRWD7PeZKLvHZ9SaQhR26XIJcC0A5GbvAk= cloud.google.com/go/functions v1.7.0/go.mod h1:+d+QBcWM+RsrgZfV9xo6KfA1GlzJfxcfZcRPEhDDfzg= +cloud.google.com/go/functions v1.8.0/go.mod h1:RTZ4/HsQjIqIYP9a9YPbU+QFoQsAlYgrwOXJWHn1POY= +cloud.google.com/go/functions v1.9.0/go.mod h1:Y+Dz8yGguzO3PpIjhLTbnqV1CWmgQ5UwtlpzoyquQ08= cloud.google.com/go/gaming v1.5.0/go.mod h1:ol7rGcxP/qHTRQE/RO4bxkXq+Fix0j6D4LFPzYTIrDM= cloud.google.com/go/gaming v1.6.0/go.mod h1:YMU1GEvA39Qt3zWGyAVA9bpYz/yAhTvaQ1t2sK4KPUA= +cloud.google.com/go/gaming v1.7.0/go.mod h1:LrB8U7MHdGgFG851iHAfqUdLcKBdQ55hzXy9xBJz0+w= +cloud.google.com/go/gaming v1.8.0/go.mod h1:xAqjS8b7jAVW0KFYeRUxngo9My3f33kFmua++Pi+ggM= +cloud.google.com/go/gkebackup v0.2.0/go.mod h1:XKvv/4LfG829/B8B7xRkk8zRrOEbKtEam6yNfuQNH60= +cloud.google.com/go/gkebackup v0.3.0/go.mod h1:n/E671i1aOQvUxT541aTkCwExO/bTer2HDlj4TsBRAo= cloud.google.com/go/gkeconnect v0.5.0/go.mod h1:c5lsNAg5EwAy7fkqX/+goqFsU1Da/jQFqArp+wGNr/o= cloud.google.com/go/gkeconnect v0.6.0/go.mod h1:Mln67KyU/sHJEBY8kFZ0xTeyPtzbq9StAVvEULYK16A= cloud.google.com/go/gkehub v0.9.0/go.mod h1:WYHN6WG8w9bXU0hqNxt8rm5uxnk8IH+lPY9J2TV7BK0= cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y977wO+hBH0= +cloud.google.com/go/gkemulticloud v0.3.0/go.mod h1:7orzy7O0S+5kq95e4Hpn7RysVA7dPs8W/GgfUtsPbrA= +cloud.google.com/go/gkemulticloud v0.4.0/go.mod h1:E9gxVBnseLWCk24ch+P9+B2CoDFJZTyIgLKSalC7tuI= cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= +cloud.google.com/go/gsuiteaddons v1.3.0/go.mod h1:EUNK/J1lZEZO8yPtykKxLXI6JSVN2rg9bN8SXOa0bgM= +cloud.google.com/go/gsuiteaddons v1.4.0/go.mod h1:rZK5I8hht7u7HxFQcFei0+AtfS9uSushomRlg+3ua1o= +cloud.google.com/go/iam v0.1.0/go.mod h1:vcUNEa0pEm0qRVpmWepWaFMIAI8/hjB9mO8rNCJtF6c= cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= +cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= +cloud.google.com/go/iam v0.6.0/go.mod h1:+1AH33ueBne5MzYccyMHtEKqLE4/kJOibtffMHDMFMc= +cloud.google.com/go/iam v0.7.0/go.mod h1:H5Br8wRaDGNc8XP3keLc4unfUUZeyH3Sfl9XpQEYOeg= +cloud.google.com/go/iam v0.8.0/go.mod h1:lga0/y3iH6CX7sYqypWJ33hf7kkfXJag67naqGESjkE= +cloud.google.com/go/iap v1.4.0/go.mod h1:RGFwRJdihTINIe4wZ2iCP0zF/qu18ZwyKxrhMhygBEc= +cloud.google.com/go/iap v1.5.0/go.mod h1:UH/CGgKd4KyohZL5Pt0jSKE4m3FR51qg6FKQ/z/Ix9A= +cloud.google.com/go/ids v1.1.0/go.mod h1:WIuwCaYVOzHIj2OhN9HAwvW+DBdmUAdcWlFxRl+KubM= +cloud.google.com/go/ids v1.2.0/go.mod h1:5WXvp4n25S0rA/mQWAg1YEEBBq6/s+7ml1RDCW1IrcY= +cloud.google.com/go/iot v1.3.0/go.mod h1:r7RGh2B61+B8oz0AGE+J72AhA0G7tdXItODWsaA2oLs= +cloud.google.com/go/iot v1.4.0/go.mod h1:dIDxPOn0UvNDUMD8Ger7FIaTuvMkj+aGk94RPP0iV+g= +cloud.google.com/go/kms v1.4.0/go.mod h1:fajBHndQ+6ubNw6Ss2sSd+SWvjL26RNo/dr7uxsnnOA= +cloud.google.com/go/kms v1.5.0/go.mod h1:QJS2YY0eJGBg3mnDfuaCyLauWwBJiHRboYxJ++1xJNg= +cloud.google.com/go/kms v1.6.0/go.mod h1:Jjy850yySiasBUDi6KFUwUv2n1+o7QZFyuUJg6OgjA0= cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= +cloud.google.com/go/language v1.7.0/go.mod h1:DJ6dYN/W+SQOjF8e1hLQXMF21AkH2w9wiPzPCJa2MIE= +cloud.google.com/go/language v1.8.0/go.mod h1:qYPVHf7SPoNNiCL2Dr0FfEFNil1qi3pQEyygwpgVKB8= cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08= +cloud.google.com/go/logging v1.6.1/go.mod h1:5ZO0mHHbvm8gEmeEUHrmDlTDSu5imF6MUP9OfilNXBw= +cloud.google.com/go/longrunning v0.1.1/go.mod h1:UUFxuDWkv22EuY93jjmDMFT5GPQKeFVJBIF6QlTqdsE= +cloud.google.com/go/longrunning v0.3.0/go.mod h1:qth9Y41RRSUE69rDcOn6DdK3HfQfsUI0YSmW3iIlLJc= +cloud.google.com/go/managedidentities v1.3.0/go.mod h1:UzlW3cBOiPrzucO5qWkNkh0w33KFtBJU281hacNvsdE= +cloud.google.com/go/managedidentities v1.4.0/go.mod h1:NWSBYbEMgqmbZsLIyKvxrYbtqOsxY1ZrGM+9RgDqInM= +cloud.google.com/go/maps v0.1.0/go.mod h1:BQM97WGyfw9FWEmQMpZ5T6cpovXXSd1cGmFma94eubI= cloud.google.com/go/mediatranslation v0.5.0/go.mod h1:jGPUhGTybqsPQn91pNXw0xVHfuJ3leR1wj37oU3y1f4= cloud.google.com/go/mediatranslation v0.6.0/go.mod h1:hHdBCTYNigsBxshbznuIMFNe5QXEowAuNmmC7h8pu5w= cloud.google.com/go/memcache v1.4.0/go.mod h1:rTOfiGZtJX1AaFUrOgsMHX5kAzaTQ8azHiuDoTPzNsE= cloud.google.com/go/memcache v1.5.0/go.mod h1:dk3fCK7dVo0cUU2c36jKb4VqKPS22BTkf81Xq617aWM= +cloud.google.com/go/memcache v1.6.0/go.mod h1:XS5xB0eQZdHtTuTF9Hf8eJkKtR3pVRCcvJwtm68T3rA= +cloud.google.com/go/memcache v1.7.0/go.mod h1:ywMKfjWhNtkQTxrWxCkCFkoPjLHPW6A7WOTVI8xy3LY= cloud.google.com/go/metastore v1.5.0/go.mod h1:2ZNrDcQwghfdtCwJ33nM0+GrBGlVuh8rakL3vdPY3XY= cloud.google.com/go/metastore v1.6.0/go.mod h1:6cyQTls8CWXzk45G55x57DVQ9gWg7RiH65+YgPsNh9s= +cloud.google.com/go/metastore v1.7.0/go.mod h1:s45D0B4IlsINu87/AsWiEVYbLaIMeUSoxlKKDqBGFS8= +cloud.google.com/go/metastore v1.8.0/go.mod h1:zHiMc4ZUpBiM7twCIFQmJ9JMEkDSyZS9U12uf7wHqSI= +cloud.google.com/go/monitoring v1.7.0/go.mod h1:HpYse6kkGo//7p6sT0wsIC6IBDET0RhIsnmlA53dvEk= +cloud.google.com/go/monitoring v1.8.0/go.mod h1:E7PtoMJ1kQXWxPjB6mv2fhC5/15jInuulFdYYtlcvT4= cloud.google.com/go/networkconnectivity v1.4.0/go.mod h1:nOl7YL8odKyAOtzNX73/M5/mGZgqqMeryi6UPZTk/rA= cloud.google.com/go/networkconnectivity v1.5.0/go.mod h1:3GzqJx7uhtlM3kln0+x5wyFvuVH1pIBJjhCpjzSt75o= +cloud.google.com/go/networkconnectivity v1.6.0/go.mod h1:OJOoEXW+0LAxHh89nXd64uGG+FbQoeH8DtxCHVOMlaM= +cloud.google.com/go/networkconnectivity v1.7.0/go.mod h1:RMuSbkdbPwNMQjB5HBWD5MpTBnNm39iAVpC3TmsExt8= +cloud.google.com/go/networkmanagement v1.4.0/go.mod h1:Q9mdLLRn60AsOrPc8rs8iNV6OHXaGcDdsIQe1ohekq8= +cloud.google.com/go/networkmanagement v1.5.0/go.mod h1:ZnOeZ/evzUdUsnvRt792H0uYEnHQEMaz+REhhzJRcf4= cloud.google.com/go/networksecurity v0.5.0/go.mod h1:xS6fOCoqpVC5zx15Z/MqkfDwH4+m/61A3ODiDV1xmiQ= cloud.google.com/go/networksecurity v0.6.0/go.mod h1:Q5fjhTr9WMI5mbpRYEbiexTzROf7ZbDzvzCrNl14nyU= cloud.google.com/go/notebooks v1.2.0/go.mod h1:9+wtppMfVPUeJ8fIWPOq1UnATHISkGXGqTkxeieQ6UY= cloud.google.com/go/notebooks v1.3.0/go.mod h1:bFR5lj07DtCPC7YAAJ//vHskFBxA5JzYlH68kXVdk34= +cloud.google.com/go/notebooks v1.4.0/go.mod h1:4QPMngcwmgb6uw7Po99B2xv5ufVoIQ7nOGDyL4P8AgA= +cloud.google.com/go/notebooks v1.5.0/go.mod h1:q8mwhnP9aR8Hpfnrc5iN5IBhrXUy8S2vuYs+kBJ/gu0= +cloud.google.com/go/optimization v1.1.0/go.mod h1:5po+wfvX5AQlPznyVEZjGJTMr4+CAkJf2XSTQOOl9l4= +cloud.google.com/go/optimization v1.2.0/go.mod h1:Lr7SOHdRDENsh+WXVmQhQTrzdu9ybg0NecjHidBq6xs= +cloud.google.com/go/orchestration v1.3.0/go.mod h1:Sj5tq/JpWiB//X/q3Ngwdl5K7B7Y0KZ7bfv0wL6fqVA= +cloud.google.com/go/orchestration v1.4.0/go.mod h1:6W5NLFWs2TlniBphAViZEVhrXRSMgUGDfW7vrWKvsBk= +cloud.google.com/go/orgpolicy v1.4.0/go.mod h1:xrSLIV4RePWmP9P3tBl8S93lTmlAxjm06NSm2UTmKvE= +cloud.google.com/go/orgpolicy v1.5.0/go.mod h1:hZEc5q3wzwXJaKrsx5+Ewg0u1LxJ51nNFlext7Tanwc= cloud.google.com/go/osconfig v1.7.0/go.mod h1:oVHeCeZELfJP7XLxcBGTMBvRO+1nQ5tFG9VQTmYS2Fs= cloud.google.com/go/osconfig v1.8.0/go.mod h1:EQqZLu5w5XA7eKizepumcvWx+m8mJUhEwiPqWiZeEdg= +cloud.google.com/go/osconfig v1.9.0/go.mod h1:Yx+IeIZJ3bdWmzbQU4fxNl8xsZ4amB+dygAwFPlvnNo= +cloud.google.com/go/osconfig v1.10.0/go.mod h1:uMhCzqC5I8zfD9zDEAfvgVhDS8oIjySWh+l4WK6GnWw= cloud.google.com/go/oslogin v1.4.0/go.mod h1:YdgMXWRaElXz/lDk1Na6Fh5orF7gvmJ0FGLIs9LId4E= cloud.google.com/go/oslogin v1.5.0/go.mod h1:D260Qj11W2qx/HVF29zBg+0fd6YCSjSqLUkY/qEenQU= +cloud.google.com/go/oslogin v1.6.0/go.mod h1:zOJ1O3+dTU8WPlGEkFSh7qeHPPSoxrcMbbK1Nm2iX70= +cloud.google.com/go/oslogin v1.7.0/go.mod h1:e04SN0xO1UNJ1M5GP0vzVBFicIe4O53FOfcixIqTyXo= cloud.google.com/go/phishingprotection v0.5.0/go.mod h1:Y3HZknsK9bc9dMi+oE8Bim0lczMU6hrX0UpADuMefr0= cloud.google.com/go/phishingprotection v0.6.0/go.mod h1:9Y3LBLgy0kDTcYET8ZH3bq/7qni15yVUoAxiFxnlSUA= +cloud.google.com/go/policytroubleshooter v1.3.0/go.mod h1:qy0+VwANja+kKrjlQuOzmlvscn4RNsAc0e15GGqfMxg= +cloud.google.com/go/policytroubleshooter v1.4.0/go.mod h1:DZT4BcRw3QoO8ota9xw/LKtPa8lKeCByYeKTIf/vxdE= cloud.google.com/go/privatecatalog v0.5.0/go.mod h1:XgosMUvvPyxDjAVNDYxJ7wBW8//hLDDYmnsNcMGq1K0= cloud.google.com/go/privatecatalog v0.6.0/go.mod h1:i/fbkZR0hLN29eEWiiwue8Pb+GforiEIBnV9yrRUOKI= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= @@ -153,31 +285,69 @@ cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+ cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= cloud.google.com/go/pubsub v1.5.0/go.mod h1:ZEwJccE3z93Z2HWvstpri00jOg7oO4UZDtKhwDwqF0w= +cloud.google.com/go/pubsub v1.26.0/go.mod h1:QgBH3U/jdJy/ftjPhTkyXNj543Tin1pRYcdcPRnFIRI= +cloud.google.com/go/pubsub v1.27.1/go.mod h1:hQN39ymbV9geqBnfQq6Xf63yNhUAhv9CZhzp5O6qsW0= +cloud.google.com/go/pubsublite v1.5.0/go.mod h1:xapqNQ1CuLfGi23Yda/9l4bBCKz/wC3KIJ5gKcxveZg= cloud.google.com/go/recaptchaenterprise v1.3.1/go.mod h1:OdD+q+y4XGeAlxRaMn1Y7/GveP6zmq76byL6tjPE7d4= cloud.google.com/go/recaptchaenterprise/v2 v2.1.0/go.mod h1:w9yVqajwroDNTfGuhmOjPDN//rZGySaf6PtFVcSCa7o= cloud.google.com/go/recaptchaenterprise/v2 v2.2.0/go.mod h1:/Zu5jisWGeERrd5HnlS3EUGb/D335f9k51B/FVil0jk= cloud.google.com/go/recaptchaenterprise/v2 v2.3.0/go.mod h1:O9LwGCjrhGHBQET5CA7dd5NwwNQUErSgEDit1DLNTdo= +cloud.google.com/go/recaptchaenterprise/v2 v2.4.0/go.mod h1:Am3LHfOuBstrLrNCBrlI5sbwx9LBg3te2N6hGvHn2mE= +cloud.google.com/go/recaptchaenterprise/v2 v2.5.0/go.mod h1:O8LzcHXN3rz0j+LBC91jrwI3R+1ZSZEWrfL7XHgNo9U= cloud.google.com/go/recommendationengine v0.5.0/go.mod h1:E5756pJcVFeVgaQv3WNpImkFP8a+RptV6dDLGPILjvg= cloud.google.com/go/recommendationengine v0.6.0/go.mod h1:08mq2umu9oIqc7tDy8sx+MNJdLG0fUi3vaSVbztHgJ4= cloud.google.com/go/recommender v1.5.0/go.mod h1:jdoeiBIVrJe9gQjwd759ecLJbxCDED4A6p+mqoqDvTg= cloud.google.com/go/recommender v1.6.0/go.mod h1:+yETpm25mcoiECKh9DEScGzIRyDKpZ0cEhWGo+8bo+c= +cloud.google.com/go/recommender v1.7.0/go.mod h1:XLHs/W+T8olwlGOgfQenXBTbIseGclClff6lhFVe9Bs= +cloud.google.com/go/recommender v1.8.0/go.mod h1:PkjXrTT05BFKwxaUxQmtIlrtj0kph108r02ZZQ5FE70= cloud.google.com/go/redis v1.7.0/go.mod h1:V3x5Jq1jzUcg+UNsRvdmsfuFnit1cfe3Z/PGyq/lm4Y= cloud.google.com/go/redis v1.8.0/go.mod h1:Fm2szCDavWzBk2cDKxrkmWBqoCiL1+Ctwq7EyqBCA/A= +cloud.google.com/go/redis v1.9.0/go.mod h1:HMYQuajvb2D0LvMgZmLDZW8V5aOC/WxstZHiy4g8OiA= +cloud.google.com/go/redis v1.10.0/go.mod h1:ThJf3mMBQtW18JzGgh41/Wld6vnDDc/F/F35UolRZPM= +cloud.google.com/go/resourcemanager v1.3.0/go.mod h1:bAtrTjZQFJkiWTPDb1WBjzvc6/kifjj4QBYuKCCoqKA= +cloud.google.com/go/resourcemanager v1.4.0/go.mod h1:MwxuzkumyTX7/a3n37gmsT3py7LIXwrShilPh3P1tR0= +cloud.google.com/go/resourcesettings v1.3.0/go.mod h1:lzew8VfESA5DQ8gdlHwMrqZs1S9V87v3oCnKCWoOuQU= +cloud.google.com/go/resourcesettings v1.4.0/go.mod h1:ldiH9IJpcrlC3VSuCGvjR5of/ezRrOxFtpJoJo5SmXg= cloud.google.com/go/retail v1.8.0/go.mod h1:QblKS8waDmNUhghY2TI9O3JLlFk8jybHeV4BF19FrE4= cloud.google.com/go/retail v1.9.0/go.mod h1:g6jb6mKuCS1QKnH/dpu7isX253absFl6iE92nHwlBUY= +cloud.google.com/go/retail v1.10.0/go.mod h1:2gDk9HsL4HMS4oZwz6daui2/jmKvqShXKQuB2RZ+cCc= +cloud.google.com/go/retail v1.11.0/go.mod h1:MBLk1NaWPmh6iVFSz9MeKG/Psyd7TAgm6y/9L2B4x9Y= +cloud.google.com/go/run v0.2.0/go.mod h1:CNtKsTA1sDcnqqIFR3Pb5Tq0usWxJJvsWOCPldRU3Do= +cloud.google.com/go/run v0.3.0/go.mod h1:TuyY1+taHxTjrD0ZFk2iAR+xyOXEA0ztb7U3UNA0zBo= cloud.google.com/go/scheduler v1.4.0/go.mod h1:drcJBmxF3aqZJRhmkHQ9b3uSSpQoltBPGPxGAWROx6s= cloud.google.com/go/scheduler v1.5.0/go.mod h1:ri073ym49NW3AfT6DZi21vLZrG07GXr5p3H1KxN5QlI= +cloud.google.com/go/scheduler v1.6.0/go.mod h1:SgeKVM7MIwPn3BqtcBntpLyrIJftQISRrYB5ZtT+KOk= +cloud.google.com/go/scheduler v1.7.0/go.mod h1:jyCiBqWW956uBjjPMMuX09n3x37mtyPJegEWKxRsn44= cloud.google.com/go/secretmanager v1.6.0/go.mod h1:awVa/OXF6IiyaU1wQ34inzQNc4ISIDIrId8qE5QGgKA= +cloud.google.com/go/secretmanager v1.8.0/go.mod h1:hnVgi/bN5MYHd3Gt0SPuTPPp5ENina1/LxM+2W9U9J4= +cloud.google.com/go/secretmanager v1.9.0/go.mod h1:b71qH2l1yHmWQHt9LC80akm86mX8AL6X1MA01dW8ht4= cloud.google.com/go/security v1.5.0/go.mod h1:lgxGdyOKKjHL4YG3/YwIL2zLqMFCKs0UbQwgyZmfJl4= cloud.google.com/go/security v1.7.0/go.mod h1:mZklORHl6Bg7CNnnjLH//0UlAlaXqiG7Lb9PsPXLfD0= cloud.google.com/go/security v1.8.0/go.mod h1:hAQOwgmaHhztFhiQ41CjDODdWP0+AE1B3sX4OFlq+GU= +cloud.google.com/go/security v1.9.0/go.mod h1:6Ta1bO8LXI89nZnmnsZGp9lVoVWXqsVbIq/t9dzI+2Q= +cloud.google.com/go/security v1.10.0/go.mod h1:QtOMZByJVlibUT2h9afNDWRZ1G96gVywH8T5GUSb9IA= cloud.google.com/go/securitycenter v1.13.0/go.mod h1:cv5qNAqjY84FCN6Y9z28WlkKXyWsgLO832YiWwkCWcU= cloud.google.com/go/securitycenter v1.14.0/go.mod h1:gZLAhtyKv85n52XYWt6RmeBdydyxfPeTrpToDPw4Auc= +cloud.google.com/go/securitycenter v1.15.0/go.mod h1:PeKJ0t8MoFmmXLXWm41JidyzI3PJjd8sXWaVqg43WWk= +cloud.google.com/go/securitycenter v1.16.0/go.mod h1:Q9GMaLQFUD+5ZTabrbujNWLtSLZIZF7SAR0wWECrjdk= +cloud.google.com/go/servicecontrol v1.4.0/go.mod h1:o0hUSJ1TXJAmi/7fLJAedOovnujSEvjKCAFNXPQ1RaU= +cloud.google.com/go/servicecontrol v1.5.0/go.mod h1:qM0CnXHhyqKVuiZnGKrIurvVImCs8gmqWsDoqe9sU1s= cloud.google.com/go/servicedirectory v1.4.0/go.mod h1:gH1MUaZCgtP7qQiI+F+A+OpeKF/HQWgtAddhTbhL2bs= cloud.google.com/go/servicedirectory v1.5.0/go.mod h1:QMKFL0NUySbpZJ1UZs3oFAmdvVxhhxB6eJ/Vlp73dfg= +cloud.google.com/go/servicedirectory v1.6.0/go.mod h1:pUlbnWsLH9c13yGkxCmfumWEPjsRs1RlmJ4pqiNjVL4= +cloud.google.com/go/servicedirectory v1.7.0/go.mod h1:5p/U5oyvgYGYejufvxhgwjL8UVXjkuw7q5XcG10wx1U= +cloud.google.com/go/servicemanagement v1.4.0/go.mod h1:d8t8MDbezI7Z2R1O/wu8oTggo3BI2GKYbdG4y/SJTco= +cloud.google.com/go/servicemanagement v1.5.0/go.mod h1:XGaCRe57kfqu4+lRxaFEAuqmjzF0r+gWHjWqKqBvKFo= +cloud.google.com/go/serviceusage v1.3.0/go.mod h1:Hya1cozXM4SeSKTAgGXgj97GlqUvF5JaoXacR1JTP/E= +cloud.google.com/go/serviceusage v1.4.0/go.mod h1:SB4yxXSaYVuUBYUml6qklyONXNLt83U0Rb+CXyhjEeU= +cloud.google.com/go/shell v1.3.0/go.mod h1:VZ9HmRjZBsjLGXusm7K5Q5lzzByZmJHf1d0IWHEN5X4= +cloud.google.com/go/shell v1.4.0/go.mod h1:HDxPzZf3GkDdhExzD/gs8Grqk+dmYcEjGShZgYa9URw= cloud.google.com/go/spanner v1.7.0/go.mod h1:sd3K2gZ9Fd0vMPLXzeCrF6fq4i63Q7aTLW/lBIfBkIk= +cloud.google.com/go/spanner v1.41.0/go.mod h1:MLYDBJR/dY4Wt7ZaMIQ7rXOTLjYrmxLE/5ve9vFfWos= cloud.google.com/go/speech v1.6.0/go.mod h1:79tcr4FHCimOp56lwC01xnt/WPJZc4v3gzyT7FoBkCM= cloud.google.com/go/speech v1.7.0/go.mod h1:KptqL+BAQIhMsj1kOP2la5DSEEerPDuOP/2mmkhHhZQ= +cloud.google.com/go/speech v1.8.0/go.mod h1:9bYIl1/tjsAnMgKGHKmBZzXKEkGgtU+MpdDPTE9f7y0= +cloud.google.com/go/speech v1.9.0/go.mod h1:xQ0jTcmnRFFM2RfX/U+rk6FQNUF6DQlydUSyoooSpco= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= @@ -186,17 +356,47 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= +cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= +cloud.google.com/go/storagetransfer v1.5.0/go.mod h1:dxNzUopWy7RQevYFHewchb29POFv3/AaBgnhqzqiK0w= +cloud.google.com/go/storagetransfer v1.6.0/go.mod h1:y77xm4CQV/ZhFZH75PLEXY0ROiS7Gh6pSKrM8dJyg6I= cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= +cloud.google.com/go/talent v1.3.0/go.mod h1:CmcxwJ/PKfRgd1pBjQgU6W3YBwiewmUzQYH5HHmSCmM= +cloud.google.com/go/talent v1.4.0/go.mod h1:ezFtAgVuRf8jRsvyE6EwmbTK5LKciD4KVnHuDEFmOOA= +cloud.google.com/go/texttospeech v1.4.0/go.mod h1:FX8HQHA6sEpJ7rCMSfXuzBcysDAuWusNNNvN9FELDd8= +cloud.google.com/go/texttospeech v1.5.0/go.mod h1:oKPLhR4n4ZdQqWKURdwxMy0uiTS1xU161C8W57Wkea4= +cloud.google.com/go/tpu v1.3.0/go.mod h1:aJIManG0o20tfDQlRIej44FcwGGl/cD0oiRyMKG19IQ= +cloud.google.com/go/tpu v1.4.0/go.mod h1:mjZaX8p0VBgllCzF6wcU2ovUXN9TONFLd7iz227X2Xg= +cloud.google.com/go/trace v1.3.0/go.mod h1:FFUE83d9Ca57C+K8rDl/Ih8LwOzWIV1krKgxg6N0G28= +cloud.google.com/go/trace v1.4.0/go.mod h1:UG0v8UBqzusp+z63o7FK74SdFE+AXpCLdFb1rshXG+Y= +cloud.google.com/go/translate v1.3.0/go.mod h1:gzMUwRjvOqj5i69y/LYLd8RrNQk+hOmIXTi9+nb3Djs= +cloud.google.com/go/translate v1.4.0/go.mod h1:06Dn/ppvLD6WvA5Rhdp029IX2Mi3Mn7fpMRLPvXT5Wg= +cloud.google.com/go/video v1.8.0/go.mod h1:sTzKFc0bUSByE8Yoh8X0mn8bMymItVGPfTuUBUyRgxk= +cloud.google.com/go/video v1.9.0/go.mod h1:0RhNKFRF5v92f8dQt0yhaHrEuH95m068JYOvLZYnJSw= cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= cloud.google.com/go/videointelligence v1.7.0/go.mod h1:k8pI/1wAhjznARtVT9U1llUaFNPh7muw8QyOUpavru4= +cloud.google.com/go/videointelligence v1.8.0/go.mod h1:dIcCn4gVDdS7yte/w+koiXn5dWVplOZkE+xwG9FgK+M= +cloud.google.com/go/videointelligence v1.9.0/go.mod h1:29lVRMPDYHikk3v8EdPSaL8Ku+eMzDljjuvRs105XoU= cloud.google.com/go/vision v1.2.0/go.mod h1:SmNwgObm5DpFBme2xpyOyasvBc1aPdjvMk2bBk0tKD0= cloud.google.com/go/vision/v2 v2.2.0/go.mod h1:uCdV4PpN1S0jyCyq8sIM42v2Y6zOLkZs+4R9LrGYwFo= cloud.google.com/go/vision/v2 v2.3.0/go.mod h1:UO61abBx9QRMFkNBbf1D8B1LXdS2cGiiCRx0vSpZoUo= +cloud.google.com/go/vision/v2 v2.4.0/go.mod h1:VtI579ll9RpVTrdKdkMzckdnwMyX2JILb+MhPqRbPsY= +cloud.google.com/go/vision/v2 v2.5.0/go.mod h1:MmaezXOOE+IWa+cS7OhRRLK2cNv1ZL98zhqFFZaaH2E= +cloud.google.com/go/vmmigration v1.2.0/go.mod h1:IRf0o7myyWFSmVR1ItrBSFLFD/rJkfDCUTO4vLlJvsE= +cloud.google.com/go/vmmigration v1.3.0/go.mod h1:oGJ6ZgGPQOFdjHuocGcLqX4lc98YQ7Ygq8YQwHh9A7g= +cloud.google.com/go/vmwareengine v0.1.0/go.mod h1:RsdNEf/8UDvKllXhMz5J40XxDrNJNN4sagiox+OI208= +cloud.google.com/go/vpcaccess v1.4.0/go.mod h1:aQHVbTWDYUR1EbTApSVvMq1EnT57ppDmQzZ3imqIk4w= +cloud.google.com/go/vpcaccess v1.5.0/go.mod h1:drmg4HLk9NkZpGfCmZ3Tz0Bwnm2+DKqViEpeEpOq0m8= cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xXZmFiHmGE= cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= +cloud.google.com/go/webrisk v1.6.0/go.mod h1:65sW9V9rOosnc9ZY7A7jsy1zoHS5W9IAXv6dGqhMQMc= +cloud.google.com/go/webrisk v1.7.0/go.mod h1:mVMHgEYH0r337nmt1JyLthzMr6YxwN1aAIEc2fTcq7A= +cloud.google.com/go/websecurityscanner v1.3.0/go.mod h1:uImdKm2wyeXQevQJXeh8Uun/Ym1VqworNDlBXQevGMo= +cloud.google.com/go/websecurityscanner v1.4.0/go.mod h1:ebit/Fp0a+FWu5j4JOmJEV8S8CzdTkAS77oDsiSqYWQ= cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= +cloud.google.com/go/workflows v1.8.0/go.mod h1:ysGhmEajwZxGn1OhGOGKsTXc5PyxOc0vfKf5Af+to4M= +cloud.google.com/go/workflows v1.9.0/go.mod h1:ZGkj1aFIOd9c8Gerkjjq7OW7I5+l6cSvT3ujaO/WwSA= code.gitea.io/sdk/gitea v0.12.0/go.mod h1:z3uwDV/b9Ls47NGukYM9XhnHtqPh/J+t40lsUrR6JDY= collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= contrib.go.opencensus.io/exporter/aws v0.0.0-20181029163544-2befc13012d0/go.mod h1:uu1P0UCM/6RbsMrgPa98ll8ZcHM858i/AD06a9aLRCA= @@ -205,8 +405,14 @@ contrib.go.opencensus.io/exporter/stackdriver v0.12.1/go.mod h1:iwB6wGarfphGGe/e contrib.go.opencensus.io/exporter/stackdriver v0.13.4/go.mod h1:aXENhDJ1Y4lIg4EUaVTwzvYETVNZk10Pu26tevFKLUc= contrib.go.opencensus.io/integrations/ocsql v0.1.4/go.mod h1:8DsSdjz3F+APR+0z0WkU1aRorQCFfRxvqjUUPMbF3fE= contrib.go.opencensus.io/resource v0.1.1/go.mod h1:F361eGI91LCmW1I/Saf+rX0+OFcigGlFvXwEGEnkRLA= +cosmossdk.io/api v0.2.6 h1:AoNwaLLapcLsphhMK6+o0kZl+D6MMUaHVqSdwinASGU= +cosmossdk.io/api v0.2.6/go.mod h1:u/d+GAxil0nWpl1XnQL8nkziQDIWuBDhv8VnDm/s6dI= +cosmossdk.io/core v0.5.1 h1:vQVtFrIYOQJDV3f7rw4pjjVqc1id4+mE0L9hHP66pyI= +cosmossdk.io/core v0.5.1/go.mod h1:KZtwHCLjcFuo0nmDc24Xy6CRNEL9Vl/MeimQ2aC7NLE= +cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw= +cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= +cosmossdk.io/math v1.0.0-beta.4/go.mod h1:An0MllWJY6PxibUpnwGk8jOm+a/qIxlKmL5Zyp9NnaM= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -filippo.io/edwards25519 v1.0.0-beta.2/go.mod h1:X+pm78QAUPtFLi1z9PYIlS/bdDnvbCOGKtZ+ACWEf7o= filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= @@ -215,12 +421,12 @@ git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3/go.mod h1:wMEGFFFN git.sr.ht/~sircmpwn/go-bare v0.0.0-20210406120253-ab86bc2846d9/go.mod h1:BVJwbDfVjCjoFiKrhkei6NdGcZYpkDkdyCdg1ukytRA= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= -github.com/99designs/keyring v1.1.6/go.mod h1:16e0ds7LGQQcT59QqkTg72Hh5ShM51Byv5PEmW6uoRU= github.com/99designs/keyring v1.2.1 h1:tYLp1ULvO7i3fI5vE21ReQuj99QFSs7lGm0xWyJo87o= github.com/99designs/keyring v1.2.1/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= github.com/Abirdcfly/dupword v0.0.7/go.mod h1:K/4M1kj+Zh39d2aotRwypvasonOyAMH1c/IZJzE0dmk= github.com/AdaLogics/go-fuzz-headers v0.0.0-20210715213245-6c3934b029d8/go.mod h1:CzsSbkDixRphAF5hS6wbMKq0eI6ccJRb7/A0M6JBnwg= github.com/AkihiroSuda/containerd-fuse-overlayfs v1.0.0/go.mod h1:0mMDvQFeLbbn1Wy8P2j3hwFhqBq+FKn8OZPno8WLmp8= +github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/Antonboom/errname v0.1.7/go.mod h1:g0ONh16msHIPgJSGsecu1G/dcF2hlYR/0SddnIAGavU= github.com/Antonboom/nilnil v0.1.1/go.mod h1:L1jBqoWM7AOeTD+tSquifKSesRHs4ZdaxvZR+xdJEaI= github.com/Azure/azure-amqp-common-go/v2 v2.1.0/go.mod h1:R8rea+gJRuJR6QxTir/XuEd+YuKoUiazDC/N96FiDEU= @@ -240,7 +446,6 @@ github.com/Azure/azure-sdk-for-go/sdk/internal v0.7.0/go.mod h1:yqy467j36fJxcRV2 github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo= github.com/Azure/azure-service-bus-go v0.9.1/go.mod h1:yzBx6/BUGfjfeqbRZny9AQIbIe3AcV9WZbAdpkoXOa0= -github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4= github.com/Azure/azure-storage-blob-go v0.8.0/go.mod h1:lPI3aLPpuLTeUwh1sViKXFxwl2B6teiRqI0deQUvsw0= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= @@ -291,11 +496,17 @@ github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbi github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= +github.com/CloudyKit/fastprinter v0.0.0-20170127035650-74b38d55f37a/go.mod h1:EFZQ978U7x8IRnstaskI3IysnWY5Ao3QgZUKOXlsAdw= +github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= +github.com/CloudyKit/jet v2.1.3-0.20180809161101-62edd43e4f88+incompatible/go.mod h1:HPYO+50pSWkPoj9Q/eq0aRGByCL6ScRlUmiEX5Zgm+w= +github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= +github.com/CloudyKit/jet/v6 v6.1.0/go.mod h1:d3ypHeIRNo2+XyqnGA8s+aphtcVpjP5hPwP/Lzo7Ro4= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= +github.com/DataDog/zstd v1.5.0 h1:+K/VEwIAaPcHiMtQvpLD4lqW7f0Gk3xdYZmI1hD+CXo= github.com/DataDog/zstd v1.5.0/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Djarvur/go-err113 v0.0.0-20200410182137-af658d038157/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= @@ -304,7 +515,10 @@ github.com/GaijinEntertainment/go-exhaustruct/v2 v2.3.0/go.mod h1:b3g59n2Y+T5xmc github.com/GoogleCloudPlatform/cloudsql-proxy v0.0.0-20191009163259-e802c2cb94ae/go.mod h1:mjwGPas4yKduTyubHvD1Atl9r1rUq8DfVy+gkVvZ+oo= github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20190822182118-27a4ced34534/go.mod h1:iroGtC8B3tQiqtds1l+mgk/BBOrxbqjH+eUfFQYRc14= github.com/HdrHistogram/hdrhistogram-go v1.1.0/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= +github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM= github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= +github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= +github.com/Joker/jade v1.0.1-0.20190614124447-d475f43051e7/go.mod h1:6E6s8o2AE4KhCrqr6GRJjdC/gNfTdxkIXvuGZZda2VM= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= @@ -357,11 +571,12 @@ github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbt github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= +github.com/Shopify/goreferrer v0.0.0-20220729165902-8cddb4f5de06/go.mod h1:7erjKLwalezA0k99cWs5L11HWOAPNjdUZ6RxH1BXbbM= github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= -github.com/VictoriaMetrics/fastcache v1.5.7/go.mod h1:ptDBkNMQI4RtmVo8VS/XwRY6RoTu1dAWCbrk+6WsEM8= github.com/VictoriaMetrics/fastcache v1.6.0/go.mod h1:0qHz5QP0GMX4pfmMA/zt5RgfNuXJrTP0zS7DqpHGGTw= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= @@ -374,8 +589,12 @@ github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= +github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/kingpin v2.2.6+incompatible/go.mod h1:59OFYbFVLKQKq+mqrL6Rw5bR0c3ACQaawgXx0QYndlE= +github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c= +github.com/alecthomas/participle/v2 v2.0.0-alpha7/go.mod h1:NumScqsC42o9x+dGj8/YqsIfhrIQjFEOFovxotbBirA= +github.com/alecthomas/repr v0.0.0-20181024024818-d37bc2a10ba1/go.mod h1:xTS7Pm1pD1mvyM075QCDSRqH6qRLXylzS24ZTpRiSzQ= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -389,6 +608,7 @@ github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= github.com/andybalholm/brotli v1.0.3/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= +github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q= @@ -402,15 +622,15 @@ github.com/apex/log v1.3.0/go.mod h1:jd8Vpsr46WAe3EZSQ/IUMs2qQD/GOycT5rPWCO1yGcs github.com/apex/logs v0.0.4/go.mod h1:XzxuLZ5myVHDy9SAmYpamKKRNApGj54PfYLcFrXqDwo= github.com/aphistic/golf v0.0.0-20180712155816-02c07f170c5a/go.mod h1:3NqKYiepwy8kCu4PNA+aP7WUV72eXWJeP9/r3/K9aLE= github.com/aphistic/sweet v0.2.0/go.mod h1:fWDlIh/isSE9n6EPsRmC0det+whmX6dJid3stzu0Xys= -github.com/aristanetworks/goarista v0.0.0-20170210015632-ea17b1a17847/go.mod h1:D/tb0zPVXnP7fmsLZjtdUhSsumbK/ij54UXjjVgMGxQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= -github.com/armon/go-metrics v0.4.0 h1:yCQqn7dwca4ITXb+CbubHmedzaQYHhNhrEXLYUeEe8Q= github.com/armon/go-metrics v0.4.0/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= +github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= +github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= @@ -429,7 +649,6 @@ github.com/aws/aws-sdk-go v1.20.6/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN github.com/aws/aws-sdk-go v1.23.20/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.25.11/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.25.37/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.25.48/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.27.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.31.6/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= @@ -449,6 +668,8 @@ github.com/aws/aws-sdk-go-v2/service/sts v1.1.1/go.mod h1:Wi0EBZwiz/K44YliU0EKxq github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I= +github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= +github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= @@ -469,6 +690,7 @@ github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb/go.mod h1:PkYb9DJNAw github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/blizzy78/varnamelen v0.8.0/go.mod h1:V9TzQZ4fLJ1DSrjVDfl89H7aMnTvKkApdHeyESmyR7k= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= @@ -482,24 +704,35 @@ github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBT github.com/breml/bidichk v0.2.3/go.mod h1:8u2C6DnAy0g2cEq+k/A2+tr9O1s+vHGxWn0LTc70T2A= github.com/breml/errchkjson v0.3.0/go.mod h1:9Cogkyv9gcT8HREpzi3TiqBxCqDzo8awa92zSDFcofU= github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk= -github.com/btcsuite/btcd v0.22.2 h1:vBZ+lGGd1XubpOWO67ITJpAEsICWhA0YzqkcpkgNBfo= -github.com/btcsuite/btcd v0.22.2/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= +github.com/btcsuite/btcd v0.0.0-20190315201642-aa6e0f35703c/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= +github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= +github.com/btcsuite/btcd v0.21.0-beta.0.20201114000516-e9c7a5ac6401/go.mod h1:Sv4JPQ3/M+teHz9Bo5jBpkNcP0x6r7rdihlNL/7tTAs= +github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c/go.mod h1:tjmYdS6MLJ5/s0Fj4DbLgSbDHbEqLJrtnHecBFkdz5M= +github.com/btcsuite/btcd v0.22.1/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= +github.com/btcsuite/btcd v0.23.0 h1:V2/ZgjfDFIygAX3ZapeigkVBoVUtOJKSwrhZdlpSvaA= +github.com/btcsuite/btcd v0.23.0/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY= +github.com/btcsuite/btcd/btcec/v2 v2.1.0/go.mod h1:2VzYrv4Gm4apmbVVsSq5bqf1Ec8v56E48Vt0Y/umPgA= github.com/btcsuite/btcd/btcec/v2 v2.1.2/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= github.com/btcsuite/btcd/btcec/v2 v2.1.3/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= github.com/btcsuite/btcd/btcec/v2 v2.2.1/go.mod h1:9/CSmJxmuvqzX9Wh2fXMWToLOHhPd11lSPuIupwTkI8= github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/btcutil v1.0.0/go.mod h1:Uoxwv0pqYWhD//tfTiipkxNfdhG9UrLwaeswfjfdF0A= +github.com/btcsuite/btcd/btcutil v1.1.0/go.mod h1:5OapHB7A2hBBWLm48mmw4MOHNJCcUBTwmWH/0Jn8VHE= github.com/btcsuite/btcd/btcutil v1.1.2 h1:XLMbX8JQEiwMcYft2EGi8zPUkoa0abKIU6/BJSRsjzQ= github.com/btcsuite/btcd/btcutil v1.1.2/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= +github.com/btcsuite/btcutil v0.0.0-20190207003914-4c204d697803/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v1.0.2/go.mod h1:j9HUFwoQRsZL3V4n+qG+CUnEGHOarIxfC3Le2Yhbcts= github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= +github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= +github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= @@ -542,6 +775,7 @@ github.com/chavacava/garif v0.0.0-20220630083739-93517212f375/go.mod h1:4m1Rv7xf github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= +github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927/go.mod h1:h/aW8ynjgkuj+NQRlZcDbAbM1ORAbXjXX77sX7T289U= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= @@ -558,23 +792,44 @@ github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4 github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= github.com/cloudflare/circl v1.3.1/go.mod h1:+CauBF6R70Jqcyl8N2hC8pAXYbWkGIezuSbuGLtRhnw= -github.com/cloudflare/cloudflare-go v0.10.2-0.20190916151808-a80f83b9add9/go.mod h1:1MxXX1Ux4x6mqPmjkUgTP1CdXIBXKX7T+Jk9Gxrmx+U= github.com/cloudflare/cloudflare-go v0.14.0/go.mod h1:EnwdgGMaFOruiPZRFSgn+TsQ3hQ7C/YWzIGLeu5c304= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211130200136-a8f946100490/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= +github.com/cockroachdb/apd/v3 v3.1.0/go.mod h1:6qgPBMXjATAdD/VefbRP9NoSLKjbB4LCoA7gN4LpHs4= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= +github.com/cockroachdb/datadriven v1.0.0/go.mod h1:5Ib8Meh+jk1RlHIXej6Pzevx/NLlNvQB9pmSBZErGA4= +github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= +github.com/cockroachdb/errors v1.6.1/go.mod h1:tm6FTP5G81vwJ5lC0SizQo374JNCOPrHyXGitRJoDqM= +github.com/cockroachdb/errors v1.8.1/go.mod h1:qGwQn6JmZ+oMjuLwjWzUNqblqk0xl4CVV3SQbGwK7Ac= +github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= +github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= +github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/pebble v0.0.0-20220817183557-09c6e030a677 h1:qbb/AE938DFhOajUYh9+OXELpSF9KZw2ZivtmW6eX1Q= +github.com/cockroachdb/pebble v0.0.0-20220817183557-09c6e030a677/go.mod h1:890yq1fUb9b6dGNwssgeUO5vQV9qfXnCPxAJhBQfXw0= +github.com/cockroachdb/redact v1.0.8/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ= +github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2/go.mod h1:8BT+cPK6xvFOcRlk0R8eg+OTkcqI6baNH4xAkpiYVvQ= github.com/codahale/hdrhistogram v0.0.0-20160425231609-f8ad88b59a58/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= +github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= github.com/coinbase/kryptology v1.8.0/go.mod h1:RYXOAPdzOGUe3qlSFkMGn58i3xUA8hmxYHksuq+8ciI= -github.com/coinbase/rosetta-sdk-go v0.7.0/go.mod h1:7nD3oBPIiHqhRprqvMgPoGxe/nyq3yftRmpsy29coWE= github.com/coinbase/rosetta-sdk-go v0.7.9 h1:lqllBjMnazTjIqYrOGv8h8jxjg9+hJazIGZr9ZvoCcA= github.com/coinbase/rosetta-sdk-go v0.7.9/go.mod h1:0/knutI7XGVqXmmH4OQD8OckFrbQ8yMsUZTG7FXCR2M= +github.com/cometbft/cometbft v0.34.27 h1:ri6BvmwjWR0gurYjywcBqRe4bbwc3QVs9KRcCzgh/J0= +github.com/cometbft/cometbft v0.34.27/go.mod h1:BcCbhKv7ieM0KEddnYXvQZR+pZykTKReJJYf7YC7qhw= +github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= +github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= github.com/confio/ics23/go v0.6.6/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg= github.com/confio/ics23/go v0.7.0/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg= github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= @@ -721,18 +976,23 @@ github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfc github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.4 h1:n7C2ngKXo7UC9gNyMNLbzqz7Asuf+7Qv4gnX/rOdQ44= github.com/cosmos/btcutil v1.0.4/go.mod h1:Ffqc8Hn6TJUdDgHBwIZLtrLQC1KdJ9jGJl/TvgUaxbU= -github.com/cosmos/cosmos-sdk v0.45.13-ics h1:EuBiwr9UO/s+dcjCXrrmwrZPowEhBYguIdMcr5fH3dg= -github.com/cosmos/cosmos-sdk v0.45.13-ics/go.mod h1:tpDFgc98sgRcLLRiosBSyos8EZoDHv1xab9HPLGLQJ4= +github.com/cosmos/cosmos-db v0.0.0-20221226095112-f3c38ecb5e32 h1:zlCp9n3uwQieELltZWHRmwPmPaZ8+XoL2Sj+A2YJlr8= +github.com/cosmos/cosmos-db v0.0.0-20221226095112-f3c38ecb5e32/go.mod h1:kwMlEC4wWvB48zAShGKVqboJL6w4zCLesaNQ3YLU2BQ= +github.com/cosmos/cosmos-proto v1.0.0-beta.1 h1:iDL5qh++NoXxG8hSy93FdYJut4XfgbShIocllGaXx/0= +github.com/cosmos/cosmos-proto v1.0.0-beta.1/go.mod h1:8k2GNZghi5sDRFw/scPL8gMSowT1vDA+5ouxL8GjaUE= +github.com/cosmos/cosmos-sdk v0.45.15-ics h1:ujrXsulYGwggLCC0oD7CizvlAerqMQHfCHHjHqIamfY= +github.com/cosmos/cosmos-sdk v0.45.15-ics/go.mod h1:bScuNwWAP0TZJpUf+SHXRU3xGoUPp+X9nAzfeIXts40= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= +github.com/cosmos/gogoproto v1.4.3/go.mod h1:0hLIG5TR7IvV1fme1HCFKjfzW9X2x0Mo+RooWXCnOWU= github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4Y= github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw= github.com/cosmos/iavl v0.19.5 h1:rGA3hOrgNxgRM5wYcSCxgQBap7fW82WZgY78V9po/iY= github.com/cosmos/iavl v0.19.5/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= github.com/cosmos/ibc-go v1.2.2/go.mod h1:XmYjsRFOs6Q9Cz+CSsX21icNoH27vQKb3squgnCOCbs= -github.com/cosmos/ibc-go/v4 v4.2.0 h1:Fx/kKq/uvawrAxk6ZrQ6sEIgffLRU5Cs/AUnvpPBrHI= -github.com/cosmos/ibc-go/v4 v4.2.0/go.mod h1:57qWScDtfCx3FOMLYmBIKPbOLE6xiVhrgxHAQmbWYXM= +github.com/cosmos/ibc-go/v4 v4.3.0 h1:yOzVsyZzsv4XPBux8gq+D0LhZn45yGWKjvT+6Vyo5no= +github.com/cosmos/ibc-go/v4 v4.3.0/go.mod h1:CcLvIoi9NNtIbNsxs4KjBGjYhlwqtsmXy1AKARKiMzQ= github.com/cosmos/ledger-cosmos-go v0.12.2 h1:/XYaBlE2BJxtvpkHiBm97gFGSGmYGKunKyF3nNqAXZA= github.com/cosmos/ledger-cosmos-go v0.12.2/go.mod h1:ZcqYgnfNJ6lAXe4HPtWgarNEY+B74i+2/8MhZw4ziiI= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= @@ -746,6 +1006,10 @@ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7Do github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cristalhq/acmd v0.8.1/go.mod h1:LG5oa43pE/BbxtfMoImHCQN++0Su7dzipdgBjMCBVDQ= +github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= +github.com/cucumber/common/gherkin/go/v22 v22.0.0/go.mod h1:3mJT10B2GGn3MvVPd3FwR7m2u4tLhSRhWUqJU4KN4Fg= +github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= +github.com/cucumber/common/messages/go/v17 v17.1.1/go.mod h1:bpGxb57tDE385Rb2EohgUadLkAbhoC4IyCFi89u/JQI= github.com/curioswitch/go-reassign v0.2.0/go.mod h1:x6OpXuWvgfQaMGks2BZybTngWjT84hqJfKoO8Tt/Roc= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= @@ -755,7 +1019,6 @@ github.com/d2g/dhcp4client v1.0.0/go.mod h1:j0hNfjhrt2SxUOw55nL0ATM/z4Yt3t2Kd1mW github.com/d2g/dhcp4server v0.0.0-20181031114812-7d4a0a7f59a5/go.mod h1:Eo87+Kg/IX2hfWJfwxMzLyuSZyxSoAug2nGa1G2QAi8= github.com/d2g/hardwareaddr v0.0.0-20190221164911-e7d9fbe030e4/go.mod h1:bMl4RjIciD2oAxI7DmWRx6gbeqrkoLqv3MV0vzNad+I= github.com/daixiang0/gci v0.8.1/go.mod h1:EpVfrztufwVgQRXjnX4zuNinEpLj5OmMjtu/+MB0V0c= -github.com/danieljoos/wincred v1.0.2/go.mod h1:SnuYRW9lp1oJrZX/dXJqr0cPK5gYXqx3EJbmjhLdK9U= github.com/danieljoos/wincred v1.1.0/go.mod h1:XYlo+eRTsVA9aHGp7NGjFkPla4m+DCL7hqDjlFjiygg= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= @@ -766,7 +1029,6 @@ github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= @@ -781,6 +1043,7 @@ github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8l github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/devigned/tab v0.1.1/go.mod h1:XG9mPq0dFghrYvoBF3xdRrJzSTX1b7IQrvaL9mzjeJY= +github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= github.com/dgraph-io/badger/v2 v2.2007.2/go.mod h1:26P/7fbL4kUZVEVKLAKXkBXKOydDmM2p1e+NhhnBCAE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= @@ -794,10 +1057,11 @@ github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMa github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE= -github.com/dlclark/regexp2 v1.2.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= +github.com/djherbis/atime v1.1.0/go.mod h1:28OF6Y8s3NQWwacXc5eZTsEsiMzp7LF8MbXE+XJPdBE= github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= @@ -840,22 +1104,19 @@ github.com/docker/libnetwork v0.8.0-dev.2.0.20200917202933-d0951081b35f/go.mod h github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/dop251/goja v0.0.0-20200721192441-a695b0cdd498/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= github.com/dop251/goja v0.0.0-20211011172007-d99e4b8cbf48/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b/go.mod h1:7BvyPhdbLxMXIYTFPLsyJRFMsKmOZnQmzh6Gb+uquuM= github.com/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= -github.com/dvyukov/go-fuzz v0.0.0-20200318091601-be3528f3a813/go.mod h1:11Gm+ccJnvAhCNLlf5+cS9KjtbaD5I5zaZpFMsTHWTw= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts= -github.com/edsrzf/mmap-go v0.0.0-20160512033002-935e0e8a636c/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= @@ -863,11 +1124,12 @@ github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ= +github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.0.14/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws= github.com/esimonov/ifshort v1.0.4/go.mod h1:Pe8zjlRrJ80+q2CxHLfEOfTwxCZ4O+MuhcHcfgNWTk0= -github.com/ethereum/go-ethereum v1.9.25/go.mod h1:vMkFiYLHI4tgPw4k2j4MHKoovchFE8plZ0M9VMk4/oM= +github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/ethereum/go-ethereum v1.10.17/go.mod h1:Lt5WzjM07XlXc95YzrhosmR4J9Ahd6X2wyEV2SvGhk0= github.com/ettle/strcase v0.1.1/go.mod h1:hzDLsPC7/lwKyBOywSHEP89nt2pDgdy+No1NBA9o9VY= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= @@ -882,19 +1144,21 @@ github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqL github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= -github.com/fatih/color v1.3.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/firefart/nonamedreturns v1.0.4/go.mod h1:TDhe/tjI1BXo48CmYbUduTV7BdIga8MAO/xbKdcVsGI= -github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= +github.com/flosch/pongo2 v0.0.0-20190707114632-bbf5a6c351f4/go.mod h1:T9YF2M40nIgbVgp3rreNmTged+9HrbNTIQf1PsaIiTA= +github.com/flosch/pongo2/v4 v4.0.2/go.mod h1:B5ObFANs/36VwxxlgKpdchIJHMvHB562PW+BWPhwZD8= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= @@ -918,26 +1182,38 @@ github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa/go.mod h1:KnogPXt github.com/fullstorydev/grpcurl v1.6.0/go.mod h1:ZQ+ayqbKMJNhzLmbpCiurTVlaK2M/3nqZCxaQ2Ze/sM= github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA= github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= +github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= github.com/getkin/kin-openapi v0.61.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= +github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= +github.com/getsentry/sentry-go v0.17.0 h1:UustVWnOoDFHBS7IJUB2QK/nB5pap748ZEp0swnQJak= +github.com/getsentry/sentry-go v0.17.0/go.mod h1:B82dxtBvxG0KaPD8/hfSV+VcHD+Lg/xUS4JuQn1P4cM= +github.com/ghemawat/stream v0.0.0-20171120220530-696b145b53b9/go.mod h1:106OIgooyS7OzLDOpUGgm9fA3bQENb/cFSyyBmMoJDs= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= +github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= +github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= +github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4xC+/+z4= github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= +github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= github.com/go-chi/chi/v5 v5.0.7/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-critic/go-critic v0.4.1/go.mod h1:7/14rZGnZbY6E38VEGk2kVhoq6itzc1E68facVDK23g= github.com/go-critic/go-critic v0.4.3/go.mod h1:j4O3D4RoIwRqlZw5jJpx0BNfXWWbpcJoKu5cYSe4YmQ= github.com/go-critic/go-critic v0.6.5/go.mod h1:ezfP/Lh7MA6dBNn4c6ab5ALv3sKnZVLx37tr00uuaOY= +github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= github.com/go-git/go-git-fixtures/v4 v4.3.1/go.mod h1:8LHG1a3SRW71ettAD/jW13h8c6AqjVSeL11RAdgaqpo= @@ -970,6 +1246,7 @@ github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbV github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.0/go.mod h1:YkVgnZu1ZjjL7xTxrfm/LLZBfkhTqSR1ydtm6jTKKwI= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= @@ -987,14 +1264,18 @@ github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= +github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= +github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= +github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= -github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= +github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= +github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= +github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= github.com/go-redis/redis v6.15.8+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= -github.com/go-sourcemap/sourcemap v2.1.2+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= +github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= @@ -1023,12 +1304,18 @@ github.com/go-toolsmith/typep v1.0.2/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2 github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= github.com/go-zookeeper/zk v1.0.2/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= -github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= -github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= +github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU= +github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= -github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= +github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og= +github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= +github.com/gobwas/ws v1.1.0 h1:7RFti/xnNkMJnrK7D1yQ/iCIB5OrrY/54/H930kIbHA= +github.com/gobwas/ws v1.1.0/go.mod h1:nzvNcVha5eUziGrbxFCo6qFIojQHjJV5cLYIbezhfL0= +github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= +github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus v0.0.0-20151105175453-c7fdd8b5cd55/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= github.com/godbus/dbus v0.0.0-20180201030542-885f9cc04c9c/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= @@ -1041,13 +1328,19 @@ github.com/gofrs/flock v0.0.0-20190320160742-5135e617513b/go.mod h1:F1TvTiK9OcQq github.com/gofrs/flock v0.7.3/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gofrs/uuid v4.3.0+incompatible h1:CaSVZxm5B+7o45rtab4jC2G37WGYX1zQfuU2i6DSvnc= github.com/gofrs/uuid v4.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/gateway v1.1.0 h1:u0SuhL9+Il+UbjM9VIE3ntfRujKbvVpFvNB4HbjeVQ0= github.com/gogo/gateway v1.1.0/go.mod h1:S7rR8FRQyG3QFESeSv4l2WnsyzlCLG0CzBbUUo/mbic= +github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU= github.com/gogo/googleapis v1.3.2/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/gogo/googleapis v1.4.0/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= +github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= +github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= @@ -1097,7 +1390,6 @@ github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.3-0.20201103224600-674baa8c7fc3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -1125,11 +1417,13 @@ github.com/golangci/revgrep v0.0.0-20180526074752-d9c87f5ffaf0/go.mod h1:qOQCunE github.com/golangci/revgrep v0.0.0-20180812185044-276a5c0a1039/go.mod h1:qOQCunEYvmd/TLamH+7LlVccLvUH5kZNhbCgTHoBbp4= github.com/golangci/revgrep v0.0.0-20220804021717-745bb2f7c2e6/go.mod h1:0AKcRCkMoKvUvlf89F6O7H2LYdhr1zBh736mBItOdRs= github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ= +github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180124185431-e89373fe6b4a/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= +github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= +github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/certificate-transparency-go v1.0.21/go.mod h1:QeJfpSbVSfYc7RgB3gJFj9cbuQMMchQxrWXz8Ruopmg= github.com/google/certificate-transparency-go v1.1.1/go.mod h1:FDKqPvSXawb2ecErVRrD+nfy23RCzyl7eqVCEmlT1Zs= github.com/google/crfs v0.0.0-20191108021818-71d77da419c9/go.mod h1:etGhoOqfwPkooV6aqoX3eBGQOJblqdoc9XvWOeuxpPw= @@ -1156,6 +1450,7 @@ github.com/google/go-containerregistry v0.5.1/go.mod h1:Ct15B4yir3PLOP5jsy0GNeYV github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-github/v28 v28.1.1/go.mod h1:bsqJWQX05omyWVmc00nEUql9mhQyv38lDZ8kPZcQVoM= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/go-replayers/grpcreplay v0.1.0/go.mod h1:8Ig2Idjpr6gifRd6pNVggX6TC1Zw6Jx74AKp7QNH2QE= github.com/google/go-replayers/httpreplay v0.1.0/go.mod h1:YKZViNhiGgqdBlUbI2MwGpq4pXxNmhJLPHQ7cv2b5no= github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= @@ -1216,6 +1511,7 @@ github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99 github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= +github.com/googleapis/gax-go/v2 v2.7.0/go.mod h1:TEop28CZZQ2y+c0VxMUmu1lV+fQx57QpBWsYpwqHJx8= github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.2.2/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= @@ -1227,6 +1523,7 @@ github.com/gookit/color v1.2.4/go.mod h1:AhIE+pS6D4Ql0SQWbBeXPHw7gY0/sjHoA4s/n1K github.com/gookit/color v1.5.1/go.mod h1:wZFzea4X8qN6vHOSP2apMb4/+w/orMznEzYsIHPaqKM= github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gopherjs/gopherjs v1.17.2/go.mod h1:pRRIvn/QzFLrKfvEz3qUuEhtE/zLCWfreZ6J5gM2i+k= github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU= github.com/gordonklaus/ineffassign v0.0.0-20210914165742-4cc7213b9bc8/go.mod h1:Qcp2HIAYhR7mNUVSIxZww3Guk4it82ghYcEXIAk+QT0= github.com/goreleaser/goreleaser v0.136.0/go.mod h1:wiKrPUeSNh6Wu8nUHxZydSOVQ/OZvOaO7DTtFqie904= @@ -1234,6 +1531,7 @@ github.com/goreleaser/nfpm v1.2.1/go.mod h1:TtWrABZozuLOttX2uDlYyECfQX7x5XYkVxhj github.com/goreleaser/nfpm v1.3.0/go.mod h1:w0p7Kc9TAUgWMyrub63ex3M2Mgw88M4GZXoTq5UCb40= github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75/go.mod h1:g2644b03hfBX9Ov0ZBDgXXens4rxSxmqFBbhvKv2yVA= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= @@ -1242,9 +1540,9 @@ github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2z github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.1-0.20190629185528-ae1634f6a989/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= @@ -1261,8 +1559,8 @@ github.com/gostaticanalysis/forcetypeassert v0.1.0/go.mod h1:qZEedyP/sY1lTGV1uJ3 github.com/gostaticanalysis/nilerr v0.1.1/go.mod h1:wZYb6YI5YAxxq0i1+VJbY0s2YONW0HU0GPE3+5PWN4A= github.com/gostaticanalysis/testutil v0.3.1-0.20210208050101-bfb5c8eec0e4/go.mod h1:D+FIZ+7OahH3ePw/izIEeH5I06eKs1IKI4Xr64/Am3M= github.com/gostaticanalysis/testutil v0.4.0/go.mod h1:bLIoPefWXrRi/ssLFWX1dx7Repi5x3CuviD3dgAZaBU= +github.com/gotestyourself/gotestyourself v1.4.0/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY= github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY= -github.com/graph-gophers/graphql-go v0.0.0-20191115155744-f33e81362277/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= @@ -1365,21 +1663,20 @@ github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpT github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/hashicorp/serf v0.9.8/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/hashicorp/uuid v0.0.0-20160311170451-ebb0a03e909c/go.mod h1:fHzc09UnyJyqyW+bFuq864eh+wC7dj65aXmXLRe5to0= -github.com/hdevalence/ed25519consensus v0.0.0-20210204194344-59a8610d2b87/go.mod h1:XGsKKeXxeRr95aEOgipvluMPlgjr7dGlk9ZTWOjcUcg= github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 h1:aSVUgRRRtOrZOC1fYmY9gV0e9z/Iu+xNVSASWjsuyGU= github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3/go.mod h1:5PC6ZNPde8bBqU/ewGZig35+UIZtw9Ytxez8/q5ZyFE= github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= -github.com/holiman/uint256 v1.1.1/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo= github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/hudl/fargo v1.4.0/go.mod h1:9Ai6uvFy5fQNq6VPKtg+Ceq1+eTY4nKUlR2JElEOcDo= -github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= github.com/huin/goupnp v1.0.3-0.20220313090229-ca81a64b4204/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= +github.com/hydrogen18/memlistener v0.0.0-20141126152155-54553eb933fb/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= +github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= @@ -1391,6 +1688,7 @@ github.com/imdario/mergo v0.3.10/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= +github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= github.com/improbable-eng/grpc-web v0.14.1/go.mod h1:zEjGHa8DAlkoOXmswrNvhUGEYQA9UI7DhrGeHR1DMGU= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= @@ -1398,7 +1696,6 @@ github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANyt github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/influxdata/flux v0.65.1/go.mod h1:J754/zds0vvpfwuq7Gc2wRdVwEodfpCFM7mYlOw2LqY= -github.com/influxdata/influxdb v1.2.3-0.20180221223340-01288bdb0883/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOprn86kgg4+IzY= github.com/influxdata/influxdb v1.8.3/go.mod h1:JugdFhsvvI8gadxOI6noqNeeBHvWNTbfYGtiAn+2jhI= github.com/influxdata/influxdb-client-go/v2 v2.4.0/go.mod h1:vLNHdxTJkIf2mSLvGrpj8TCcISApPoXkaxP8g9uRlW8= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= @@ -1411,14 +1708,20 @@ github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19y github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6/go.mod h1:bSgUQ7q5ZLSO+bKBGqJiCBGAl+9DxyW63zLTujjUlOE= github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0= github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po= -github.com/informalsystems/tendermint v0.34.26 h1:89XvVexAy62geGWxmDmdmmJvfindx+Su2oTuwfSWMeU= -github.com/informalsystems/tendermint v0.34.26/go.mod h1:q3uAZ/t5+MblQhFuHSd4flqaLDx7iUtWpwWbwvHAFhs= github.com/informalsystems/tm-load-test v1.3.0/go.mod h1:OQ5AQ9TbT5hKWBNIwsMjn6Bf4O0U4b1kRc+0qZlQJKw= github.com/intel/goresctrl v0.2.0/go.mod h1:+CZdzouYFn5EsxgqAQTEzMfwKwuc0fVdMrT9FCCAVRQ= +github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= +github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= +github.com/iris-contrib/httpexpect/v2 v2.3.1/go.mod h1:ICTf89VBKSD3KB0fsyyHviKF8G8hyepP0dOXJPWz3T0= +github.com/iris-contrib/i18n v0.0.0-20171121225848-987a633949d0/go.mod h1:pMCz62A0xJL6I+umB2YTlFRwWXaDFA0jy+5HzGiJjqI= +github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= +github.com/iris-contrib/jade v1.1.4/go.mod h1:EDqR+ur9piDl6DUgs6qRrlfzmlx/D5UybogqrXvJTBE= +github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= +github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= +github.com/iris-contrib/schema v0.0.6/go.mod h1:iYszG0IOsuIsfzjymw1kMzTL8YQcCWlm65f3wX8J5iA= github.com/ishidawataru/sctp v0.0.0-20191218070446-00ab2ac2db07/go.mod h1:co9pwDoBCm1kGxawmb4sPq0cSIOOWNPT4KnHotMP1Zg= github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA= github.com/j-keck/arping v1.0.2/go.mod h1:aJbELhR92bSk7tp79AWM/ftfc90EfEi2bQJrbBFOsPw= -github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jaguilar/vt100 v0.0.0-20150826170717-2703a27b14ea/go.mod h1:QMdK4dGB3YhEW2BmA1wgGpPYI3HZy/5gD705PXKUVSg= github.com/jarcoal/httpmock v1.0.5/go.mod h1:ATjnClrvW/3tijVmpL/va5Z3aAyGvqU3gCT8nX0Txik= @@ -1426,6 +1729,7 @@ github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i github.com/jdxcode/netrc v0.0.0-20210204082910-926c7f70242a/go.mod h1:Zi/ZFkEqFHTm7qkjyNJjaWH4LQA9LQhGJyF0lTYGpxw= github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU= +github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= github.com/jgautheron/goconst v1.5.1/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= @@ -1474,18 +1778,37 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1 github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jsternberg/zap-logfmt v1.0.0/go.mod h1:uvPs/4X51zdkcm5jXl5SYoN+4RK21K8mysFmDaM/h+o= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/juju/errors v0.0.0-20181118221551-089d3ea4e4d5/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= +github.com/juju/loggo v0.0.0-20180524022052-584905176618/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= github.com/juju/ratelimit v1.0.1/go.mod h1:qapgC/Gy+xNh9UxzV13HGGl/6UXNN+ct+vwSgWNm/qk= -github.com/julienschmidt/httprouter v1.1.1-0.20170430222011-975b5c4c7c21/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/juju/testing v0.0.0-20180920084828-472a3e8b2073/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/julz/importas v0.1.0/go.mod h1:oSFU2R4XK/P7kNBrnL/FEQlDGN1/6WoxXEjSSXO0DV0= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= +github.com/kataras/blocks v0.0.6/go.mod h1:UK+Iwk0Oxpc0GdoJja7sEildotAUKK1LYeYcVF0COWc= +github.com/kataras/blocks v0.0.7/go.mod h1:UJIU97CluDo0f+zEjbnbkeMRlvYORtmc1304EeyXf4I= +github.com/kataras/golog v0.0.9/go.mod h1:12HJgwBIZFNGL0EJnMRhmvGA0PQGx8VFwrZtM4CqbAk= +github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= +github.com/kataras/golog v0.1.7/go.mod h1:jOSQ+C5fUqsNSwurB/oAHq1IFSb0KI3l6GMa7xB6dZA= +github.com/kataras/iris/v12 v12.0.1/go.mod h1:udK4vLQKkdDqMGJJVd/msuMtN6hpYJhg/lSzuxjhO+U= +github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= +github.com/kataras/iris/v12 v12.2.0-beta5/go.mod h1:q26aoWJ0Knx/00iPKg5iizDK7oQQSPjbD8np0XDh6dc= +github.com/kataras/jwt v0.1.8/go.mod h1:Q5j2IkcIHnfwy+oNY3TVWuEBJNw0ADgCcXK9CaZwV4o= +github.com/kataras/neffos v0.0.10/go.mod h1:ZYmJC07hQPW67eKuzlfY7SO3bC0mw83A3j6im82hfqw= +github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= +github.com/kataras/neffos v0.0.20/go.mod h1:srdvC/Uo8mgrApWW0AYtiiLgMbyNPf69qPsd2FhE6MQ= +github.com/kataras/pio v0.0.0-20190103105442-ea782b38602d/go.mod h1:NV88laa9UiiDuX9AhMbDPkGYSPugBOV6yTZB1l2K9Z0= +github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= +github.com/kataras/pio v0.0.10/go.mod h1:gS3ui9xSD+lAUpbYnjOGiQyY7sUMJO+EHpiRzhtZ5no= +github.com/kataras/pio v0.0.11/go.mod h1:38hH6SWH6m4DKSYmRhlrCJ5WItwWgCVrTNU62XZyUvI= +github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= +github.com/kataras/sitemap v0.0.6/go.mod h1:dW4dOCNs896OR1HmG+dMLdT7JjDk7mYBzoIRwuj5jA4= +github.com/kataras/tunnel v0.0.4/go.mod h1:9FkU4LaeifdMWqZu7o20ojmW4B7hdhv2CMLwfnHGpYw= github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d/go.mod h1:JJNrCn9otv/2QP4D7SMJBgaleKpOf66PnW6F5WGNRIc= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/errcheck v1.6.2/go.mod h1:nXw/i/MfnvRHqXa7XXmQMUB0oNFGuBrNI8d8NLy0LPw= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= @@ -1493,6 +1816,9 @@ github.com/kkHAIKE/contextcheck v1.1.3/go.mod h1:PG/cwd6c0705/LM0KTr1acO2gORUxkS github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.9.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= @@ -1501,12 +1827,17 @@ github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8 github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.13.5/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/klauspost/compress v1.14.4/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/klauspost/compress v1.15.0/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.15.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= +github.com/klauspost/compress v1.15.10/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= github.com/klauspost/compress v1.15.11 h1:Lcadnb3RKGin4FYM/orgq0qde+nc15E5Cbqg4B9Sx9c= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid v0.0.0-20180405133222-e7e905edc00e/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= @@ -1518,8 +1849,9 @@ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFB github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= @@ -1533,13 +1865,18 @@ github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LE github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/kyoh86/exportloopref v0.1.8/go.mod h1:1tUcJeiioIs7VWe5gcOObrux3lb66+sBqGZrRkMwPgg= +github.com/labstack/echo/v4 v4.1.11/go.mod h1:i541M3Fj6f76NZtHSj7TXnyM8n2gaodfvfxNnFqi74g= github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= +github.com/labstack/echo/v4 v4.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= +github.com/labstack/echo/v4 v4.9.0/go.mod h1:xkCDAdFCIf8jsFQ5NnbK7oqaF/yU1A1X20Ltm0OvSks= github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= +github.com/labstack/gommon v0.3.1/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM= github.com/ldez/gomoddirectives v0.2.3/go.mod h1:cpgBogWITnCfRq2qGoDkKMEVSaarhdBr6g8G04uz6d0= github.com/ldez/tagliatelle v0.3.1/go.mod h1:8s6WJQwEYHbKZDsp/LjArytKOG8qaMrKQQ3mFukHs88= github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= -github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= +github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/leonklingele/grouper v1.1.0/go.mod h1:uk3I3uDfi9B6PeUjsCKi6ndcf63Uy7snXgR4yDYQVDY= github.com/letsencrypt/pkcs11key/v4 v4.0.0/go.mod h1:EFUvBDay26dErnNb70Nd0/VW3tJiIbETBPTl9ATXQag= github.com/lib/pq v0.0.0-20180327071824-d34b9ff171c2/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -1556,6 +1893,8 @@ github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QT github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3/go.mod h1:3r6x7q95whyfWQpmGZTu3gk3v2YkMi05HEzl7Tf7YEo= +github.com/linxGnu/grocksdb v1.7.10 h1:dz7RY7GnFUA+GJO6jodyxgkUeGMEkPp3ikt9hAcNGEw= +github.com/linxGnu/grocksdb v1.7.10/go.mod h1:0hTf+iA+GOr0jDX4CgIYyJZxqOH9XlBh6KVj8+zmF34= github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= github.com/lucasjones/reggen v0.0.0-20180717132126-cdb49ff09d77/go.mod h1:5ELEyG+X8f+meRWHuqUOewBOhvHkl7M76pdGEansxW4= github.com/lufeee/execinquery v1.2.1/go.mod h1:EC7DrEKView09ocscGHC+apXMIaorh4xqSxS/dy8SbM= @@ -1567,11 +1906,13 @@ github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czP github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/mailgun/raymond/v2 v2.0.46/go.mod h1:lsgvL50kgt1ylcFJYZiULi5fjPBkkhNfj4KA0W54Z18= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/maratori/testableexamples v1.0.0/go.mod h1:4rhjL1n20TUTT4vdh3RDqSizKLyXp7K2u6HgraZCGzE= github.com/maratori/testpackage v1.0.1/go.mod h1:ddKdw+XG0Phzhx8BFDTKgpWP4i7MpApTE5fXSKAqwDU= github.com/maratori/testpackage v1.1.0/go.mod h1:PeAhzU8qkCwdGEMTEupsHJNlQu2gZopMC6RjbhmHeDc= @@ -1581,8 +1922,8 @@ github.com/matoous/godox v0.0.0-20210227103229-6504466cf951/go.mod h1:1BELzlh859 github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU= github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= +github.com/matryer/try v0.0.0-20161228173917-9ac251b645a2/go.mod h1:0KeJpeMD6o+O4hW7qJOT7vyQPKrWmj26uf5wMc/IiIs= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.0/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= @@ -1590,6 +1931,7 @@ github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= @@ -1598,8 +1940,8 @@ github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HN github.com/mattn/go-ieproxy v0.0.1/go.mod h1:pYabZ6IHcRpFh7vIaLfK7rdcWgFEb3SFJ6/gNWuh88E= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.5-0.20180830101745-3fb116b82035/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= @@ -1628,9 +1970,16 @@ github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182aff github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88Jz2VyhSmden33/aXg4oVIY= github.com/mbilski/exhaustivestruct v1.2.0/go.mod h1:OeTBVxQWoEmB2J2JCHmXWPJ0aksxSUOUy+nvtVEfzXc= +github.com/mediocregopher/mediocre-go-lib v0.0.0-20181029021733-cb65787f37ed/go.mod h1:dSsfyI2zABAdhcbvkXqgxOxrCsbYeHCPgrZkku60dSg= +github.com/mediocregopher/radix/v3 v3.3.0/go.mod h1:EmfVyvspXz1uZEyPBMyGK+kjWiKQGvsUt6O3Pj+LDCQ= +github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= +github.com/mediocregopher/radix/v3 v3.8.0/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= github.com/mgechev/dots v0.0.0-20210922191527-e955255bf517/go.mod h1:KQ7+USdGKfpPjXk4Ga+5XxQM4Lm4e3gAogrreFAYpOg= github.com/mgechev/revive v1.2.4/go.mod h1:iAWlQishqCuj4yhV24FTnKSXGpbAA+0SckXB8GQMX/Q= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= +github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= +github.com/microcosm-cc/bluemonday v1.0.20/go.mod h1:yfBmMi8mxvaZut3Yytv+jTXRY8mxyjJ0/kQBTElld50= +github.com/microcosm-cc/bluemonday v1.0.21/go.mod h1:ytNkv4RrDrLJ2pqlsSI46O6IVXmZOBBD4SaJyDwwTkM= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.35/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= @@ -1662,7 +2011,6 @@ github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0Qu github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.3.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= @@ -1706,6 +2054,7 @@ github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3P github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= github.com/moricho/tparallel v0.2.1/go.mod h1:fXEIZxG2vdfl0ZF8b42f5a78EhjjD5mX8qUplsoSU4k= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= +github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= github.com/mozilla/scribe v0.0.0-20180711195314-fb71baf557c1/go.mod h1:FIczTrinKo8VaLxe6PWTPEXRXDIHz2QAwiaBaP5/4a8= github.com/mozilla/tls-observatory v0.0.0-20190404164649-a3c1b6cfecfd/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk= github.com/mozilla/tls-observatory v0.0.0-20200317151703-4fa42e1c2dee/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk= @@ -1732,10 +2081,17 @@ github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5Vgl github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= github.com/nats-io/jwt v1.2.2/go.mod h1:/xX356yQA6LuXI9xWW7mZNpxgF2mBmGecH+Fj34sP5Q= github.com/nats-io/jwt/v2 v2.0.3/go.mod h1:VRP+deawSXyhNjXmxPCHskrR6Mq50BqpEI5SEcNiGlY= +github.com/nats-io/jwt/v2 v2.2.1-0.20220330180145-442af02fd36a/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= +github.com/nats-io/jwt/v2 v2.3.0/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= github.com/nats-io/nats-server/v2 v2.5.0/go.mod h1:Kj86UtrXAL6LwYRA6H4RqzkHhK0Vcv2ZnKD5WbQ1t3g= +github.com/nats-io/nats-server/v2 v2.8.4/go.mod h1:8zZa+Al3WsESfmgSs98Fi06dRWLH5Bnq90m5bKD/eT4= +github.com/nats-io/nats.go v1.8.1/go.mod h1:BrFz9vVn0fU3AcH9Vn4Kd7W0NpJ651tD5omQ3M8LwxM= github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= github.com/nats-io/nats.go v1.12.1/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= +github.com/nats-io/nats.go v1.15.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= +github.com/nats-io/nats.go v1.16.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= +github.com/nats-io/nkeys v0.0.2/go.mod h1:dab7URMsZm6Z/jp9Z5UGa87Uutgc2mVpXLC4B7TDb/4= github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.2.0/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s= @@ -1744,7 +2100,8 @@ github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OS github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU= github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354/go.mod h1:KSVJerMDfblTH7p5MZaTt+8zaT2iEk3AkVb9PQdZuE8= github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= -github.com/neilotoole/errgroup v0.1.5/go.mod h1:Q2nLGf+594h0CLBs/Mbg6qOr7GtqDK7C2S41udRnToE= +github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo= +github.com/neelance/sourcemap v0.0.0-20200213170602-2833bce08e4c/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= github.com/neilotoole/errgroup v0.1.6/go.mod h1:Q2nLGf+594h0CLBs/Mbg6qOr7GtqDK7C2S41udRnToE= github.com/networkplumbing/go-nft v0.2.0/go.mod h1:HnnM+tYvlGAsMU7yoYwXEVLLiDW9gdMmb5HoGcwpuQs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= @@ -1760,7 +2117,6 @@ github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn github.com/oklog/ulid/v2 v2.1.0/go.mod h1:rcEKHmBBKfef9DhnvX7y1HZBYxjXb0cP5ExxNsTT1QQ= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/olekukonko/tablewriter v0.0.2-0.20190409134802-7e037d187b0c/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.2/go.mod h1:rSAaSIOAGT9odnlyGlUfAJaoc5w2fSBUmeGDbRWPxyQ= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v0.0.0-20151202141238-7f8ab55aaf3b/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -1776,8 +2132,10 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108 github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= -github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU= github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= @@ -1794,6 +2152,7 @@ github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDs github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/onsi/gomega v1.20.0 h1:8W0cWlwFkflGPLltQvLRB7ZVD5HuP6ng320w2IS245Q= github.com/onsi/gomega v1.20.0/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= @@ -1870,7 +2229,6 @@ github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0Mw github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChlfo5C6hzIHwPqfFE= github.com/pborman/getopt v0.0.0-20170112200414-7148bc3a4c30/go.mod h1:85jBQOZwpVEaDAr341tbn15RS4fCAsIst0qp7i8ex1o= -github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.8.0/go.mod h1:D6yutnOGMveHEPV7VQOuvI/gXY61bv+9bAOTRnLElKs= @@ -1895,6 +2253,8 @@ github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= +github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pjbgf/sha1cd v0.2.3/go.mod h1:HOK9QrgzdHpbc2Kzip0Q1yi3M2MFGPADtR6HjG65m5M= github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= @@ -1975,7 +2335,6 @@ github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1 github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= -github.com/prometheus/tsdb v0.6.2-0.20190402121629-4f204dcbc150/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/pseudomuto/protoc-gen-doc v1.3.2/go.mod h1:y5+P6n3iGrbKG+9O04V5ld71in3v/bX88wUwgt+U8EA= github.com/pseudomuto/protokit v0.2.0/go.mod h1:2PdH30hxVHsup8KpBTOXTBeMVhJZVio3Q8ViKSAXT0Q= @@ -1997,6 +2356,8 @@ github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5X github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/regen-network/cosmos-proto v0.3.1 h1:rV7iM4SSFAagvy8RiyhiACbWEGotmqzywPxOvwMdxcg= github.com/regen-network/cosmos-proto v0.3.1/go.mod h1:jO0sVX6a1B36nmE8C9xBFXpNwWejXC7QqCOnH3O0+YM= +github.com/regen-network/gocuke v0.6.2 h1:pHviZ0kKAq2U2hN2q3smKNxct6hS0mGByFMHGnWA97M= +github.com/regen-network/gocuke v0.6.2/go.mod h1:zYaqIHZobHyd0xOrHGPQjbhGJsuZ1oElx150u2o1xuk= github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= @@ -2011,14 +2372,13 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.5.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rs/cors v0.0.0-20160617231935-a62a804a8a00/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.2 h1:KCooALfAYGs415Cwu5ABvv9n9509fSiG5SQJn/AQo4U= github.com/rs/cors v1.8.2/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/rs/xhandler v0.0.0-20160618193221-ed27b6fd6521/go.mod h1:RvLn4FgxWubrpZHtQLnOf6EwhN2hEMusxZOhcW9H3UQ= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.27.0 h1:1T7qCieN22GVc8S4Q2yuexzBb1EqjbgjSH9RohbMjKs= @@ -2047,6 +2407,7 @@ github.com/sashamelentyev/interfacebloat v1.1.0/go.mod h1:+Y9yU5YdTkrNvoX0xHc84d github.com/sashamelentyev/usestdlibvars v1.20.0/go.mod h1:0GaP+ecfZMXShS0A94CJn6aEuPRILv8h/VuWI9n1ygg= github.com/sassoftware/go-rpmutils v0.0.0-20190420191620-a8f1baeba37b/go.mod h1:am+Fp8Bt506lA3Rk3QCmSqmYmLMnPDhdDUcosQCAx+I= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= @@ -2066,13 +2427,16 @@ github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNX github.com/serialx/hashring v0.0.0-20190422032157-8b2912629002/go.mod h1:/yeG0My1xr/u+HZrFQ1tOQQQQrOawfyMUH13ai5brBc= github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs= github.com/shirou/gopsutil v0.0.0-20190901111213-e4ec7b275ada/go.mod h1:WWnYX4lzhCH5h/3YBfyVA3VbLYjlMZZAQcW9ojMexNc= -github.com/shirou/gopsutil v2.20.5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= +github.com/shirou/gopsutil/v3 v3.22.8/go.mod h1:s648gW4IywYzUfE/KjXxUsqrqx/T2xO5VqOXxONeRfI= github.com/shirou/gopsutil/v3 v3.22.9/go.mod h1:bBYl1kjgEJpWpxeHmLI+dVHWtyAwfcmSBLDsp2TNT8A= github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc= github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= +github.com/shurcooL/go v0.0.0-20200502201357-93f07166e636/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= +github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -2089,9 +2453,12 @@ github.com/sivchari/tenv v1.7.0/go.mod h1:64yStXKSOxDfX47NlhVwND4dHwfZDdbp2Lyl01 github.com/skeema/knownhosts v1.1.0/go.mod h1:sKFq3RD6/TKZkSWn8boUbDC7Qkgcv+8XXijpFO6roag= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v1.0.0/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM= +github.com/smartystreets/assertions v1.2.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= +github.com/smartystreets/assertions v1.13.0/go.mod h1:wDmR7qL282YbGsPy6H/yAsesrxfxaaSlJazyFLYVFx8= github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9/go.mod h1:SnhjPscd9TpLiy1LpzGSKh3bXCfxxXuqd9xmQJy3slM= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/smartystreets/goconvey v1.7.2/go.mod h1:Vw0tHAZW6lzCRk3xgdin6fKYcG+G3Pg9vgXWeJpQFMM= github.com/smartystreets/gunit v1.0.0/go.mod h1:qwPWnhz6pn0NnRBP++URONOVyNkPyr4SauJk4cUOwJs= github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa/go.mod h1:oJyF+mSPHbB5mVY2iO9KV3pTt/QbIkGaO8gQ2WrDbP4= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= @@ -2149,8 +2516,6 @@ github.com/spf13/viper v1.14.0/go.mod h1:WT//axPky3FdvXHzGw33dNdXXXfFQqmEalje+eg github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= github.com/stbenjam/no-sprintf-host-port v0.1.1/go.mod h1:TLhvtIvONRzdmkFiio4O8LHsN9N74I+PhRquPsxpL0I= -github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570/go.mod h1:8OR4w3TdeIHIh1g6EMY5p0gVNOovcWC+1vpc7naMuAw= -github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3/go.mod h1:hpGUWaI9xL8pRQCTXQgocU38Qw1g0Us7n5PxxTwTCYU= github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980/go.mod h1:AO3tvPzVZ/ayst6UlUKUv6rcPQInYe3IknH3jYhAKu8= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= @@ -2162,6 +2527,7 @@ github.com/stretchr/objx v0.0.0-20180129172003-8a3f7159479f/go.mod h1:HFkY916IF+ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -2183,6 +2549,12 @@ github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ github.com/tdakkota/asciicheck v0.0.0-20200416190851-d7f85be797a2/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM= github.com/tdakkota/asciicheck v0.0.0-20200416200610-e657995f937b/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM= github.com/tdakkota/asciicheck v0.1.1/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM= +github.com/tdewolff/minify/v2 v2.12.1/go.mod h1:p5pwbvNs1ghbFED/ZW1towGsnnWwzvM8iz8l0eURi9g= +github.com/tdewolff/minify/v2 v2.12.4/go.mod h1:h+SRvSIX3kwgwTFOpSckvSxgax3uy8kZTSF1Ojrr3bk= +github.com/tdewolff/parse/v2 v2.6.3/go.mod h1:woz0cgbLwFdtbjJu8PIKxhW05KplTFQkOdX78o+Jgrs= +github.com/tdewolff/parse/v2 v2.6.4/go.mod h1:woz0cgbLwFdtbjJu8PIKxhW05KplTFQkOdX78o+Jgrs= +github.com/tdewolff/test v1.0.7/go.mod h1:6DAvZliBAAnD7rhVgwaM7DE5/d9NMOAJ09SqYqeK4QE= +github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= @@ -2199,18 +2571,14 @@ github.com/tetafro/godot v0.4.2/go.mod h1:/7NLHhv08H1+8DNj0MElpAACw1ajsCuf3TKNQx github.com/tetafro/godot v1.4.11/go.mod h1:LR3CJpxDVGlYOWn3ZZg1PgNZdTUvzsZWu8xaEohUpn8= github.com/tidwall/btree v1.5.0 h1:iV0yVY/frd7r6qGBXfEYs7DH0gTDgrKTrDjS7xt/IyQ= github.com/tidwall/btree v1.5.0/go.mod h1:LGm8L/DZjPLmeWGjv5kFrY8dL4uVhMmzmmLYmsObdKE= -github.com/tidwall/gjson v1.6.7/go.mod h1:zeFuBCIqD4sN/gmqBzZ4j7Jd6UcA2Fc56x7QFsv+8fI= github.com/tidwall/gjson v1.12.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/gjson v1.14.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/gjson v1.14.4 h1:uo0p8EbA09J7RQaflQ1aBRffTR7xedD2bcIVSYxLnkM= github.com/tidwall/gjson v1.14.4/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= -github.com/tidwall/match v1.0.3/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= -github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= -github.com/tidwall/sjson v1.1.4/go.mod h1:wXpKXu8CtDjKAZ+3DrKY5ROCorDFahq8l0tey/Lx1fg= github.com/tidwall/sjson v1.2.4/go.mod h1:098SZ494YoMWPmMO6ct4dcFnqxwj9r/gF0Etp19pSNM= github.com/timakin/bodyclose v0.0.0-20190930140734-f7f2e9bca95e/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk= github.com/timakin/bodyclose v0.0.0-20200424151742-cb6215831a94/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk= @@ -2249,11 +2617,13 @@ github.com/tyler-smith/go-bip39 v1.0.2/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2 github.com/uber/jaeger-client-go v2.25.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= github.com/uber/jaeger-lib v2.2.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= +github.com/ugorji/go v1.2.7 h1:qYhyWUUd6WbiM+C6JZAUkIJt/1WrjzNHY9+KCIjVqTo= +github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= +github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= +github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= github.com/ulikunitz/xz v0.5.7/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/ultraware/funlen v0.0.2/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA= @@ -2266,11 +2636,14 @@ github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtX github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.4/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= +github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= github.com/uudashr/gocognit v1.0.1/go.mod h1:j44Ayx2KW4+oB6SWMv8KsmHzZrOInQav7D3cQMJ5JUM= github.com/uudashr/gocognit v1.0.6/go.mod h1:nAIUuVBnYU7pcninia3BHOvQkpQCeO76Uscky5BOwcY= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.2.0/go.mod h1:4vX61m6KN+xDduDNwXrhIAVZaZaZiQ1luJk8LWSxF3s= +github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= github.com/valyala/fasthttp v1.30.0/go.mod h1:2rsYD01CKFrjjsvFxx75KlEUNpWNBY9JWD3K/7o2Cus= +github.com/valyala/fasthttp v1.40.0/go.mod h1:t/G+3rLek+CyY9bnIE+YlMRddxVAAGjhxndDB4i4C0I= github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/valyala/quicktemplate v1.2.0/go.mod h1:EH+4AkTd43SvgIbQHYu59/cJyxDoOVRUAfrukLPuGJ4= @@ -2289,15 +2662,12 @@ github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc/go.mod h1:ZjcWmF github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= -github.com/vmihailenco/msgpack/v5 v5.1.4/go.mod h1:C5gboKD0TJPqWDTVTtrQNfRbiBwHZGo8UTqP/9/XvLI= github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= -github.com/vmihailenco/tagparser v0.1.2/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/vmware/govmomi v0.20.3/go.mod h1:URlwyTFZX72RmxtxuaFL2Uj3fD1JTvZdx59bHWk6aFU= github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr3+MjI= -github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208/go.mod h1:IotVbo4F+mw0EzQ08zFqg7pK3FebNXpaMsRy2RT+Ees= github.com/xanzy/go-gitlab v0.31.0/go.mod h1:sPLojNBn68fMUWSxIJtdVVIP8uSBYqesTfDUseX11Ug= github.com/xanzy/go-gitlab v0.32.0/go.mod h1:sPLojNBn68fMUWSxIJtdVVIP8uSBYqesTfDUseX11Ug= github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= @@ -2312,8 +2682,10 @@ github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6Ut github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yagipy/maintidx v1.0.0/go.mod h1:0qNf/I/CCZXSMhsRsrEPDZ+DkekpKLXAJfsTACwgXLk= +github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= github.com/ybbus/jsonrpc v2.1.2+incompatible/go.mod h1:XJrh1eMSzdIYFbM08flv0wp5G35eRniyeGut1z+LSiE= github.com/yeya24/promlinter v0.2.0/go.mod h1:u54lkmBOZrpEbQQ6gox2zWKKLKu2SGe+2KOiextY+IA= +github.com/yosssi/ace v0.0.5/go.mod h1:ALfIzm2vT7t5ZE7uoIZqF3TQ7SAOyupFZnkrF5id+K0= github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= @@ -2376,6 +2748,7 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0/go.mod h1:oVGt1LRbBOBq1A5BQLlUg9UaU/54aiHw8cgjV3aWZ/E= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.28.0/go.mod h1:vEhqr0m4eTc+DWxfsXoXue2GBgV2uUwVznkGIHW/e5w= @@ -2444,6 +2817,7 @@ go.uber.org/zap v1.23.0/go.mod h1:D+nX8jyLsMHMYrln8A0rJjFt/T/9/bGgIhAqxv5URuY= go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= gocloud.dev v0.19.0/go.mod h1:SmKwiR8YwIMMJvQBKLsC3fHNyMwXLw3PMDO+VVteJMI= golang.org/x/build v0.0.0-20190314133821-5284462c4bec/go.mod h1:atTaCNAy0f16Ah5aV1gMSwgiKVHwu/JncqDpuRr7lS4= +golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180501155221-613d6eafa307/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -2464,6 +2838,7 @@ golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3 golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -2487,11 +2862,16 @@ golang.org/x/crypto v0.0.0-20210915214749-c084706c2272/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211202192323-5770296d904e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220826181053-bd7e27e6170d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220926161630-eccd6366d1be/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.2.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= @@ -2504,7 +2884,6 @@ golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= @@ -2513,8 +2892,10 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA= +golang.org/x/exp v0.0.0-20200513190911-00229845015e/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA= +golang.org/x/exp v0.0.0-20221019170559-20944726eadf h1:nFVjjKDgNY37+ZSYCJmtYf7tOlfQswHqplG2eosjOMg= +golang.org/x/exp v0.0.0-20221019170559-20944726eadf/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20220613132600-b0d781184e0d/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= @@ -2536,12 +2917,10 @@ golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPI golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mobile v0.0.0-20200801112145-973feb4309de/go.mod h1:skQtrUTUwhdJvXM/2KKJzY8pDgNr9I/FOMqDVRPBUS4= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191209134235-331c550502dd/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -2555,6 +2934,7 @@ golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= golang.org/x/mod v0.7.0 h1:LapD9S96VoQRhi/GrNTqeBJFrUjs5UHCAtTlgwA5oZA= golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -2571,6 +2951,7 @@ golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -2604,7 +2985,6 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -2630,6 +3010,7 @@ golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210917221730-978cfadd31cf/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -2644,13 +3025,17 @@ golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220812174116-3211cb980234/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.0.0-20221002022538-bcab6841153b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.0.0-20221012135044-0b7e1fb9d458/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221017152216-f25eb7ecb193/go.mod h1:RpDiru2p0u2F0lLpEoqnP2+7xs0ifAuOcJ442g6GU2s= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= +golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= @@ -2684,6 +3069,7 @@ golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7Lm golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -2703,6 +3089,7 @@ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -2734,7 +3121,6 @@ golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190620070143-6f217b454f45/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190812073006-9eafafc0a87e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -2783,7 +3169,6 @@ golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200817155316-9781c653f443/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200824131525-c12d262b63d8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -2800,6 +3185,7 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201202213521-69691e467435/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201207223542-d4d67f95c62d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -2836,21 +3222,26 @@ golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210903071746-97244b99971b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210909193231-528a39cd75f3/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210917161153-d61c044b1678/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211105183446-c75c47738b0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220111092808-5a964db01320/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220315194320-039c03cc5b86/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220405210540-1e041c57c461/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -2869,10 +3260,13 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220817070843-5a390386f1f2/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220915200043-7b5979e65e41/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221013171732-95e765b1cc43/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -2920,13 +3314,18 @@ golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220609170525-579cf78fd858/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20220922220347-f3bd1da661af/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181117154741-2ddaf7f79a09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181219222714-6e267b5cc78e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181221001348-537d06c36207/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190110163146-51295c7ec13a/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190221204921-83362c3779f5/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -2939,6 +3338,7 @@ golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190321232350-e250d351ecad/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190322203728-c1a832b0ad89/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190422233926-fe54fb35175b/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -2976,7 +3376,6 @@ golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200102140908-9497f49d5709/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200108203644-89082a384178/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117012304-6edc0a871e69/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117220505-0cba7a3a9ee9/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -3064,6 +3463,7 @@ gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJ gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= gonum.org/v1/gonum v0.6.0/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= +gonum.org/v1/gonum v0.8.2 h1:CCXrcPKiGGotvnN6jfUsKk4rRqm7q09/YbKb5xCEvtM= gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= gonum.org/v1/netlib v0.0.0-20181029234149-ec6d1f5cefe6/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= @@ -3132,8 +3532,10 @@ google.golang.org/api v0.95.0/go.mod h1:eADj+UBuxkh5zlrSntJghuNeg8HwQ1w5lTKkuqaE google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= +google.golang.org/api v0.99.0/go.mod h1:1YOf74vkVndF7pG6hIHuINsM7eWwpVTAfNMNiL91A08= google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= google.golang.org/api v0.102.0/go.mod h1:3VFl6/fzoA+qNuS1N1/VfXY4LjoXN/wzeIp7TweWwGo= +google.golang.org/api v0.103.0/go.mod h1:hGtW6nK1AC+d9si/UBhw8Xli+QMOf6xyNAyJw4qU9w0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -3146,6 +3548,7 @@ google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCID google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/cloud v0.0.0-20151119220103-975617b05ea8/go.mod h1:0H1ncTHf11KCFhTc/+EFRbzSCOZx+VUbRMk55Yv5MYk= google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -3240,6 +3643,7 @@ google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2 google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= @@ -3274,8 +3678,15 @@ google.golang.org/genproto v0.0.0-20220926220553-6981cbe3cfce/go.mod h1:woMGP53B google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqwhZAwq4wsRUaVG555sVgsNmIjRtO7t/JH29U= google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= -google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e h1:S9GbmC1iCgvbLyAokVCwiO6tVIrU9Y7c5oMx1V/ki/Y= +google.golang.org/genproto v0.0.0-20221024153911-1573dae28c9c/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= +google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c/go.mod h1:CGI5F/G+E5bKwmfYo09AXuVN4dD894kIKUFmVbP2/Fo= +google.golang.org/genproto v0.0.0-20221114212237-e4508ebdbee1/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221117204609-8f9c96812029/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221201164419-0e50fba7f41c/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20230125152338-dcaf20b6aeaa h1:qQPhfbPO23fwm/9lQr91L1u62Zo6cm+zI+slZT+uf+o= +google.golang.org/genproto v0.0.0-20230125152338-dcaf20b6aeaa/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= @@ -3314,8 +3725,11 @@ gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMy gopkg.in/gcfg.v1 v1.2.0/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= +gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= +gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.56.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= @@ -3323,6 +3737,7 @@ gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.66.6/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= @@ -3347,16 +3762,22 @@ gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= +gotest.tools/v3 v3.1.0/go.mod h1:fHy7eyTmJFO5bQbUsEGQ1v4m2J3Jz9eWL54TP2/ZuYQ= gotest.tools/v3 v3.2.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= +gotest.tools/v3 v3.3.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= +gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= +gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o= honnef.co/go/tools v0.0.0-20180920025451-e3ad64cb4ed3/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -3450,6 +3871,7 @@ modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= +moul.io/http2curl v1.0.0/go.mod h1:f6cULg+e4Md/oW1cYmwW4IWQOVl2lGbmCNGOHvzX2kE= mvdan.cc/gofumpt v0.4.0/go.mod h1:PljLOHDeZqgS8opHRKLzp2It2VBuSdteAgqUfzMTxlQ= mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc= mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4= @@ -3459,6 +3881,10 @@ mvdan.cc/unparam v0.0.0-20220706161116-678bad134442/go.mod h1:F/Cxw/6mVrNKqrR2Yj nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= pack.ag/amqp v0.11.2/go.mod h1:4/cbmt4EJXSKlG6LCfWHoqmN0uFdy5i/+YFz+fTfhV4= +pgregory.net/rapid v0.4.7/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU= +pgregory.net/rapid v0.5.2/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= +pgregory.net/rapid v0.5.3 h1:163N50IHFqr1phZens4FQOdPgfJscR7a562mjQqeo4M= +pgregory.net/rapid v0.5.3/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= @@ -3477,6 +3903,7 @@ sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZa sigs.k8s.io/structured-merge-diff/v4 v4.2.1/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0= sourcegraph.com/sqs/pbtypes v1.0.0/go.mod h1:3AciMUv4qUuRHRHhOG4TZOB+72GdPVz5k+c648qsFS4= diff --git a/legacy_ibc_testing/core/events.go b/legacy_ibc_testing/core/events.go index a810f6cf66..d9724666ce 100644 --- a/legacy_ibc_testing/core/events.go +++ b/legacy_ibc_testing/core/events.go @@ -38,10 +38,10 @@ func ReconstructPacketFromEvent(event abci.Event) (packet types.Packet, err erro return types.NewPacket( attrMap[string(types.AttributeKeyData)], // data uint64(sequence), - string(attrMap[string(types.AttributeKeySrcPort)]), //sourcePort, - string(attrMap[string(types.AttributeKeySrcChannel)]), //sourceChannel, - string(attrMap[string(types.AttributeKeyDstPort)]), //destinationPort, - string(attrMap[string(types.AttributeKeyDstChannel)]), //destinationChannel string, + string(attrMap[string(types.AttributeKeySrcPort)]), // sourcePort, + string(attrMap[string(types.AttributeKeySrcChannel)]), // sourceChannel, + string(attrMap[string(types.AttributeKeyDstPort)]), // destinationPort, + string(attrMap[string(types.AttributeKeyDstChannel)]), // destinationChannel string, timeoutHeight, uint64(timeoutTimestamp), ), nil diff --git a/legacy_ibc_testing/core/expected_keepers.go b/legacy_ibc_testing/core/expected_keepers.go index 29aae963d6..9df310e4bb 100644 --- a/legacy_ibc_testing/core/expected_keepers.go +++ b/legacy_ibc_testing/core/expected_keepers.go @@ -1,9 +1,10 @@ package core import ( + "time" + sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "time" ) /* diff --git a/legacy_ibc_testing/simapp/helpers/test_helpers.go b/legacy_ibc_testing/simapp/helpers/test_helpers.go index 08150b144a..7cafed6571 100644 --- a/legacy_ibc_testing/simapp/helpers/test_helpers.go +++ b/legacy_ibc_testing/simapp/helpers/test_helpers.go @@ -1,13 +1,14 @@ package helpers import ( + "math/rand" + "github.com/cosmos/cosmos-sdk/client" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/types/tx/signing" authsign "github.com/cosmos/cosmos-sdk/x/auth/signing" - "math/rand" ) /* @@ -27,7 +28,7 @@ func GenTx(gen client.TxConfig, msgs []sdk.Msg, feeAmt sdk.Coins, gas uint64, ch sigs := make([]signing.SignatureV2, len(priv)) // create a random length memo - r := rand.New(rand.NewSource(rand.Int63())) + r := rand.New(rand.NewSource(rand.Int63())) //nolint:gosec // not used for security purposes memo := simulation.RandStringOfLength(r, simulation.RandIntBetween(r, 0, 100)) diff --git a/legacy_ibc_testing/simapp/test_helpers.go b/legacy_ibc_testing/simapp/test_helpers.go index 153ff39a10..bca8506872 100644 --- a/legacy_ibc_testing/simapp/test_helpers.go +++ b/legacy_ibc_testing/simapp/test_helpers.go @@ -61,7 +61,7 @@ func ConvertAddrsToValAddrs(addrs []sdk.AccAddress) []sdk.ValAddress { return valAddrs } -func TestAddr(addr string, bech string) (sdk.AccAddress, error) { +func TestAddr(addr, bech string) (sdk.AccAddress, error) { res, err := sdk.AccAddressFromHex(addr) if err != nil { return nil, err @@ -87,8 +87,8 @@ func TestAddr(addr string, bech string) (sdk.AccAddress, error) { // // CONTRACT: BeginBlock must be called before this function. func SignAndDeliver( - t *testing.T, txCfg client.TxConfig, app *bam.BaseApp, header tmproto.Header, msgs []sdk.Msg, - chainID string, accNums, accSeqs []uint64, expSimPass, expPass bool, priv ...cryptotypes.PrivKey, + t *testing.T, txCfg client.TxConfig, app *bam.BaseApp, _ tmproto.Header, msgs []sdk.Msg, + chainID string, accNums, accSeqs []uint64, _, expPass bool, priv ...cryptotypes.PrivKey, ) (sdk.GasInfo, *sdk.Result, error) { tx, err := helpers.GenTx( txCfg, @@ -124,8 +124,16 @@ func CreateTestPubKeys(numPubKeys int) []cryptotypes.PubKey { // start at 10 to avoid changing 1 to 01, 2 to 02, etc for i := 100; i < (numPubKeys + 100); i++ { numString := strconv.Itoa(i) - buffer.WriteString("0B485CFC0EECC619440448436F8FC9DF40566F2369E72400281454CB552AF") // base pubkey string - buffer.WriteString(numString) // adding on final two digits to make pubkeys unique + _, err := buffer.WriteString("0B485CFC0EECC619440448436F8FC9DF40566F2369E72400281454CB552AF") // base pubkey string + if err != nil { + panic(err) + } + _, err = buffer.WriteString(numString) + if err != nil { + panic(err) + } + + // adding on final two digits to make pubkeys unique publicKeys = append(publicKeys, NewPubKeyFromHex(buffer.String())) buffer.Reset() } @@ -149,6 +157,6 @@ func NewPubKeyFromHex(pk string) (res cryptotypes.PubKey) { type EmptyAppOptions struct{} // Get implements AppOptions -func (ao EmptyAppOptions) Get(o string) interface{} { +func (EmptyAppOptions) Get(_ string) any { return nil } diff --git a/legacy_ibc_testing/testing/app.go b/legacy_ibc_testing/testing/app.go index 0ec80eb819..a7fcde4b10 100644 --- a/legacy_ibc_testing/testing/app.go +++ b/legacy_ibc_testing/testing/app.go @@ -34,11 +34,11 @@ The e2e test suites rely on modifications to ibc-go's test framework that cannot These files will be deprecated once ICS is able to upgrade to ibc-go v5. */ -type AppIniter func() (TestingApp, map[string]json.RawMessage) +type AppIniter func() (AppTest, map[string]json.RawMessage) var DefaultTestingAppInit AppIniter -type TestingApp interface { +type AppTest interface { abci.Application // ibc-go additions @@ -60,7 +60,7 @@ type TestingApp interface { // that also act as delegators. For simplicity, each validator is bonded with a delegation // of one consensus engine unit (10^6) in the default token of the simapp from first genesis // account. A Nop logger is set in SimApp. -func SetupWithGenesisValSet(t *testing.T, appIniter AppIniter, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, chainID string, powerReduction sdk.Int, balances ...banktypes.Balance) TestingApp { +func SetupWithGenesisValSet(t *testing.T, appIniter AppIniter, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, chainID string, powerReduction sdk.Int, balances ...banktypes.Balance) AppTest { app, genesisState := appIniter() // set genesis accounts diff --git a/legacy_ibc_testing/testing/chain.go b/legacy_ibc_testing/testing/chain.go index 29a2793618..d82f373cd0 100644 --- a/legacy_ibc_testing/testing/chain.go +++ b/legacy_ibc_testing/testing/chain.go @@ -61,7 +61,7 @@ type TestChain struct { *testing.T Coordinator *Coordinator - App TestingApp + App AppTest ChainID string LastHeader *ibctmtypes.Header // header for last block height committed CurrentHeader tmproto.Header // header for current block height @@ -276,7 +276,7 @@ func GetSentPacketKey(sequence uint64, channelID string) string { func (chain *TestChain) GetSentPacket(sequence uint64, channelID string) (packet channeltypes.Packet, found bool) { sentPacketKey := GetSentPacketKey(sequence, channelID) packet, found = chain.SentPackets[sentPacketKey] - return + return packet, found } // setSentPacketsFromEvents stores the sent packet reconstructed @@ -299,7 +299,6 @@ func (chain *TestChain) setSentPacketsFromEvents(events []abci.Event) { // returned on block `n` to the validators of block `n+2`. // It calls BeginBlock with the new block created before returning. func (chain *TestChain) NextBlock() (abci.ResponseEndBlock, abci.ResponseCommit, abci.ResponseBeginBlock) { - ebRes := chain.App.EndBlock(abci.RequestEndBlock{Height: chain.CurrentHeader.Height}) // store packets sent during EndBlock chain.setSentPacketsFromEvents(ebRes.Events) @@ -336,14 +335,14 @@ func (chain *TestChain) NextBlock() (abci.ResponseEndBlock, abci.ResponseCommit, // sendMsgs delivers a transaction through the application without returning the result. func (chain *TestChain) sendMsgs(msgs ...sdk.Msg) error { - _, err := chain.SendMsgs(msgs...) + _, err := chain.SendMessages(msgs...) return err } // SendMsgs delivers a transaction through the application. It updates the senders sequence // number and updates the TestChain's headers. It returns the result and error if one // occurred. -func (chain *TestChain) SendMsgs(msgs ...sdk.Msg) (*sdk.Result, error) { +func (chain *TestChain) SendMessages(msgs ...sdk.Msg) (*sdk.Result, error) { // ensure the chain has the latest time chain.Coordinator.UpdateTimeForChain(chain) @@ -511,7 +510,7 @@ func (chain *TestChain) CreateTMClientHeader(chainID string, blockHeight int64, AppHash: chain.CurrentHeader.AppHash, LastResultsHash: tmhash.Sum([]byte("last_results_hash")), EvidenceHash: tmhash.Sum([]byte("evidence_hash")), - ProposerAddress: tmValSet.Proposer.Address, //nolint:staticcheck + ProposerAddress: tmValSet.Proposer.Address, } hhash := tmHeader.Hash() @@ -598,11 +597,11 @@ func (chain *TestChain) CreatePortCapability(scopedKeeper capabilitykeeper.Scope _, ok := chain.App.GetScopedIBCKeeper().GetCapability(chain.GetContext(), host.PortPath(portID)) if !ok { // create capability using the IBC capability keeper - cap, err := chain.App.GetScopedIBCKeeper().NewCapability(chain.GetContext(), host.PortPath(portID)) + portCap, err := chain.App.GetScopedIBCKeeper().NewCapability(chain.GetContext(), host.PortPath(portID)) require.NoError(chain.T, err) // claim capability using the scopedKeeper - err = scopedKeeper.ClaimCapability(chain.GetContext(), cap, host.PortPath(portID)) + err = scopedKeeper.ClaimCapability(chain.GetContext(), portCap, host.PortPath(portID)) require.NoError(chain.T, err) } @@ -612,10 +611,10 @@ func (chain *TestChain) CreatePortCapability(scopedKeeper capabilitykeeper.Scope // GetPortCapability returns the port capability for the given portID. The capability must // exist, otherwise testing will fail. func (chain *TestChain) GetPortCapability(portID string) *capabilitytypes.Capability { - cap, ok := chain.App.GetScopedIBCKeeper().GetCapability(chain.GetContext(), host.PortPath(portID)) + portCap, ok := chain.App.GetScopedIBCKeeper().GetCapability(chain.GetContext(), host.PortPath(portID)) require.True(chain.T, ok) - return cap + return portCap } // CreateChannelCapability binds and claims a capability for the given portID and channelID @@ -626,9 +625,9 @@ func (chain *TestChain) CreateChannelCapability(scopedKeeper capabilitykeeper.Sc // check if the portId is already binded, if not bind it _, ok := chain.App.GetScopedIBCKeeper().GetCapability(chain.GetContext(), capName) if !ok { - cap, err := chain.App.GetScopedIBCKeeper().NewCapability(chain.GetContext(), capName) + chanCap, err := chain.App.GetScopedIBCKeeper().NewCapability(chain.GetContext(), capName) require.NoError(chain.T, err) - err = scopedKeeper.ClaimCapability(chain.GetContext(), cap, capName) + err = scopedKeeper.ClaimCapability(chain.GetContext(), chanCap, capName) require.NoError(chain.T, err) } @@ -638,10 +637,10 @@ func (chain *TestChain) CreateChannelCapability(scopedKeeper capabilitykeeper.Sc // GetChannelCapability returns the channel capability for the given portID and channelID. // The capability must exist, otherwise testing will fail. func (chain *TestChain) GetChannelCapability(portID, channelID string) *capabilitytypes.Capability { - cap, ok := chain.App.GetScopedIBCKeeper().GetCapability(chain.GetContext(), host.ChannelCapabilityPath(portID, channelID)) + chanCap, ok := chain.App.GetScopedIBCKeeper().GetCapability(chain.GetContext(), host.ChannelCapabilityPath(portID, channelID)) require.True(chain.T, ok) - return cap + return chanCap } // GetTimeoutHeight is a convenience function which returns a IBC packet timeout height diff --git a/legacy_ibc_testing/testing/config.go b/legacy_ibc_testing/testing/config.go index f9c72f501e..b772531ff7 100644 --- a/legacy_ibc_testing/testing/config.go +++ b/legacy_ibc_testing/testing/config.go @@ -41,7 +41,7 @@ func NewTendermintConfig() *TendermintConfig { } } -func (tmcfg *TendermintConfig) GetClientType() string { +func (*TendermintConfig) GetClientType() string { return exported.Tendermint } diff --git a/legacy_ibc_testing/testing/coordinator.go b/legacy_ibc_testing/testing/coordinator.go index a968c2ac5d..b580076373 100644 --- a/legacy_ibc_testing/testing/coordinator.go +++ b/legacy_ibc_testing/testing/coordinator.go @@ -204,8 +204,8 @@ func (coord *Coordinator) CommitNBlocks(chain *TestChain, n uint64) { // CommitBlockGetResponses commits a block and provides abci responses func (coord *Coordinator) CommitBlockGetResponses(chain *TestChain) ( - abci.ResponseEndBlock, abci.ResponseCommit, abci.ResponseBeginBlock) { - + abci.ResponseEndBlock, abci.ResponseCommit, abci.ResponseBeginBlock, +) { ebRes, cRes, bbResp := chain.NextBlock() coord.IncrementTime() return ebRes, cRes, bbResp @@ -213,7 +213,7 @@ func (coord *Coordinator) CommitBlockGetResponses(chain *TestChain) ( // ConnOpenInitOnBothChains initializes a connection on both endpoints with the state INIT // using the OpenInit handshake call. -func (coord *Coordinator) ConnOpenInitOnBothChains(path *Path) error { +func (*Coordinator) ConnOpenInitOnBothChains(path *Path) error { if err := path.EndpointA.ConnOpenInit(); err != nil { return err } @@ -231,7 +231,7 @@ func (coord *Coordinator) ConnOpenInitOnBothChains(path *Path) error { // ChanOpenInitOnBothChains initializes a channel on the source chain and counterparty chain // with the state INIT using the OpenInit handshake call. -func (coord *Coordinator) ChanOpenInitOnBothChains(path *Path) error { +func (*Coordinator) ChanOpenInitOnBothChains(path *Path) error { // NOTE: only creation of a capability for a transfer or mock port is supported // Other applications must bind to the port in InitGenesis or modify this code. diff --git a/legacy_ibc_testing/testing/endpoint.go b/legacy_ibc_testing/testing/endpoint.go index 2ce4903fb0..b4c8c7dcfa 100644 --- a/legacy_ibc_testing/testing/endpoint.go +++ b/legacy_ibc_testing/testing/endpoint.go @@ -108,7 +108,7 @@ func (endpoint *Endpoint) CreateClient() (err error) { ) require.NoError(endpoint.Chain.T, err) - res, err := endpoint.Chain.SendMsgs(msg) + res, err := endpoint.Chain.SendMessages(msg) if err != nil { return err } @@ -155,7 +155,7 @@ func (endpoint *Endpoint) ConnOpenInit() error { endpoint.Counterparty.Chain.GetPrefix(), DefaultOpenInitVersion, endpoint.ConnectionConfig.DelayPeriod, endpoint.Chain.SenderAccount.GetAddress().String(), ) - res, err := endpoint.Chain.SendMsgs(msg) + res, err := endpoint.Chain.SendMessages(msg) if err != nil { return err } @@ -185,7 +185,7 @@ func (endpoint *Endpoint) ConnOpenTry() error { proofHeight, consensusHeight, endpoint.Chain.SenderAccount.GetAddress().String(), ) - res, err := endpoint.Chain.SendMsgs(msg) + res, err := endpoint.Chain.SendMessages(msg) if err != nil { return err } @@ -257,7 +257,7 @@ func (endpoint *Endpoint) QueryConnectionHandshakeProof() ( connectionKey := host.ConnectionKey(endpoint.Counterparty.ConnectionID) proofConnection, _ = endpoint.Counterparty.QueryProofAtHeight(connectionKey, proofHeight.GetRevisionHeight()) - return + return clientState, proofClient, proofConsensus, consensusHeight, proofConnection, proofHeight } // ChanOpenInit will construct and execute a MsgChannelOpenInit on the associated endpoint. @@ -268,7 +268,7 @@ func (endpoint *Endpoint) ChanOpenInit() error { endpoint.Counterparty.ChannelConfig.PortID, endpoint.Chain.SenderAccount.GetAddress().String(), ) - res, err := endpoint.Chain.SendMsgs(msg) + res, err := endpoint.Chain.SendMessages(msg) if err != nil { return err } @@ -298,7 +298,7 @@ func (endpoint *Endpoint) ChanOpenTry() error { proof, height, endpoint.Chain.SenderAccount.GetAddress().String(), ) - res, err := endpoint.Chain.SendMsgs(msg) + res, err := endpoint.Chain.SendMessages(msg) if err != nil { return err } @@ -397,7 +397,7 @@ func (endpoint *Endpoint) RecvPacketWithResult(packet channeltypes.Packet) (*sdk recvMsg := channeltypes.NewMsgRecvPacket(packet, proof, proofHeight, endpoint.Chain.SenderAccount.GetAddress().String()) // receive on counterparty and update source client - res, err := endpoint.Chain.SendMsgs(recvMsg) + res, err := endpoint.Chain.SendMessages(recvMsg) if err != nil { return nil, err } diff --git a/legacy_ibc_testing/testing/events.go b/legacy_ibc_testing/testing/events.go index 98c8d137ff..a6ca7d7c3a 100644 --- a/legacy_ibc_testing/testing/events.go +++ b/legacy_ibc_testing/testing/events.go @@ -2,6 +2,7 @@ package testing import ( "fmt" + sdk "github.com/cosmos/cosmos-sdk/types" clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" diff --git a/legacy_ibc_testing/testing/path.go b/legacy_ibc_testing/testing/path.go index 910e6d0755..0956047ff3 100644 --- a/legacy_ibc_testing/testing/path.go +++ b/legacy_ibc_testing/testing/path.go @@ -48,7 +48,6 @@ func (path *Path) SetChannelOrdered() { func (path *Path) RelayPacket(packet channeltypes.Packet) error { pc := path.EndpointA.Chain.App.GetIBCKeeper().ChannelKeeper.GetPacketCommitment(path.EndpointA.Chain.GetContext(), packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence()) if bytes.Equal(pc, channeltypes.CommitPacket(path.EndpointA.Chain.App.AppCodec(), packet)) { - // packet found, relay from A to B if err := path.EndpointB.UpdateClient(); err != nil { return err @@ -64,16 +63,15 @@ func (path *Path) RelayPacket(packet channeltypes.Packet) error { return err } - if err := path.EndpointA.AcknowledgePacket(packet, ack); err != nil { - return err - } + err = path.EndpointA.AcknowledgePacket(packet, ack) - return nil + return err } + // check if packet commitment exists on B pc = path.EndpointB.Chain.App.GetIBCKeeper().ChannelKeeper.GetPacketCommitment(path.EndpointB.Chain.GetContext(), packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence()) + // packet found, relay from B to A if bytes.Equal(pc, channeltypes.CommitPacket(path.EndpointB.Chain.App.AppCodec(), packet)) { - // packet found, relay B to A if err := path.EndpointA.UpdateClient(); err != nil { return err @@ -89,10 +87,8 @@ func (path *Path) RelayPacket(packet channeltypes.Packet) error { return err } - if err := path.EndpointB.AcknowledgePacket(packet, ack); err != nil { - return err - } - return nil + err = path.EndpointB.AcknowledgePacket(packet, ack) + return err } return fmt.Errorf("packet commitment does not exist on either endpoint for provided packet") diff --git a/tests/difference/core/driver/common.go b/tests/difference/core/driver/common.go index 7a896a04f3..b05b794203 100644 --- a/tests/difference/core/driver/common.go +++ b/tests/difference/core/driver/common.go @@ -10,8 +10,10 @@ import ( tmtypes "github.com/tendermint/tendermint/types" ) -const P = "provider" -const C = "consumer" +const ( + P = "provider" + C = "consumer" +) // ValStates represents the total delegation // and bond status of a validator @@ -52,7 +54,8 @@ func init() { "bbaaaababaabbaabababbaabbbbbbaaa", "abbbababbbabaaaaabaaabbbbababaab", "bbabaabaabbbbbabbbaababbbbabbbbb", - "aabbbabaaaaababbbabaabaabbbbbbba"}, + "aabbbabaaaaababbbabaabaabbbbbbba", + }, NumValidators: 4, MaxValidators: 2, InitialDelegatorTokens: 10000000000000, @@ -67,8 +70,10 @@ func init() { Delegation: []int{4000, 3000, 2000, 1000}, Tokens: []int{5000, 4000, 3000, 2000}, ValidatorExtraTokens: []int{1000, 1000, 1000, 1000}, - Status: []stakingtypes.BondStatus{stakingtypes.Bonded, stakingtypes.Bonded, - stakingtypes.Unbonded, stakingtypes.Unbonded}, + Status: []stakingtypes.BondStatus{ + stakingtypes.Bonded, stakingtypes.Bonded, + stakingtypes.Unbonded, stakingtypes.Unbonded, + }, }, MaxEntries: 1000000, ConsensusParams: &abci.ConsensusParams{ diff --git a/tests/difference/core/driver/core_test.go b/tests/difference/core/driver/core_test.go index fe5bbb51e4..2dc203f8ba 100644 --- a/tests/difference/core/driver/core_test.go +++ b/tests/difference/core/driver/core_test.go @@ -48,7 +48,7 @@ func (s *CoreSuite) ctx(chain string) sdk.Context { return s.chain(chain).GetContext() } -func (s *CoreSuite) chainID(chain string) string { +func (*CoreSuite) chainID(chain string) string { return map[string]string{P: ibctesting.GetChainID(0), C: ibctesting.GetChainID(1)}[chain] } @@ -65,16 +65,16 @@ func (s *CoreSuite) consumerChain() *ibctesting.TestChain { return s.simibc.Chain(ibctesting.GetChainID(1)) } -func (b *CoreSuite) providerStakingKeeper() stakingkeeper.Keeper { - return b.providerChain().App.(*appProvider.App).StakingKeeper +func (s *CoreSuite) providerStakingKeeper() stakingkeeper.Keeper { + return s.providerChain().App.(*appProvider.App).StakingKeeper } -func (b *CoreSuite) providerSlashingKeeper() slashingkeeper.Keeper { - return b.providerChain().App.(*appProvider.App).SlashingKeeper +func (s *CoreSuite) providerSlashingKeeper() slashingkeeper.Keeper { + return s.providerChain().App.(*appProvider.App).SlashingKeeper } -func (b *CoreSuite) consumerKeeper() consumerkeeper.Keeper { - return b.consumerChain().App.(*appConsumer.App).ConsumerKeeper +func (s *CoreSuite) consumerKeeper() consumerkeeper.Keeper { + return s.consumerChain().App.(*appConsumer.App).ConsumerKeeper } // height returns the height of the current header of chain @@ -83,7 +83,7 @@ func (s *CoreSuite) height(chain string) int64 { } // time returns the time of the current header of chain -func (s *CoreSuite) time(chain string) time.Time { +func (s *CoreSuite) timechain(chain string) time.Time { return s.chain(chain).CurrentHeader.Time } @@ -151,7 +151,7 @@ func (s *CoreSuite) delegatorBalance() int64 { } // delegate delegates amt tokens to validator val -func (s *CoreSuite) delegate(val int64, amt int64) { +func (s *CoreSuite) delegate(val, amt int64) { server := stakingkeeper.NewMsgServerImpl(s.providerStakingKeeper()) coin := sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(amt)) d := s.delegator() @@ -163,7 +163,7 @@ func (s *CoreSuite) delegate(val int64, amt int64) { } // undelegate undelegates amt tokens from validator val -func (s *CoreSuite) undelegate(val int64, amt int64) { +func (s *CoreSuite) undelegate(val, amt int64) { server := stakingkeeper.NewMsgServerImpl(s.providerStakingKeeper()) coin := sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(amt)) d := s.delegator() @@ -218,7 +218,6 @@ func (s *CoreSuite) endAndBeginBlock(chain string) { // compareModelAndSystemState compares the state in the SUT to the state in the // the model. func (s *CoreSuite) compareModelAndSystemState() { - // Get a diagnostic for debugging diagnostic := s.traces.Diagnostic() chain := s.traces.Action().Chain @@ -228,7 +227,7 @@ func (s *CoreSuite) compareModelAndSystemState() { modelTimeOffset := time.Duration(s.traces.Time()) * time.Second sutHeightOffset := s.offsetHeight - 1 modelHeightOffset := int64(s.traces.Height()) - s.Require().Equalf(sutTimeOffset.Add(modelTimeOffset), s.time(chain), diagnostic+"%s Time mismatch", chain) + s.Require().Equalf(sutTimeOffset.Add(modelTimeOffset), s.timechain(chain), diagnostic+"%s Time mismatch", chain) s.Require().Equalf(sutHeightOffset+modelHeightOffset, s.height(chain), diagnostic+"%s Time mismatch", chain) if chain == P { for j := 0; j < s.initState.NumValidators; j++ { @@ -260,7 +259,6 @@ func (s *CoreSuite) compareModelAndSystemState() { } func (s *CoreSuite) executeTrace() { - for i := range s.traces.Actions() { s.traces.CurrentActionIx = i @@ -331,7 +329,6 @@ func (s *CoreSuite) TestTraces() { } } fmt.Println("Shortest [traceIx, actionIx]:", shortest, shortestLen) - } func TestCoreSuite(t *testing.T) { diff --git a/tests/difference/core/driver/seed_gen_fuzzy_test.go b/tests/difference/core/driver/seed_gen_fuzzy_test.go index 592f20da76..9f4869fd55 100644 --- a/tests/difference/core/driver/seed_gen_fuzzy_test.go +++ b/tests/difference/core/driver/seed_gen_fuzzy_test.go @@ -14,8 +14,7 @@ import ( ) func GetPV(seed []byte) mock.PV { - //lint:ignore SA1019 We don't care because this is only a test. - return mock.PV{PrivKey: &cosmosEd25519.PrivKey{Key: cryptoEd25519.NewKeyFromSeed(seed)}} + return mock.PV{PrivKey: &cosmosEd25519.PrivKey{Key: cryptoEd25519.NewKeyFromSeed(seed)}} //nolint:staticcheck // SA1019: crypto/ed25519 is deprecated: Use golang.org/x/crypto/ed25519 instead. (staticcheck) } // getStakingKeyBytes takes seed bytes which can be be used to create @@ -26,9 +25,9 @@ func getStakingKeyBytes(bz []byte) []byte { pubKey, _ := pv.GetPubKey() val := tmtypes.NewValidator(pubKey, 0) addr, _ := sdk.ValAddressFromHex(val.Address.String()) - PK := pv.PrivKey.PubKey() + pk := pv.PrivKey.PubKey() valAddr, _ := sdk.ValAddressFromBech32(addr.String()) - validator, _ := stakingtypes.NewValidator(valAddr, PK, stakingtypes.Description{}) + validator, _ := stakingtypes.NewValidator(valAddr, pk, stakingtypes.Description{}) key := stakingtypes.GetValidatorsByPowerIndexKey(validator, sdk.DefaultPowerReduction) return key } diff --git a/tests/difference/core/driver/setup.go b/tests/difference/core/driver/setup.go index 9c917a5ce8..a159343cf3 100644 --- a/tests/difference/core/driver/setup.go +++ b/tests/difference/core/driver/setup.go @@ -34,7 +34,7 @@ import ( stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" appConsumer "github.com/cosmos/interchain-security/app/consumer" appProvider "github.com/cosmos/interchain-security/app/provider" - icstestingutils "github.com/cosmos/interchain-security/testutil/ibc_testing" + icstestingutils "github.com/cosmos/interchain-security/testutil/ibctesting" simibc "github.com/cosmos/interchain-security/testutil/simibc" consumerkeeper "github.com/cosmos/interchain-security/x/ccv/consumer/keeper" consumertypes "github.com/cosmos/interchain-security/x/ccv/consumer/types" @@ -102,16 +102,15 @@ func (b *Builder) consAddr(i int64) sdk.ConsAddress { // getValidatorPK returns the validator private key using the given seed index func (b *Builder) getValidatorPK(seedIx int) mock.PV { seed := []byte(b.initState.PKSeeds[seedIx]) - return mock.PV{PrivKey: &cosmosEd25519.PrivKey{Key: cryptoEd25519.NewKeyFromSeed(seed)}} + return mock.PV{PrivKey: &cosmosEd25519.PrivKey{Key: cryptoEd25519.NewKeyFromSeed(seed)}} //nolint:staticcheck // SA1019: crypto/ed25519 is deprecated } func (b *Builder) getAppBytesAndSenders( - chainID string, - app ibctesting.TestingApp, + _ string, + app ibctesting.AppTest, genesis map[string]json.RawMessage, validators *tmtypes.ValidatorSet, ) ([]byte, []ibctesting.SenderAccount) { - accounts := []authtypes.GenesisAccount{} balances := []banktypes.Balance{} senderAccounts := []ibctesting.SenderAccount{} @@ -234,7 +233,6 @@ func (b *Builder) getAppBytesAndSenders( require.NoError(b.suite.T(), err) return stateBytes, senderAccounts - } func (b *Builder) newChain( @@ -244,7 +242,6 @@ func (b *Builder) newChain( validators *tmtypes.ValidatorSet, signers map[string]tmtypes.PrivValidator, ) *ibctesting.TestChain { - app, genesis := appInit() stateBytes, senderAccounts := b.getAppBytesAndSenders(chainID, app, genesis, validators) @@ -328,7 +325,6 @@ func (b *Builder) createValidators() (*tmtypes.ValidatorSet, map[string]tmtypes. } func (b *Builder) createProviderAndConsumer() { - coordinator := ibctesting.NewCoordinator(b.suite.T(), 0) // Create validators @@ -340,7 +336,6 @@ func (b *Builder) createProviderAndConsumer() { b.coordinator = coordinator b.valAddresses = addresses - } // setSigningInfos sets the validator signing info in the provider Slashing module @@ -361,8 +356,7 @@ func (b *Builder) setSigningInfos() { // Checks that the lexicographic ordering of validator addresses as computed in // the staking module match the ordering of validators in the model. func (b *Builder) ensureValidatorLexicographicOrderingMatchesModel() { - - check := func(lesser sdk.ValAddress, greater sdk.ValAddress) { + check := func(lesser, greater sdk.ValAddress) { lesserV, _ := b.providerStakingKeeper().GetValidator(b.providerCtx(), lesser) greaterV, _ := b.providerStakingKeeper().GetValidator(b.providerCtx(), greater) lesserKey := stakingtypes.GetValidatorsByPowerIndexKey(lesserV, sdk.DefaultPowerReduction) @@ -426,7 +420,6 @@ func (b *Builder) addValidatorToStakingModule(privVal mock.PV) { } func (b *Builder) addExtraProviderValidators() { - for i, status := range b.initState.ValStates.Status { if status == stakingtypes.Unbonded { privVal := b.getValidatorPK(i) @@ -490,7 +483,7 @@ func (b *Builder) createProvidersLocalClient() { err := b.providerEndpoint().CreateClient() b.suite.Require().NoError(err) // Create the Consumer chain ID mapping in the provider state - b.providerKeeper().SetConsumerClientId(b.providerCtx(), b.consumer().ChainID, b.providerEndpoint().ClientID) + b.providerKeeper().SetConsumerClientID(b.providerCtx(), b.consumer().ChainID, b.providerEndpoint().ClientID) } func (b *Builder) createConsumersLocalClientGenesis() *ibctmtypes.ClientState { @@ -529,10 +522,10 @@ func (b *Builder) createConsumerGenesis(client *ibctmtypes.ClientState) *consume // state does not necessarily mimic the order of steps that happen in a // live scenario. func GetZeroState( - suite *suite.Suite, + s *suite.Suite, initState InitState, -) (path *ibctesting.Path, addrs []sdk.ValAddress, heightLastCommitted int64, timeLastCommitted int64) { - b := Builder{initState: initState, suite: suite} +) (path *ibctesting.Path, addrs []sdk.ValAddress, heightLastCommitted, timeLastCommitted int64) { + b := Builder{initState: initState, suite: s} b.createProviderAndConsumer() diff --git a/tests/difference/core/driver/setup_test.go b/tests/difference/core/driver/setup_test.go index a18984c7f5..84b1dc8f2e 100644 --- a/tests/difference/core/driver/setup_test.go +++ b/tests/difference/core/driver/setup_test.go @@ -11,15 +11,14 @@ import ( // driver hold. This test therefore does not test the system, but only that // the driver is correctly setup. func (s *CoreSuite) TestAssumptionsSetup() { - - const FAIL_MSG = "Assumptions for core diff test failed: there is a problem with the driver or how the test is setup." + const failMsg = "Assumptions for core diff test failed: there is a problem with the driver or how the test is setup." // Staking module maxValidators param is correct maxValsE := uint32(s.initState.MaxValidators) maxVals := s.providerStakingKeeper().GetParams(s.ctx(P)).MaxValidators if maxValsE != maxVals { - s.T().Fatal(FAIL_MSG) + s.T().Fatal(failMsg) } // TODO: Write a check to make sure that the slash throttle params are set correctly. @@ -45,48 +44,48 @@ func (s *CoreSuite) TestAssumptionsSetup() { for i := 0; i < len(s.initState.ValStates.Tokens); i++ { _, found := s.providerSlashingKeeper().GetValidatorSigningInfo(s.ctx(P), s.consAddr(int64(i))) if !found { - s.Require().FailNow(FAIL_MSG) + s.Require().FailNow(failMsg) } } // Provider delegations are correct for i := 0; i < len(s.initState.ValStates.Delegation); i++ { - E := int64(s.initState.ValStates.Delegation[i]) - A := s.delegation(int64(i)) - if E != A { - s.T().Fatal(FAIL_MSG) + e := int64(s.initState.ValStates.Delegation[i]) + a := s.delegation(int64(i)) + if e != a { + s.T().Fatal(failMsg) } } // Provider validator tokens are correct for i := 0; i < len(s.initState.ValStates.Tokens); i++ { - E := int64(s.initState.ValStates.Tokens[i]) - A := s.providerTokens(int64(i)) - if E != A { - s.T().Fatal(FAIL_MSG) + e := int64(s.initState.ValStates.Tokens[i]) + a := s.providerTokens(int64(i)) + if e != a { + s.T().Fatal(failMsg) } } // Provider validator status is correct for i := 0; i < len(s.initState.ValStates.Status); i++ { - E := s.initState.ValStates.Status[i] - A := s.validatorStatus(int64(i)) - if E != A { - s.T().Fatal(FAIL_MSG) + e := s.initState.ValStates.Status[i] + a := s.validatorStatus(int64(i)) + if e != a { + s.T().Fatal(failMsg) } } // Staking module does not contain undelegations s.providerStakingKeeper().IterateUnbondingDelegations(s.ctx(P), func(index int64, ubd stakingtypes.UnbondingDelegation) bool { - s.T().Fatal(FAIL_MSG) + s.T().Fatal(failMsg) return false // Don't stop }) // Staking module does contain redelegations s.providerStakingKeeper().IterateRedelegations(s.ctx(P), func(index int64, ubd stakingtypes.Redelegation) bool { - s.T().Fatal(FAIL_MSG) + s.T().Fatal(failMsg) return false // Don't stop }) @@ -96,7 +95,7 @@ func (s *CoreSuite) TestAssumptionsSetup() { unbondingValIterator := s.providerStakingKeeper().ValidatorQueueIterator(s.ctx(P), endTime, endHeight) defer unbondingValIterator.Close() for ; unbondingValIterator.Valid(); unbondingValIterator.Next() { - s.T().Fatal(FAIL_MSG) + s.T().Fatal(failMsg) } // Consumer has no pending data packets @@ -104,7 +103,7 @@ func (s *CoreSuite) TestAssumptionsSetup() { // Consumer has no maturities for range s.consumerKeeper().GetAllPacketMaturityTimes(s.ctx(C)) { - s.T().Fatal(FAIL_MSG) + s.T().Fatal(failMsg) } // Consumer power @@ -116,7 +115,7 @@ func (s *CoreSuite) TestAssumptionsSetup() { s.Require().Equal(expectFound, found) if expectFound { if int64(expectPower) != val.Power { - s.T().Fatal(FAIL_MSG) + s.T().Fatal(failMsg) } } } @@ -124,8 +123,8 @@ func (s *CoreSuite) TestAssumptionsSetup() { // The offset time is the last committed time, but the SUT is +1 block ahead // because the currentHeader time is ahead of the last committed. Therefore sub // the difference (duration of 1 block). - s.Require().Equal(int64(s.offsetTimeUnix), s.time(P).Add(-s.initState.BlockInterval).Unix()) - s.Require().Equal(int64(s.offsetTimeUnix), s.time(C).Add(-s.initState.BlockInterval).Unix()) + s.Require().Equal(s.offsetTimeUnix, s.timechain(P).Add(-s.initState.BlockInterval).Unix()) + s.Require().Equal(s.offsetTimeUnix, s.timechain(C).Add(-s.initState.BlockInterval).Unix()) // The offset height is the last committed height, but the SUT is +1 because // the currentHeader is +1 ahead of the last committed. Therefore sub 1. diff --git a/tests/difference/core/driver/trace.go b/tests/difference/core/driver/trace.go index c57df2bf64..203a2adace 100644 --- a/tests/difference/core/driver/trace.go +++ b/tests/difference/core/driver/trace.go @@ -67,10 +67,8 @@ type TraceData struct { } func LoadTraces(fn string) []TraceData { - /* #nosec */ fd, err := os.Open(fn) - if err != nil { panic(err) } @@ -82,7 +80,7 @@ func LoadTraces(fn string) []TraceData { var ret []TraceData - err = json.Unmarshal([]byte(byteValue), &ret) + err = json.Unmarshal(byteValue, &ret) if err != nil { panic(err) @@ -111,6 +109,7 @@ func (t *Traces) Diagnostic() string { func (t *Traces) Trace() TraceData { return t.Data[t.CurrentTraceIx] } + func (t *Traces) Actions() []ActionAndPartialState { return t.Trace().Actions } diff --git a/tests/e2e/channel_init.go b/tests/e2e/channel_init.go index 8cfc6c0100..a4cc7a2bfe 100644 --- a/tests/e2e/channel_init.go +++ b/tests/e2e/channel_init.go @@ -1,7 +1,7 @@ package e2e // TestInitTimeout tests the init timeout -func (suite *CCVTestSuite) TestInitTimeout() { +func (s *CCVTestSuite) TestInitTimeout() { testCases := []struct { name string handshake func() @@ -13,84 +13,84 @@ func (suite *CCVTestSuite) TestInitTimeout() { { "init times out before TRY", func() { // send ChanOpenInit - err := suite.path.EndpointA.ChanOpenInit() - suite.Require().NoError(err) + err := s.path.EndpointA.ChanOpenInit() + s.Require().NoError(err) }, true, }, { "init times out before ACK", func() { // send ChanOpenInit - err := suite.path.EndpointA.ChanOpenInit() - suite.Require().NoError(err) + err := s.path.EndpointA.ChanOpenInit() + s.Require().NoError(err) // send ChanOpenTry - err = suite.path.EndpointB.ChanOpenTry() - suite.Require().NoError(err) + err = s.path.EndpointB.ChanOpenTry() + s.Require().NoError(err) }, true, }, { "init times out before CONFIRM", func() { // send ChanOpenInit - err := suite.path.EndpointA.ChanOpenInit() - suite.Require().NoError(err) + err := s.path.EndpointA.ChanOpenInit() + s.Require().NoError(err) // send ChanOpenTry - err = suite.path.EndpointB.ChanOpenTry() - suite.Require().NoError(err) + err = s.path.EndpointB.ChanOpenTry() + s.Require().NoError(err) // send ChanOpenAck - err = suite.path.EndpointA.ChanOpenAck() - suite.Require().NoError(err) + err = s.path.EndpointA.ChanOpenAck() + s.Require().NoError(err) }, true, }, { "init completes before timeout", func() { // send ChanOpenInit - err := suite.path.EndpointA.ChanOpenInit() - suite.Require().NoError(err) + err := s.path.EndpointA.ChanOpenInit() + s.Require().NoError(err) // send ChanOpenTry - err = suite.path.EndpointB.ChanOpenTry() - suite.Require().NoError(err) + err = s.path.EndpointB.ChanOpenTry() + s.Require().NoError(err) // send ChanOpenAck - err = suite.path.EndpointA.ChanOpenAck() - suite.Require().NoError(err) + err = s.path.EndpointA.ChanOpenAck() + s.Require().NoError(err) // send ChanOpenConfirm - err = suite.path.EndpointB.ChanOpenConfirm() - suite.Require().NoError(err) + err = s.path.EndpointB.ChanOpenConfirm() + s.Require().NoError(err) }, false, }, } for i, tc := range testCases { - providerKeeper := suite.providerApp.GetProviderKeeper() - initTimeout := providerKeeper.GetParams(suite.providerCtx()).InitTimeoutPeriod - chainID := suite.consumerChain.ChainID + providerKeeper := s.providerApp.GetProviderKeeper() + initTimeout := providerKeeper.GetParams(s.providerCtx()).InitTimeoutPeriod + chainID := s.consumerChain.ChainID // check that the init timeout timestamp is set - _, found := providerKeeper.GetInitTimeoutTimestamp(suite.providerCtx(), chainID) - suite.Require().True(found, "cannot find init timeout timestamp; test: %s", tc.name) + _, found := providerKeeper.GetInitTimeoutTimestamp(s.providerCtx(), chainID) + s.Require().True(found, "cannot find init timeout timestamp; test: %s", tc.name) // create connection - suite.coordinator.CreateConnections(suite.path) + s.coordinator.CreateConnections(s.path) // channel opening handshake tc.handshake() // call NextBlock - suite.providerChain.NextBlock() + s.providerChain.NextBlock() // increment time - incrementTime(suite, initTimeout) + incrementTime(s, initTimeout) // check whether the chain was removed - _, found = providerKeeper.GetConsumerClientId(suite.providerCtx(), chainID) - suite.Require().Equal(!tc.removed, found, "unexpected outcome; test: %s", tc.name) + _, found = providerKeeper.GetConsumerClientID(s.providerCtx(), chainID) + s.Require().Equal(!tc.removed, found, "unexpected outcome; test: %s", tc.name) if tc.removed { // check if the chain was properly removed - suite.checkConsumerChainIsRemoved(chainID, false) + s.checkConsumerChainIsRemoved(chainID, false) } if i+1 < len(testCases) { // reset suite to reset provider client - suite.SetupTest() + s.SetupTest() } } } diff --git a/tests/e2e/common.go b/tests/e2e/common.go index 5e2390b887..237de4f73e 100644 --- a/tests/e2e/common.go +++ b/tests/e2e/common.go @@ -15,7 +15,7 @@ import ( ibctm "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types" ibctesting "github.com/cosmos/interchain-security/legacy_ibc_testing/testing" "github.com/cosmos/interchain-security/testutil/e2e" - icstestingutils "github.com/cosmos/interchain-security/testutil/ibc_testing" + icstestingutils "github.com/cosmos/interchain-security/testutil/ibctesting" providertypes "github.com/cosmos/interchain-security/x/ccv/provider/types" ccv "github.com/cosmos/interchain-security/x/ccv/types" "github.com/stretchr/testify/require" @@ -61,7 +61,7 @@ func (s *CCVTestSuite) getValByIdx(index int) (validator stakingtypes.Validator, return s.getVal(s.providerCtx(), valAddr), valAddr } -func (s *CCVTestSuite) getVal(ctx sdk.Context, valAddr sdk.ValAddress) stakingtypes.Validator { +func (s *CCVTestSuite) getVal(_ sdk.Context, valAddr sdk.ValAddress) stakingtypes.Validator { validator, found := s.providerApp.GetE2eStakingKeeper().GetValidator(s.providerCtx(), valAddr) s.Require().True(found) return validator @@ -90,7 +90,7 @@ func getBalance(s *CCVTestSuite, providerCtx sdk.Context, delAddr sdk.AccAddress // delegateAndUndelegate delegates bondAmt from delAddr to the first validator // and then immediately undelegates 1/shareDiv of that delegation -func delegateAndUndelegate(s *CCVTestSuite, delAddr sdk.AccAddress, bondAmt sdk.Int, shareDiv int64) (initBalance sdk.Int, valsetUpdateId uint64) { +func delegateAndUndelegate(s *CCVTestSuite, delAddr sdk.AccAddress, bondAmt sdk.Int, shareDiv int64) (initBalance sdk.Int, valsetUpdateID uint64) { // delegate initBalance, shares, valAddr := delegate(s, delAddr, bondAmt) @@ -98,12 +98,12 @@ func delegateAndUndelegate(s *CCVTestSuite, delAddr sdk.AccAddress, bondAmt sdk. s.Require().True(getBalance(s, s.providerCtx(), delAddr).Equal(initBalance.Sub(bondAmt))) // undelegate 1/shareDiv - valsetUpdateId = undelegate(s, delAddr, valAddr, shares.QuoInt64(shareDiv)) + valsetUpdateID = undelegate(s, delAddr, valAddr, shares.QuoInt64(shareDiv)) // check that the tokens have not been returned yet s.Require().True(getBalance(s, s.providerCtx(), delAddr).Equal(initBalance.Sub(bondAmt))) - return initBalance, valsetUpdateId + return initBalance, valsetUpdateID } // Delegates "amount" to a source validator, then redelegates that same amount to a dest validator, @@ -112,8 +112,8 @@ func delegateAndUndelegate(s *CCVTestSuite, delAddr sdk.AccAddress, bondAmt sdk. // Note: This function advances blocks in-between operations, where validator powers are // not checked, since they are checked in integration tests. func delegateAndRedelegate(s *CCVTestSuite, delAddr sdk.AccAddress, - srcValAddr sdk.ValAddress, dstValAddr sdk.ValAddress, amount sdk.Int) { - + srcValAddr, dstValAddr sdk.ValAddress, amount sdk.Int, +) { // Delegate to src validator srcValTokensBefore := s.getVal(s.providerCtx(), srcValAddr).GetBondedTokens() _, sharesDelegated, _ := delegate(s, delAddr, amount) @@ -157,7 +157,7 @@ func delegateByIdx(s *CCVTestSuite, delAddr sdk.AccAddress, bondAmt sdk.Int, idx delAddr, bondAmt, stakingtypes.Unbonded, - stakingtypes.Validator(validator), + validator, true, ) s.Require().NoError(err) @@ -167,12 +167,12 @@ func delegateByIdx(s *CCVTestSuite, delAddr sdk.AccAddress, bondAmt sdk.Int, idx } // undelegate unbonds an amount of delegator shares from a given validator -func undelegate(s *CCVTestSuite, delAddr sdk.AccAddress, valAddr sdk.ValAddress, sharesAmount sdk.Dec) (valsetUpdateId uint64) { +func undelegate(s *CCVTestSuite, delAddr sdk.AccAddress, valAddr sdk.ValAddress, sharesAmount sdk.Dec) (valsetUpdate uint64) { _, err := s.providerApp.GetE2eStakingKeeper().Undelegate(s.providerCtx(), delAddr, valAddr, sharesAmount) s.Require().NoError(err) // save the current valset update ID - valsetUpdateID := s.providerApp.GetProviderKeeper().GetValidatorSetUpdateId(s.providerCtx()) + valsetUpdateID := s.providerApp.GetProviderKeeper().GetValidatorSetUpdateID(s.providerCtx()) return valsetUpdateID } @@ -180,8 +180,8 @@ func undelegate(s *CCVTestSuite, delAddr sdk.AccAddress, valAddr sdk.ValAddress, // Executes a BeginRedelegation (unbonding and redelegation) operation // on the provider chain using delegated funds from delAddr func redelegate(s *CCVTestSuite, delAddr sdk.AccAddress, valSrcAddr sdk.ValAddress, - ValDstAddr sdk.ValAddress, sharesAmount sdk.Dec) { - + valDstAddr sdk.ValAddress, sharesAmount sdk.Dec, +) { stakingKeeper := s.providerApp.GetE2eStakingKeeper() ctx := s.providerCtx() @@ -190,7 +190,7 @@ func redelegate(s *CCVTestSuite, delAddr sdk.AccAddress, valSrcAddr sdk.ValAddre ctx, delAddr, valSrcAddr, - ValDstAddr, + valDstAddr, sharesAmount, ) s.Require().NoError(err) @@ -234,7 +234,7 @@ func relayAllCommittedPackets( srcPortID string, srcChannelID string, expectedPackets int, - msgAndArgs ...interface{}, + msgAndArgs ...any, ) { // check that the packets are committed in state commitments := srcChain.App.GetIBCKeeper().ChannelKeeper.GetAllPacketCommitmentsAtChannel( @@ -284,7 +284,7 @@ func incrementTimeByUnbondingPeriod(s *CCVTestSuite, chainType ChainType) { incrementTime(s, jumpPeriod) } -func checkStakingUnbondingOps(s *CCVTestSuite, id uint64, found bool, onHold bool, msgAndArgs ...interface{}) { +func checkStakingUnbondingOps(s *CCVTestSuite, id uint64, found, onHold bool, msgAndArgs ...any) { stakingUnbondingOp, wasFound := getStakingUnbondingDelegationEntry(s.providerCtx(), s.providerApp.GetE2eStakingKeeper(), id) s.Require().Equal( found, @@ -299,7 +299,7 @@ func checkStakingUnbondingOps(s *CCVTestSuite, id uint64, found bool, onHold boo } } -func checkCCVUnbondingOp(s *CCVTestSuite, providerCtx sdk.Context, chainID string, valUpdateID uint64, found bool, msgAndArgs ...interface{}) { +func checkCCVUnbondingOp(s *CCVTestSuite, providerCtx sdk.Context, chainID string, valUpdateID uint64, found bool, msgAndArgs ...any) { entries := s.providerApp.GetProviderKeeper().GetUnbondingOpsFromIndex(providerCtx, chainID, valUpdateID) if found { s.Require().NotEmpty(entries, fmt.Sprintf("checkCCVUnbondingOp failed - should not be empty; %s", msgAndArgs...)) @@ -324,8 +324,8 @@ func checkCCVUnbondingOp(s *CCVTestSuite, providerCtx sdk.Context, chainID strin // Checks that an expected amount of redelegations exist for a delegator // via the staking keeper, then returns those redelegations. func checkRedelegations(s *CCVTestSuite, delAddr sdk.AccAddress, - expect uint16) []stakingtypes.Redelegation { - + expect uint16, +) []stakingtypes.Redelegation { redelegations := s.providerApp.GetE2eStakingKeeper().GetRedelegations(s.providerCtx(), delAddr, 2) s.Require().Len(redelegations, int(expect)) @@ -334,11 +334,12 @@ func checkRedelegations(s *CCVTestSuite, delAddr sdk.AccAddress, // Checks that a redelegation entry has a completion time equal to an expected time func checkRedelegationEntryCompletionTime( - s *CCVTestSuite, entry stakingtypes.RedelegationEntry, expectedCompletion time.Time) { + s *CCVTestSuite, entry stakingtypes.RedelegationEntry, expectedCompletion time.Time, +) { s.Require().Equal(expectedCompletion, entry.CompletionTime) } -func getStakingUnbondingDelegationEntry(ctx sdk.Context, k e2e.E2eStakingKeeper, id uint64) (stakingUnbondingOp stakingtypes.UnbondingDelegationEntry, found bool) { +func getStakingUnbondingDelegationEntry(ctx sdk.Context, k e2e.StakingKeeper, id uint64) (stakingUnbondingOp stakingtypes.UnbondingDelegationEntry, found bool) { stakingUbd, found := k.GetUnbondingDelegationByUnbondingID(ctx, id) for _, entry := range stakingUbd.Entries { @@ -354,13 +355,13 @@ func getStakingUnbondingDelegationEntry(ctx sdk.Context, k e2e.E2eStakingKeeper, // SendEmptyVSCPacket sends a VSC packet without any changes // to ensure that the channel gets established -func (suite *CCVTestSuite) SendEmptyVSCPacket() { - providerKeeper := suite.providerApp.GetProviderKeeper() +func (s *CCVTestSuite) SendEmptyVSCPacket() { + providerKeeper := s.providerApp.GetProviderKeeper() - oldBlockTime := suite.providerChain.GetContext().BlockTime() + oldBlockTime := s.providerChain.GetContext().BlockTime() timeout := uint64(oldBlockTime.Add(ccv.DefaultCCVTimeoutPeriod).UnixNano()) - valUpdateID := providerKeeper.GetValidatorSetUpdateId(suite.providerChain.GetContext()) + valUpdateID := providerKeeper.GetValidatorSetUpdateID(s.providerChain.GetContext()) pd := ccv.NewValidatorSetChangePacketData( []abci.ValidatorUpdate{}, @@ -368,20 +369,19 @@ func (suite *CCVTestSuite) SendEmptyVSCPacket() { nil, ) - seq, ok := suite.providerApp.GetIBCKeeper().ChannelKeeper.GetNextSequenceSend( - suite.providerChain.GetContext(), ccv.ProviderPortID, suite.path.EndpointB.ChannelID) - suite.Require().True(ok) + seq, ok := s.providerApp.GetIBCKeeper().ChannelKeeper.GetNextSequenceSend( + s.providerChain.GetContext(), ccv.ProviderPortID, s.path.EndpointB.ChannelID) + s.Require().True(ok) - packet := channeltypes.NewPacket(pd.GetBytes(), seq, ccv.ProviderPortID, suite.path.EndpointB.ChannelID, - ccv.ConsumerPortID, suite.path.EndpointA.ChannelID, clienttypes.Height{}, timeout) + packet := channeltypes.NewPacket(pd.GetBytes(), seq, ccv.ProviderPortID, s.path.EndpointB.ChannelID, + ccv.ConsumerPortID, s.path.EndpointA.ChannelID, clienttypes.Height{}, timeout) - sendOnProviderRecvOnConsumer(suite, suite.getFirstBundle().Path, packet) + sendOnProviderRecvOnConsumer(s, s.getFirstBundle().Path, packet) } // commitSlashPacket returns a commit hash for the given slash packet data // Note that it must be called before sending the embedding IBC packet. -func (suite *CCVTestSuite) commitSlashPacket(ctx sdk.Context, packetData ccv.SlashPacketData) []byte { - +func (s *CCVTestSuite) commitSlashPacket(ctx sdk.Context, packetData ccv.SlashPacketData) []byte { consumerPacket := ccv.ConsumerPacketData{ Type: ccv.SlashPacket, Data: &ccv.ConsumerPacketData_SlashPacketData{ @@ -389,27 +389,27 @@ func (suite *CCVTestSuite) commitSlashPacket(ctx sdk.Context, packetData ccv.Sla }, } - return suite.commitConsumerPacket(ctx, consumerPacket) + return s.commitConsumerPacket(ctx, consumerPacket) } // commitConsumerPacket returns a commit hash for the given consumer packet data // Note that it must be called before sending the embedding IBC packet. -func (suite *CCVTestSuite) commitConsumerPacket(ctx sdk.Context, packetData ccv.ConsumerPacketData) []byte { +func (s *CCVTestSuite) commitConsumerPacket(ctx sdk.Context, packetData ccv.ConsumerPacketData) []byte { oldBlockTime := ctx.BlockTime() timeout := uint64(oldBlockTime.Add(ccv.DefaultCCVTimeoutPeriod).UnixNano()) - packet := channeltypes.NewPacket(packetData.GetBytes(), 1, ccv.ConsumerPortID, suite.path.EndpointA.ChannelID, - ccv.ProviderPortID, suite.path.EndpointB.ChannelID, clienttypes.Height{}, timeout) + packet := channeltypes.NewPacket(packetData.GetBytes(), 1, ccv.ConsumerPortID, s.path.EndpointA.ChannelID, + ccv.ProviderPortID, s.path.EndpointB.ChannelID, clienttypes.Height{}, timeout) - return channeltypes.CommitPacket(suite.consumerChain.App.AppCodec(), packet) + return channeltypes.CommitPacket(s.consumerChain.App.AppCodec(), packet) } // constructSlashPacketFromConsumer constructs an IBC packet embedding // slash packet data to be sent from consumer to provider -func (s *CCVTestSuite) constructSlashPacketFromConsumer(bundle icstestingutils.ConsumerBundle, - tmVal tmtypes.Validator, infractionType stakingtypes.InfractionType, ibcSeqNum uint64) channeltypes.Packet { - - valsetUpdateId := bundle.GetKeeper().GetHeightValsetUpdateID( +func (*CCVTestSuite) constructSlashPacketFromConsumer(bundle icstestingutils.ConsumerBundle, + tmVal tmtypes.Validator, infractionType stakingtypes.InfractionType, ibcSeqNum uint64, +) channeltypes.Packet { + valsetUpdateID := bundle.GetKeeper().GetHeightValsetUpdateID( bundle.GetCtx(), uint64(bundle.GetCtx().BlockHeight())) data := ccv.ConsumerPacketData{ @@ -420,7 +420,7 @@ func (s *CCVTestSuite) constructSlashPacketFromConsumer(bundle icstestingutils.C Address: tmVal.Address, Power: tmVal.VotingPower, }, - ValsetUpdateId: valsetUpdateId, + ValsetUpdateId: valsetUpdateID, Infraction: infractionType, }, }, @@ -439,16 +439,16 @@ func (s *CCVTestSuite) constructSlashPacketFromConsumer(bundle icstestingutils.C // constructVSCMaturedPacketFromConsumer constructs an IBC packet embedding // VSC Matured packet data to be sent from consumer to provider -func (s *CCVTestSuite) constructVSCMaturedPacketFromConsumer(bundle icstestingutils.ConsumerBundle, - ibcSeqNum uint64) channeltypes.Packet { - - valsetUpdateId := bundle.GetKeeper().GetHeightValsetUpdateID( +func (*CCVTestSuite) constructVSCMaturedPacketFromConsumer(bundle icstestingutils.ConsumerBundle, + ibcSeqNum uint64, +) channeltypes.Packet { + valsetUpdateID := bundle.GetKeeper().GetHeightValsetUpdateID( bundle.GetCtx(), uint64(bundle.GetCtx().BlockHeight())) data := ccv.ConsumerPacketData{ Type: ccv.VscMaturedPacket, Data: &ccv.ConsumerPacketData_VscMaturedPacketData{ - VscMaturedPacketData: &ccv.VSCMaturedPacketData{ValsetUpdateId: valsetUpdateId}, + VscMaturedPacketData: &ccv.VSCMaturedPacketData{ValsetUpdateId: valsetUpdateID}, }, } @@ -538,11 +538,11 @@ func incrementTimeWithoutUpdate(s *CCVTestSuite, jumpPeriod time.Duration, noUpd // using the given unbonding period. // It will update the clientID for the endpoint if the message // is successfully executed. -func (suite *CCVTestSuite) CreateCustomClient(endpoint *ibctesting.Endpoint, unbondingPeriod time.Duration) { +func (s *CCVTestSuite) CreateCustomClient(endpoint *ibctesting.Endpoint, unbondingPeriod time.Duration) { // ensure counterparty has committed state endpoint.Chain.Coordinator.CommitBlock(endpoint.Counterparty.Chain) - suite.Require().Equal(exported.Tendermint, endpoint.ClientConfig.GetClientType(), "only Tendermint client supported") + s.Require().Equal(exported.Tendermint, endpoint.ClientConfig.GetClientType(), "only Tendermint client supported") tmConfig, ok := endpoint.ClientConfig.(*ibctesting.TendermintConfig) require.True(endpoint.Chain.T, ok) @@ -553,10 +553,10 @@ func (suite *CCVTestSuite) CreateCustomClient(endpoint *ibctesting.Endpoint, unb tmConfig.TrustingPeriod = trustPeriod height := endpoint.Counterparty.Chain.LastHeader.GetHeight().(clienttypes.Height) - UpgradePath := []string{"upgrade", "upgradedIBCState"} + upgradePath := []string{"upgrade", "upgradedIBCState"} clientState := ibctm.NewClientState( endpoint.Counterparty.Chain.ChainID, tmConfig.TrustLevel, tmConfig.TrustingPeriod, tmConfig.UnbondingPeriod, tmConfig.MaxClockDrift, - height, commitmenttypes.GetSDKSpecs(), UpgradePath, tmConfig.AllowUpdateAfterExpiry, tmConfig.AllowUpdateAfterMisbehaviour, + height, commitmenttypes.GetSDKSpecs(), upgradePath, tmConfig.AllowUpdateAfterExpiry, tmConfig.AllowUpdateAfterMisbehaviour, ) consensusState := endpoint.Counterparty.Chain.LastHeader.ConsensusState() @@ -565,7 +565,7 @@ func (suite *CCVTestSuite) CreateCustomClient(endpoint *ibctesting.Endpoint, unb ) require.NoError(endpoint.Chain.T, err) - res, err := endpoint.Chain.SendMsgs(msg) + res, err := endpoint.Chain.SendMessages(msg) require.NoError(endpoint.Chain.T, err) endpoint.ClientID, err = ibctesting.ParseClientIDFromEvents(res.GetEvents()) @@ -574,21 +574,21 @@ func (suite *CCVTestSuite) CreateCustomClient(endpoint *ibctesting.Endpoint, unb // GetConsumerEndpointClientAndConsState returns the client and consensus state // for a particular consumer endpoint, as specified by the consumer's bundle. -func (suite *CCVTestSuite) GetConsumerEndpointClientAndConsState( - consumerBundle icstestingutils.ConsumerBundle) (exported.ClientState, exported.ConsensusState) { - +func (s *CCVTestSuite) GetConsumerEndpointClientAndConsState( + consumerBundle icstestingutils.ConsumerBundle, +) (exported.ClientState, exported.ConsensusState) { ctx := consumerBundle.GetCtx() consumerKeeper := consumerBundle.GetKeeper() clientID, found := consumerKeeper.GetProviderClientID(ctx) - suite.Require().True(found) + s.Require().True(found) clientState, found := consumerBundle.App.GetIBCKeeper().ClientKeeper.GetClientState(ctx, clientID) - suite.Require().True(found) + s.Require().True(found) consState, found := consumerBundle.App.GetIBCKeeper().ClientKeeper.GetClientConsensusState( ctx, clientID, clientState.GetLatestHeight()) - suite.Require().True(found) + s.Require().True(found) return clientState, consState } @@ -596,7 +596,6 @@ func (suite *CCVTestSuite) GetConsumerEndpointClientAndConsState( // setupValidatorPowers delegates from the sender account to give all // validators on the provider chain 1000 power. func (s *CCVTestSuite) setupValidatorPowers() { - delAddr := s.providerChain.SenderAccount.GetAddress() for idx := range s.providerChain.Vals.Validators { delegateByIdx(s, delAddr, sdk.NewInt(999999999), idx) diff --git a/tests/e2e/democracy.go b/tests/e2e/democracy.go index 84af902450..23eb0b293d 100644 --- a/tests/e2e/democracy.go +++ b/tests/e2e/democracy.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ibctesting "github.com/cosmos/interchain-security/legacy_ibc_testing/testing" - icstestingutils "github.com/cosmos/interchain-security/testutil/ibc_testing" + icstestingutils "github.com/cosmos/interchain-security/testutil/ibctesting" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" @@ -30,8 +30,8 @@ type ConsumerDemocracyTestSuite struct { // NewCCVTestSuite returns a new instance of ConsumerDemocracyTestSuite, // ready to be tested against using suite.Run(). func NewConsumerDemocracyTestSuite[T e2eutil.DemocConsumerApp]( - democConsumerAppIniter ibctesting.AppIniter) *ConsumerDemocracyTestSuite { - + democConsumerAppIniter ibctesting.AppIniter, +) *ConsumerDemocracyTestSuite { democSuite := new(ConsumerDemocracyTestSuite) democSuite.setupCallback = func(t *testing.T) ( @@ -61,14 +61,13 @@ type DemocSetupCallback func(t *testing.T) ( ) // SetupTest sets up in-mem state before every test relevant to ccv with a democracy consumer -func (suite *ConsumerDemocracyTestSuite) SetupTest() { +func (s *ConsumerDemocracyTestSuite) SetupTest() { // Instantiate new test utils using callback - suite.coordinator, suite.consumerChain, - suite.consumerApp = suite.setupCallback(suite.T()) + s.coordinator, s.consumerChain, + s.consumerApp = s.setupCallback(s.T()) } func (s *ConsumerDemocracyTestSuite) TestDemocracyRewardsDistribution() { - s.consumerChain.NextBlock() stakingKeeper := s.consumerApp.GetE2eStakingKeeper() accountKeeper := s.consumerApp.GetE2eAccountKeeper() @@ -88,7 +87,7 @@ func (s *ConsumerDemocracyTestSuite) TestDemocracyRewardsDistribution() { distrModuleAccount := distrKeeper.GetDistributionAccount(s.consumerCtx()) providerRedistributeAccount := accountKeeper.GetModuleAccount(s.consumerCtx(), consumertypes.ConsumerToSendToProviderName) - //balance of consumer redistribute address will always be 0 when checked between 2 NextBlock() calls + // balance of consumer redistribute address will always be 0 when checked between 2 NextBlock() calls currentDistrModuleAccountBalance := sdk.NewDecFromInt(bankKeeper.GetBalance(s.consumerCtx(), distrModuleAccount.GetAddress(), bondDenom).Amount) currentProviderFeeAccountBalance := sdk.NewDecFromInt(bankKeeper.GetBalance(s.consumerCtx(), providerRedistributeAccount.GetAddress(), bondDenom).Amount) @@ -123,23 +122,23 @@ func (s *ConsumerDemocracyTestSuite) TestDemocracyRewardsDistribution() { consumerRedistributionFraction := sdk.MustNewDecFromStr(s.consumerApp.GetConsumerKeeper().GetConsumerRedistributionFrac(s.consumerCtx())) - //confirm that the total amount given to the community pool plus all representatives is equal to the total amount taken out of distribution + // confirm that the total amount given to the community pool plus all representatives is equal to the total amount taken out of distribution s.Require().Equal(distrModuleDifference, consumerRedistributeDifference) - //confirm that the percentage given to the community pool is equal to the configured community tax percentage. + // confirm that the percentage given to the community pool is equal to the configured community tax percentage. s.Require().Equal(communityPoolDifference.Quo(consumerRedistributeDifference), distrKeeper.GetCommunityTax(s.consumerCtx())) - //check that the fraction actually kept by the consumer is the correct fraction. using InEpsilon because the math code uses truncations + // check that the fraction actually kept by the consumer is the correct fraction. using InEpsilon because the math code uses truncations s.Require().InEpsilon(distrModuleDifference.Quo( providerDifference.Add(distrModuleDifference)).MustFloat64(), consumerRedistributionFraction.MustFloat64(), float64(0.0001)) - //check that the fraction actually kept by the provider is the correct fraction. using InEpsilon because the math code uses truncations + // check that the fraction actually kept by the provider is the correct fraction. using InEpsilon because the math code uses truncations s.Require().InEpsilon(providerDifference.Quo( providerDifference.Add(distrModuleDifference)).MustFloat64(), sdk.NewDec(1).Sub(consumerRedistributionFraction).MustFloat64(), float64(0.0001)) totalRepresentativePower := stakingKeeper.GetValidatorSet().TotalBondedTokens(s.consumerCtx()) - //check that each representative has gotten the correct amount of rewards + // check that each representative has gotten the correct amount of rewards for key, representativeTokens := range representativesTokens { powerFraction := sdk.NewDecFromInt(representativeTokens).QuoTruncate(sdk.NewDecFromInt(totalRepresentativePower)) s.Require().Equal(powerFraction, representativeDifference[key].Quo(consumerRedistributeDifference.Sub(communityPoolDifference))) @@ -165,30 +164,30 @@ func (s *ConsumerDemocracyTestSuite) TestDemocracyGovernanceWhitelisting() { s.consumerChain.NextBlock() votersOldBalances := getAccountsBalances(s.consumerCtx(), bankKeeper, bondDenom, votingAccounts) - //submit proposal with forbidden and allowed changes + // submit proposal with forbidden and allowed changes paramChange := proposaltypes.ParameterChangeProposal{Changes: []proposaltypes.ParamChange{allowedChange, forbiddenChange}} err := submitProposalWithDepositAndVote(govKeeper, s.consumerCtx(), paramChange, votingAccounts, depositAmount) s.Assert().NoError(err) - //set current header time to be equal or later than voting end time in order to process proposal from active queue, - //once the proposal is added to the chain + // set current header time to be equal or later than voting end time in order to process proposal from active queue, + // once the proposal is added to the chain s.consumerChain.CurrentHeader.Time = s.consumerChain.CurrentHeader.Time.Add(votingParams.VotingPeriod) s.consumerChain.NextBlock() - //at this moment, proposal is added, but not yet executed. we are saving old param values for comparison + // at this moment, proposal is added, but not yet executed. we are saving old param values for comparison oldAuthParamValue := accountKeeper.GetParams(s.consumerCtx()).MaxMemoCharacters oldMintParamValue := mintKeeper.GetParams(s.consumerCtx()).InflationMax s.consumerChain.NextBlock() - //at this moment, proposal is executed or deleted if forbidden + // at this moment, proposal is executed or deleted if forbidden currentAuthParamValue := accountKeeper.GetParams(s.consumerCtx()).MaxMemoCharacters currentMintParamValue := mintKeeper.GetParams(s.consumerCtx()).InflationMax - //check that parameters are not changed, since the proposal contained both forbidden and allowed changes + // check that parameters are not changed, since the proposal contained both forbidden and allowed changes s.Assert().Equal(oldAuthParamValue, currentAuthParamValue) s.Assert().NotEqual(newAuthParamValue, currentAuthParamValue) s.Assert().Equal(oldMintParamValue, currentMintParamValue) s.Assert().NotEqual(newMintParamValue, currentMintParamValue) - //deposit is refunded + // deposit is refunded s.Assert().Equal(votersOldBalances, getAccountsBalances(s.consumerCtx(), bankKeeper, bondDenom, votingAccounts)) - //submit proposal with allowed changes + // submit proposal with allowed changes paramChange = proposaltypes.ParameterChangeProposal{Changes: []proposaltypes.ParamChange{allowedChange}} err = submitProposalWithDepositAndVote(govKeeper, s.consumerCtx(), paramChange, votingAccounts, depositAmount) s.Assert().NoError(err) @@ -197,13 +196,13 @@ func (s *ConsumerDemocracyTestSuite) TestDemocracyGovernanceWhitelisting() { oldMintParamValue = mintKeeper.GetParams(s.consumerCtx()).InflationMax s.consumerChain.NextBlock() currentMintParamValue = mintKeeper.GetParams(s.consumerCtx()).InflationMax - //check that parameters are changed, since the proposal contained only allowed changes + // check that parameters are changed, since the proposal contained only allowed changes s.Assert().Equal(newMintParamValue, currentMintParamValue) s.Assert().NotEqual(oldMintParamValue, currentMintParamValue) - //deposit is refunded + // deposit is refunded s.Assert().Equal(votersOldBalances, getAccountsBalances(s.consumerCtx(), bankKeeper, bondDenom, votingAccounts)) - //submit proposal with forbidden changes + // submit proposal with forbidden changes paramChange = proposaltypes.ParameterChangeProposal{Changes: []proposaltypes.ParamChange{forbiddenChange}} err = submitProposalWithDepositAndVote(govKeeper, s.consumerCtx(), paramChange, votingAccounts, depositAmount) s.Assert().NoError(err) @@ -212,20 +211,21 @@ func (s *ConsumerDemocracyTestSuite) TestDemocracyGovernanceWhitelisting() { oldAuthParamValue = accountKeeper.GetParams(s.consumerCtx()).MaxMemoCharacters s.consumerChain.NextBlock() currentAuthParamValue = accountKeeper.GetParams(s.consumerCtx()).MaxMemoCharacters - //check that parameters are not changed, since the proposal contained forbidden changes + // check that parameters are not changed, since the proposal contained forbidden changes s.Assert().Equal(oldAuthParamValue, currentAuthParamValue) s.Assert().NotEqual(newAuthParamValue, currentAuthParamValue) - //deposit is refunded + // deposit is refunded s.Assert().Equal(votersOldBalances, getAccountsBalances(s.consumerCtx(), bankKeeper, bondDenom, votingAccounts)) } -func submitProposalWithDepositAndVote(govKeeper e2eutil.E2eGovKeeper, ctx sdk.Context, paramChange proposaltypes.ParameterChangeProposal, - accounts []ibctesting.SenderAccount, depositAmount sdk.Coins) error { +func submitProposalWithDepositAndVote(govKeeper e2eutil.GovKeeper, ctx sdk.Context, paramChange proposaltypes.ParameterChangeProposal, + accounts []ibctesting.SenderAccount, depositAmount sdk.Coins, +) error { proposal, err := govKeeper.SubmitProposal(ctx, ¶mChange) if err != nil { return err } - _, err = govKeeper.AddDeposit(ctx, proposal.ProposalId, accounts[0].SenderAccount.GetAddress(), depositAmount) //proposal becomes active + _, err = govKeeper.AddDeposit(ctx, proposal.ProposalId, accounts[0].SenderAccount.GetAddress(), depositAmount) // proposal becomes active if err != nil { return err } @@ -239,11 +239,10 @@ func submitProposalWithDepositAndVote(govKeeper e2eutil.E2eGovKeeper, ctx sdk.Co return nil } -func getAccountsBalances(ctx sdk.Context, bankKeeper e2eutil.E2eBankKeeper, bondDenom string, accounts []ibctesting.SenderAccount) map[string]sdk.Int { +func getAccountsBalances(ctx sdk.Context, bankKeeper e2eutil.BankKeeper, bondDenom string, accounts []ibctesting.SenderAccount) map[string]sdk.Int { accountsBalances := map[string]sdk.Int{} for _, acc := range accounts { - accountsBalances[string(acc.SenderAccount.GetAddress())] = - bankKeeper.GetBalance(ctx, acc.SenderAccount.GetAddress(), bondDenom).Amount + accountsBalances[string(acc.SenderAccount.GetAddress())] = bankKeeper.GetBalance(ctx, acc.SenderAccount.GetAddress(), bondDenom).Amount } return accountsBalances diff --git a/tests/e2e/distribution.go b/tests/e2e/distribution.go index 0c247e14a2..c43f4f2547 100644 --- a/tests/e2e/distribution.go +++ b/tests/e2e/distribution.go @@ -12,8 +12,7 @@ import ( // This test is valid for minimal viable consumer chain func (s *CCVTestSuite) TestRewardsDistribution() { - - //set up channel and delegate some tokens in order for validator set update to be sent to the consumer chain + // set up channel and delegate some tokens in order for validator set update to be sent to the consumer chain s.SetupCCVChannel(s.path) s.SetupTransferChannel() bondAmt := sdk.NewInt(10000000) @@ -24,7 +23,7 @@ func (s *CCVTestSuite) TestRewardsDistribution() { // relay VSC packets from provider to consumer relayAllCommittedPackets(s, s.providerChain, s.path, ccv.ProviderPortID, s.path.EndpointB.ChannelID, 1) - //reward for the provider chain will be sent after each 2 blocks + // reward for the provider chain will be sent after each 2 blocks consumerParams := s.consumerApp.GetSubspace(consumertypes.ModuleName) consumerParams.Set(s.consumerCtx(), consumertypes.KeyBlocksPerDistributionTransmission, int64(2)) s.consumerChain.NextBlock() @@ -32,7 +31,7 @@ func (s *CCVTestSuite) TestRewardsDistribution() { consumerAccountKeeper := s.consumerApp.GetE2eAccountKeeper() consumerBankKeeper := s.consumerApp.GetE2eBankKeeper() - //send coins to the fee pool which is used for reward distribution + // send coins to the fee pool which is used for reward distribution consumerFeePoolAddr := consumerAccountKeeper.GetModuleAccount(s.consumerCtx(), authtypes.FeeCollectorName).GetAddress() feePoolTokensOld := consumerBankKeeper.GetAllBalances(s.consumerCtx(), consumerFeePoolAddr) fees := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100))) @@ -41,14 +40,14 @@ func (s *CCVTestSuite) TestRewardsDistribution() { feePoolTokens := consumerBankKeeper.GetAllBalances(s.consumerCtx(), consumerFeePoolAddr) s.Require().Equal(sdk.NewInt(100).Add(feePoolTokensOld.AmountOf(sdk.DefaultBondDenom)), feePoolTokens.AmountOf(sdk.DefaultBondDenom)) - //calculate the reward for consumer and provider chain. Consumer will receive ConsumerRedistributeFrac, the rest is going to provider + // calculate the reward for consumer and provider chain. Consumer will receive ConsumerRedistributeFrac, the rest is going to provider frac, err := sdk.NewDecFromStr(s.consumerApp.GetConsumerKeeper().GetConsumerRedistributionFrac(s.consumerCtx())) s.Require().NoError(err) consumerExpectedRewards, _ := sdk.NewDecCoinsFromCoins(feePoolTokens...).MulDec(frac).TruncateDecimal() providerExpectedRewards := feePoolTokens.Sub(consumerExpectedRewards) s.consumerChain.NextBlock() - //amount from the fee pool is devided between consumer redistribute address and address reserved for provider chain + // amount from the fee pool is divided between consumer redistribute address and address reserved for provider chain feePoolTokens = consumerBankKeeper.GetAllBalances(s.consumerCtx(), consumerFeePoolAddr) s.Require().Equal(0, len(feePoolTokens)) consumerRedistributeAddr := consumerAccountKeeper.GetModuleAccount(s.consumerCtx(), consumertypes.ConsumerRedistributeName).GetAddress() @@ -58,7 +57,7 @@ func (s *CCVTestSuite) TestRewardsDistribution() { providerTokens := consumerBankKeeper.GetAllBalances(s.consumerCtx(), providerRedistributeAddr) s.Require().Equal(providerExpectedRewards.AmountOf(sdk.DefaultBondDenom), providerTokens.AmountOf(sdk.DefaultBondDenom)) - //send the reward to provider chain after 2 blocks + // send the reward to provider chain after 2 blocks s.consumerChain.NextBlock() providerTokens = consumerBankKeeper.GetAllBalances(s.consumerCtx(), providerRedistributeAddr) @@ -79,7 +78,6 @@ func (s *CCVTestSuite) TestRewardsDistribution() { // TestSendRewardsRetries tests that failed reward transmissions are retried every BlocksPerDistributionTransmission blocks func (s *CCVTestSuite) TestSendRewardsRetries() { - // TODO: this setup can be consolidated with other tests in the file // ccv and transmission channels setup @@ -152,7 +150,6 @@ func (s *CCVTestSuite) TestSendRewardsRetries() { // // Note: this method is effectively a unit test for EndBLockRD(), but is written as an e2e test to avoid excessive mocking. func (s *CCVTestSuite) TestEndBlockRD() { - testCases := []struct { name string prepareRewardDist bool @@ -183,8 +180,8 @@ func (s *CCVTestSuite) TestEndBlockRD() { }, } + // Run test cases for _, tc := range testCases { - s.SetupTest() // ccv and transmission channels setup @@ -245,7 +242,7 @@ func (s *CCVTestSuite) TestEndBlockRD() { } } -// getEscrowBalance gets the current balances in the escrow account holding the transfered tokens to the provider +// getEscrowBalance gets the current balances in the escrow account holding the transferred tokens to the provider func (s CCVTestSuite) getEscrowBalance() sdk.Coins { consumerBankKeeper := s.consumerApp.GetE2eBankKeeper() transChanID := s.consumerApp.GetConsumerKeeper().GetDistributionTransmissionChannel(s.consumerCtx()) diff --git a/tests/e2e/instance_test.go b/tests/e2e/instance_test.go index 62462dbe63..91b83d6b6e 100644 --- a/tests/e2e/instance_test.go +++ b/tests/e2e/instance_test.go @@ -7,7 +7,7 @@ import ( appConsumerDemocracy "github.com/cosmos/interchain-security/app/consumer-democracy" appProvider "github.com/cosmos/interchain-security/app/provider" "github.com/cosmos/interchain-security/tests/e2e" - icstestingutils "github.com/cosmos/interchain-security/testutil/ibc_testing" + icstestingutils "github.com/cosmos/interchain-security/testutil/ibctesting" "github.com/stretchr/testify/suite" ) @@ -19,7 +19,6 @@ import ( // Executes the standard group of ccv tests against a consumer and provider app.go implementation. func TestCCVTestSuite(t *testing.T) { - // Pass in concrete app types that implement the interfaces defined in /testutil/e2e/interfaces.go // IMPORTANT: the concrete app types passed in as type parameters here must match the // concrete app types returned by the relevant app initers. @@ -49,7 +48,6 @@ func TestConsumerDemocracyCCVTestSuite(t *testing.T) { // Executes a specialized group of tests specific to a democracy consumer, // against a democracy consumer app.go implementation. func TestConsumerDemocracyTestSuite(t *testing.T) { - // Pass in concrete app type that implement the interface defined in /testutil/e2e/interfaces.go // IMPORTANT: the concrete app type passed in as a type parameter here must match the // concrete app type returned by the relevant app initer. diff --git a/tests/e2e/normal_operations.go b/tests/e2e/normal_operations.go index 5fc6689467..a9533646ea 100644 --- a/tests/e2e/normal_operations.go +++ b/tests/e2e/normal_operations.go @@ -7,9 +7,9 @@ import ( ) // Tests the tracking of historical info in the context of new blocks being committed -func (k CCVTestSuite) TestHistoricalInfo() { - consumerKeeper := k.consumerApp.GetConsumerKeeper() - cCtx := k.consumerChain.GetContext +func (s CCVTestSuite) TestHistoricalInfo() { + consumerKeeper := s.consumerApp.GetConsumerKeeper() + cCtx := s.consumerChain.GetContext // save init consumer valset length initValsetLen := len(consumerKeeper.GetAllCCValidator(cCtx())) @@ -18,16 +18,16 @@ func (k CCVTestSuite) TestHistoricalInfo() { // define an utility function that creates a new cross-chain validator // and then call track historical info in the next block - createVal := func(k CCVTestSuite) { + createVal := func(s CCVTestSuite) { // add new validator to consumer states pk := ed25519.GenPrivKey().PubKey() cVal, err := consumertypes.NewCCValidator(pk.Address(), int64(1), pk) - k.Require().NoError(err) + s.Require().NoError(err) - consumerKeeper.SetCCValidator(k.consumerChain.GetContext(), cVal) + consumerKeeper.SetCCValidator(s.consumerChain.GetContext(), cVal) // commit block in order to call TrackHistoricalInfo - k.consumerChain.NextBlock() + s.consumerChain.NextBlock() } // testsetup create 2 validators and then call track historical info with header block height @@ -37,20 +37,20 @@ func (k CCVTestSuite) TestHistoricalInfo() { testSetup := []func(CCVTestSuite){ createVal, createVal, - func(k CCVTestSuite) { - historicalEntries := k.consumerApp.GetConsumerKeeper().GetHistoricalEntries(k.consumerCtx()) - newHeight := k.consumerChain.GetContext().BlockHeight() + historicalEntries + func(s CCVTestSuite) { + historicalEntries := s.consumerApp.GetConsumerKeeper().GetHistoricalEntries(s.consumerCtx()) + newHeight := s.consumerChain.GetContext().BlockHeight() + historicalEntries header := tmproto.Header{ ChainID: "HelloChain", Height: newHeight, } - ctx := k.consumerChain.GetContext().WithBlockHeader(header) + ctx := s.consumerChain.GetContext().WithBlockHeader(header) consumerKeeper.TrackHistoricalInfo(ctx) }, } for _, ts := range testSetup { - ts(k) + ts(s) } // test cases verify that historical info entries are pruned when their height @@ -71,7 +71,7 @@ func (k CCVTestSuite) TestHistoricalInfo() { expLen: 0, }, { - height: initHeight + int64(consumertypes.DefaultHistoricalEntries) + 2, + height: initHeight + consumertypes.DefaultHistoricalEntries + 2, found: true, expLen: initValsetLen + 2, }, @@ -80,7 +80,7 @@ func (k CCVTestSuite) TestHistoricalInfo() { for _, tc := range testCases { cCtx().WithBlockHeight(tc.height) hi, found := consumerKeeper.GetHistoricalInfo(cCtx().WithBlockHeight(tc.height), tc.height) - k.Require().Equal(tc.found, found) - k.Require().Len(hi.Valset, tc.expLen) + s.Require().Equal(tc.found, found) + s.Require().Len(hi.Valset, tc.expLen) } } diff --git a/tests/e2e/setup.go b/tests/e2e/setup.go index 21413f7667..fded0b637e 100644 --- a/tests/e2e/setup.go +++ b/tests/e2e/setup.go @@ -9,7 +9,7 @@ import ( e2eutil "github.com/cosmos/interchain-security/testutil/e2e" tmencoding "github.com/tendermint/tendermint/crypto/encoding" - icstestingutils "github.com/cosmos/interchain-security/testutil/ibc_testing" + icstestingutils "github.com/cosmos/interchain-security/testutil/ibctesting" consumertypes "github.com/cosmos/interchain-security/x/ccv/consumer/types" ccv "github.com/cosmos/interchain-security/x/ccv/types" @@ -17,7 +17,7 @@ import ( channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" ibctesting "github.com/cosmos/interchain-security/legacy_ibc_testing/testing" - "github.com/stretchr/testify/suite" + testifysuite "github.com/stretchr/testify/suite" ) // Callback for instantiating a new coordinator with a provider test chains @@ -30,7 +30,7 @@ type SetupProviderCallback func(t *testing.T) ( // Callback for instantiating a new consumer test chain // and consumer app before every test defined on the suite. -type SetupConsumerCallback func(s *suite.Suite, coord *ibctesting.Coordinator, index int) ( +type SetupConsumerCallback func(s *testifysuite.Suite, coord *ibctesting.Coordinator, index int) ( consumerBundle *icstestingutils.ConsumerBundle, ) @@ -38,7 +38,7 @@ type SetupConsumerCallback func(s *suite.Suite, coord *ibctesting.Coordinator, i // the e2e functionality of ccv enabled chains. // Any method implemented for this struct will be ran when suite.Run() is called. type CCVTestSuite struct { - suite.Suite + testifysuite.Suite coordinator *ibctesting.Coordinator setupProviderCallback SetupProviderCallback setupConsumerCallback SetupConsumerCallback @@ -63,8 +63,8 @@ type CCVTestSuite struct { // NewCCVTestSuite returns a new instance of CCVTestSuite, ready to be tested against using suite.Run(). func NewCCVTestSuite[Tp e2eutil.ProviderApp, Tc e2eutil.ConsumerApp]( - providerAppIniter ibctesting.AppIniter, consumerAppIniter ibctesting.AppIniter, skippedTests []string) *CCVTestSuite { - + providerAppIniter, consumerAppIniter ibctesting.AppIniter, skippedTests []string, +) *CCVTestSuite { ccvSuite := new(CCVTestSuite) // Define callback to set up the provider chain @@ -85,7 +85,7 @@ func NewCCVTestSuite[Tp e2eutil.ProviderApp, Tc e2eutil.ConsumerApp]( } ccvSuite.setupConsumerCallback = func( - s *suite.Suite, + s *testifysuite.Suite, coordinator *ibctesting.Coordinator, index int, ) *icstestingutils.ConsumerBundle { @@ -99,51 +99,51 @@ func NewCCVTestSuite[Tp e2eutil.ProviderApp, Tc e2eutil.ConsumerApp]( return ccvSuite } -func (suite *CCVTestSuite) BeforeTest(suiteName, testName string) { - if suite.skippedTests[testName] { - suite.T().Skip() +func (s *CCVTestSuite) BeforeTest(_, testName string) { + if s.skippedTests[testName] { + s.T().Skip() } } // SetupTest sets up in-mem state before every test -func (suite *CCVTestSuite) SetupTest() { +func (s *CCVTestSuite) SetupTest() { // Instantiate new coordinator and provider chain using callback - suite.coordinator, suite.providerChain, - suite.providerApp = suite.setupProviderCallback(suite.T()) - providerKeeper := suite.providerApp.GetProviderKeeper() + s.coordinator, s.providerChain, + s.providerApp = s.setupProviderCallback(s.T()) + providerKeeper := s.providerApp.GetProviderKeeper() // re-assign all validator keys for the first consumer chain - preProposalKeyAssignment(suite, icstestingutils.FirstConsumerChainID) + preProposalKeyAssignment(s, icstestingutils.FirstConsumerChainID) // start consumer chains numConsumers := 5 - suite.consumerBundles = make(map[string]*icstestingutils.ConsumerBundle) + s.consumerBundles = make(map[string]*icstestingutils.ConsumerBundle) for i := 0; i < numConsumers; i++ { - bundle := suite.setupConsumerCallback(&suite.Suite, suite.coordinator, i) - suite.consumerBundles[bundle.Chain.ChainID] = bundle + bundle := s.setupConsumerCallback(&s.Suite, s.coordinator, i) + s.consumerBundles[bundle.Chain.ChainID] = bundle } // initialize each consumer chain with it's corresponding genesis state // stored on the provider. - for chainID := range suite.consumerBundles { + for chainID := range s.consumerBundles { consumerGenesisState, found := providerKeeper.GetConsumerGenesis( - suite.providerCtx(), + s.providerCtx(), chainID, ) - suite.Require().True(found, "consumer genesis not found") + s.Require().True(found, "consumer genesis not found") - initConsumerChain(suite, chainID, &consumerGenesisState) + initConsumerChain(s, chainID, &consumerGenesisState) } // try updating all clients - for _, bundle := range suite.consumerBundles { + for _, bundle := range s.consumerBundles { // try updating this consumer client on the provider chain err := bundle.Path.EndpointB.UpdateClient() - suite.Require().NoError(err) + s.Require().NoError(err) // try updating the provider client on this consumer chain err = bundle.Path.EndpointA.UpdateClient() - suite.Require().NoError(err) + s.Require().NoError(err) } } @@ -175,7 +175,7 @@ func initConsumerChain( bundle.Path = ibctesting.NewPath(bundle.Chain, s.providerChain) // Set provider endpoint's clientID for each consumer - providerEndpointClientID, found := providerKeeper.GetConsumerClientId( + providerEndpointClientID, found := providerKeeper.GetConsumerClientID( s.providerCtx(), chainID, ) @@ -230,61 +230,60 @@ func initConsumerChain( } } -func (suite *CCVTestSuite) SetupAllCCVChannels() { - for _, bundle := range suite.consumerBundles { - suite.SetupCCVChannel(bundle.Path) +func (s *CCVTestSuite) SetupAllCCVChannels() { + for _, bundle := range s.consumerBundles { + s.SetupCCVChannel(bundle.Path) } } -func (suite *CCVTestSuite) SetupCCVChannel(path *ibctesting.Path) { - suite.coordinator.CreateConnections(path) +func (s *CCVTestSuite) SetupCCVChannel(path *ibctesting.Path) { + s.coordinator.CreateConnections(path) err := path.EndpointA.ChanOpenInit() - suite.Require().NoError(err) + s.Require().NoError(err) err = path.EndpointB.ChanOpenTry() - suite.Require().NoError(err) + s.Require().NoError(err) err = path.EndpointA.ChanOpenAck() - suite.Require().NoError(err) + s.Require().NoError(err) err = path.EndpointB.ChanOpenConfirm() - suite.Require().NoError(err) + s.Require().NoError(err) // ensure counterparty is up to date err = path.EndpointA.UpdateClient() - suite.Require().NoError(err) + s.Require().NoError(err) } // TODO: Make SetupTransferChannel functional for multiple consumers by pattern matching SetupCCVChannel. // See: https://github.com/cosmos/interchain-security/issues/506 -func (suite *CCVTestSuite) SetupTransferChannel() { +func (s *CCVTestSuite) SetupTransferChannel() { // transfer path will use the same connection as ccv path - suite.transferPath.EndpointA.ClientID = suite.path.EndpointA.ClientID - suite.transferPath.EndpointA.ConnectionID = suite.path.EndpointA.ConnectionID - suite.transferPath.EndpointB.ClientID = suite.path.EndpointB.ClientID - suite.transferPath.EndpointB.ConnectionID = suite.path.EndpointB.ConnectionID + s.transferPath.EndpointA.ClientID = s.path.EndpointA.ClientID + s.transferPath.EndpointA.ConnectionID = s.path.EndpointA.ConnectionID + s.transferPath.EndpointB.ClientID = s.path.EndpointB.ClientID + s.transferPath.EndpointB.ConnectionID = s.path.EndpointB.ConnectionID // CCV channel handshake will automatically initiate transfer channel handshake on ACK // so transfer channel will be on stage INIT when CompleteSetupCCVChannel returns. - suite.transferPath.EndpointA.ChannelID = - suite.consumerApp.GetConsumerKeeper().GetDistributionTransmissionChannel( - suite.consumerChain.GetContext()) + s.transferPath.EndpointA.ChannelID = s.consumerApp.GetConsumerKeeper().GetDistributionTransmissionChannel( + s.consumerChain.GetContext()) // Complete TRY, ACK, CONFIRM for transfer path - err := suite.transferPath.EndpointB.ChanOpenTry() - suite.Require().NoError(err) + err := s.transferPath.EndpointB.ChanOpenTry() + s.Require().NoError(err) - err = suite.transferPath.EndpointA.ChanOpenAck() - suite.Require().NoError(err) + err = s.transferPath.EndpointA.ChanOpenAck() + s.Require().NoError(err) - err = suite.transferPath.EndpointB.ChanOpenConfirm() - suite.Require().NoError(err) + err = s.transferPath.EndpointB.ChanOpenConfirm() + s.Require().NoError(err) // ensure counterparty is up to date - err = suite.transferPath.EndpointA.UpdateClient() - suite.Require().NoError(err) + err = s.transferPath.EndpointA.UpdateClient() + s.Require().NoError(err) } func (s CCVTestSuite) validateEndpointsClientConfig(consumerBundle icstestingutils.ConsumerBundle) { diff --git a/tests/e2e/slashing.go b/tests/e2e/slashing.go index 97f161607e..8802f94b8b 100644 --- a/tests/e2e/slashing.go +++ b/tests/e2e/slashing.go @@ -29,7 +29,6 @@ import ( // and double-signing, see TestValidatorDowntime and TestValidatorDoubleSigning for // those types of tests. func (s *CCVTestSuite) TestRelayAndApplyDowntimePacket() { - // Setup CCV channel for all instantiated consumers s.SetupAllCCVChannels() @@ -83,7 +82,7 @@ func (s *CCVTestSuite) TestRelayAndApplyDowntimePacket() { // during the endblocker of N+1. The new validator set will be committed to in block N+2, // and will be in effect for the provider during block N+3. - valsetUpdateIdN := providerKeeper.GetValidatorSetUpdateId(s.providerCtx()) + valsetUpdateIDN := providerKeeper.GetValidatorSetUpdateID(s.providerCtx()) // receive the slash packet on the provider chain. RecvPacket() calls the provider endblocker twice err = s.path.EndpointB.RecvPacket(packet) @@ -92,17 +91,17 @@ func (s *CCVTestSuite) TestRelayAndApplyDowntimePacket() { // We've now advanced two blocks. // VSC packets should have been sent from provider during block N+1 to each consumer - expectedSentValsetUpdateId := valsetUpdateIdN + 1 + expectedSentValsetUpdateID := valsetUpdateIDN + 1 for _, bundle := range s.consumerBundles { _, found := providerKeeper.GetVscSendTimestamp(s.providerCtx(), - bundle.Chain.ChainID, expectedSentValsetUpdateId) + bundle.Chain.ChainID, expectedSentValsetUpdateID) s.Require().True(found) } // Confirm the valset update Id was incremented twice on provider, // since two endblockers have passed. - s.Require().Equal(valsetUpdateIdN+2, - providerKeeper.GetValidatorSetUpdateId(s.providerCtx())) + s.Require().Equal(valsetUpdateIDN+2, + providerKeeper.GetValidatorSetUpdateID(s.providerCtx())) // Call next block so provider is now on block N + 3 mentioned above s.providerChain.NextBlock() @@ -120,7 +119,7 @@ func (s *CCVTestSuite) TestRelayAndApplyDowntimePacket() { ctx := bundle.GetCtx() actualValsetUpdateID := consumerKeeper.GetHeightValsetUpdateID( ctx, uint64(ctx.BlockHeight())+1) - s.Require().Equal(expectedSentValsetUpdateId, actualValsetUpdateID) + s.Require().Equal(expectedSentValsetUpdateID, actualValsetUpdateID) // check that jailed validator was removed from each consumer validator set s.Require().Len(bundle.Chain.Vals.Validators, validatorsPerChain-1) @@ -160,7 +159,6 @@ func (s *CCVTestSuite) TestRelayAndApplyDowntimePacket() { // Similar setup to TestRelayAndApplyDowntimePacket, but with a double sign slash packet. // Note that double-sign slash packets should not affect the provider validator set. func (s *CCVTestSuite) TestRelayAndApplyDoubleSignPacket() { - // Setup CCV channel for all instantiated consumers s.SetupAllCCVChannels() @@ -264,30 +262,30 @@ func (s *CCVTestSuite) TestSlashPacketAcknowledgement() { // TestHandleSlashPacketDowntime tests the handling of a downtime related slash packet, with e2e tests. // Note that only downtime slash packets are processed by HandleSlashPacket. -func (suite *CCVTestSuite) TestHandleSlashPacketDowntime() { - providerKeeper := suite.providerApp.GetProviderKeeper() - providerSlashingKeeper := suite.providerApp.GetE2eSlashingKeeper() - providerStakingKeeper := suite.providerApp.GetE2eStakingKeeper() +func (s *CCVTestSuite) TestHandleSlashPacketDowntime() { + providerKeeper := s.providerApp.GetProviderKeeper() + providerSlashingKeeper := s.providerApp.GetE2eSlashingKeeper() + providerStakingKeeper := s.providerApp.GetE2eStakingKeeper() - tmVal := suite.providerChain.Vals.Validators[0] + tmVal := s.providerChain.Vals.Validators[0] consAddr := sdk.ConsAddress(tmVal.Address) // check that validator bonded status - validator, found := providerStakingKeeper.GetValidatorByConsAddr(suite.providerCtx(), consAddr) - suite.Require().True(found) - suite.Require().Equal(stakingtypes.Bonded, validator.GetStatus()) + validator, found := providerStakingKeeper.GetValidatorByConsAddr(s.providerCtx(), consAddr) + s.Require().True(found) + s.Require().Equal(stakingtypes.Bonded, validator.GetStatus()) // set init VSC id for chain0 - providerKeeper.SetInitChainHeight(suite.providerCtx(), suite.consumerChain.ChainID, uint64(suite.providerCtx().BlockHeight())) + providerKeeper.SetInitChainHeight(s.providerCtx(), s.consumerChain.ChainID, uint64(s.providerCtx().BlockHeight())) // set validator signing-info providerSlashingKeeper.SetValidatorSigningInfo( - suite.providerCtx(), + s.providerCtx(), consAddr, slashingtypes.ValidatorSigningInfo{Address: consAddr.String()}, ) - providerKeeper.HandleSlashPacket(suite.providerCtx(), suite.consumerChain.ChainID, + providerKeeper.HandleSlashPacket(s.providerCtx(), s.consumerChain.ChainID, *ccv.NewSlashPacketData( abci.Validator{Address: tmVal.Address, Power: 0}, uint64(0), @@ -296,28 +294,27 @@ func (suite *CCVTestSuite) TestHandleSlashPacketDowntime() { ) // verify that validator is jailed in the staking and slashing modules' states - suite.Require().True(providerStakingKeeper.IsValidatorJailed(suite.providerCtx(), consAddr)) + s.Require().True(providerStakingKeeper.IsValidatorJailed(s.providerCtx(), consAddr)) - signingInfo, _ := providerSlashingKeeper.GetValidatorSigningInfo(suite.providerCtx(), consAddr) - jailDuration := providerSlashingKeeper.DowntimeJailDuration(suite.providerCtx()) - suite.Require().Equal(suite.providerCtx().BlockTime().Add(jailDuration), signingInfo.JailedUntil) + signingInfo, _ := providerSlashingKeeper.GetValidatorSigningInfo(s.providerCtx(), consAddr) + jailDuration := providerSlashingKeeper.DowntimeJailDuration(s.providerCtx()) + s.Require().Equal(s.providerCtx().BlockTime().Add(jailDuration), signingInfo.JailedUntil) } // TestOnRecvSlashPacketErrors tests errors for the OnRecvSlashPacket method in an e2e testing setting -func (suite *CCVTestSuite) TestOnRecvSlashPacketErrors() { - - providerKeeper := suite.providerApp.GetProviderKeeper() - providerSlashingKeeper := suite.providerApp.GetE2eSlashingKeeper() - firstBundle := suite.getFirstBundle() +func (s *CCVTestSuite) TestOnRecvSlashPacketErrors() { + providerKeeper := s.providerApp.GetProviderKeeper() + providerSlashingKeeper := s.providerApp.GetE2eSlashingKeeper() + firstBundle := s.getFirstBundle() consumerChainID := firstBundle.Chain.ChainID - suite.SetupAllCCVChannels() + s.SetupAllCCVChannels() // sync contexts block height - ctx := suite.providerCtx() + ctx := s.providerCtx() // Expect panic if ccv channel is not established via dest channel of packet - suite.Panics(func() { + s.Panics(func() { providerKeeper.OnRecvSlashPacket(ctx, channeltypes.Packet{}, ccv.SlashPacketData{}) }) @@ -327,15 +324,15 @@ func (suite *CCVTestSuite) TestOnRecvSlashPacketErrors() { // Init chain height is set by established CCV channel // Delete init chain height and confirm expected error initChainHeight, found := providerKeeper.GetInitChainHeight(ctx, consumerChainID) - suite.Require().True(found) + s.Require().True(found) providerKeeper.DeleteInitChainHeight(ctx, consumerChainID) packetData := ccv.SlashPacketData{ValsetUpdateId: 0} errAck := providerKeeper.OnRecvSlashPacket(ctx, packet, packetData) - suite.Require().False(errAck.Success()) + s.Require().False(errAck.Success()) errAckCast := errAck.(channeltypes.Acknowledgement) // TODO: see if there's a way to get error reason like before - suite.Require().Equal("ABCI code: 1: error handling packet: see events for details", errAckCast.GetError()) + s.Require().Equal("ABCI code: 1: error handling packet: see events for details", errAckCast.GetError()) // Restore init chain height providerKeeper.SetInitChainHeight(ctx, consumerChainID, initChainHeight) @@ -343,13 +340,13 @@ func (suite *CCVTestSuite) TestOnRecvSlashPacketErrors() { // now the method will fail at infraction height check. packetData.Infraction = stakingtypes.InfractionEmpty errAck = providerKeeper.OnRecvSlashPacket(ctx, packet, packetData) - suite.Require().False(errAck.Success()) + s.Require().False(errAck.Success()) errAckCast = errAck.(channeltypes.Acknowledgement) // TODO: see if there's a way to get error reason like before - suite.Require().Equal("ABCI code: 1: error handling packet: see events for details", errAckCast.GetError()) + s.Require().Equal("ABCI code: 1: error handling packet: see events for details", errAckCast.GetError()) // save current VSC ID - vscID := providerKeeper.GetValidatorSetUpdateId(ctx) + vscID := providerKeeper.GetValidatorSetUpdateID(ctx) // remove block height value mapped to current VSC ID providerKeeper.DeleteValsetUpdateBlockHeight(ctx, vscID) @@ -359,15 +356,17 @@ func (suite *CCVTestSuite) TestOnRecvSlashPacketErrors() { // expect an error if mapped block height is not found errAck = providerKeeper.OnRecvSlashPacket(ctx, packet, packetData) - suite.Require().False(errAck.Success()) + s.Require().False(errAck.Success()) errAckCast = errAck.(channeltypes.Acknowledgement) // TODO: see if there's a way to get error reason like before - suite.Require().Equal("ABCI code: 1: error handling packet: see events for details", errAckCast.GetError()) + s.Require().Equal("ABCI code: 1: error handling packet: see events for details", errAckCast.GetError()) // construct slashing packet with non existing validator slashingPkt := ccv.NewSlashPacketData( - abci.Validator{Address: ed25519.GenPrivKey().PubKey().Address(), - Power: int64(0)}, uint64(0), stakingtypes.Downtime, + abci.Validator{ + Address: ed25519.GenPrivKey().PubKey().Address(), + Power: int64(0), + }, uint64(0), stakingtypes.Downtime, ) // Set initial block height for consumer chain @@ -377,15 +376,15 @@ func (suite *CCVTestSuite) TestOnRecvSlashPacketErrors() { // TODO: this behavior should be changed to return an error ack, // see: https://github.com/cosmos/interchain-security/issues/546 ack := providerKeeper.OnRecvSlashPacket(ctx, packet, *slashingPkt) - suite.Require().True(ack.Success()) + s.Require().True(ack.Success()) - val := suite.providerChain.Vals.Validators[0] + val := s.providerChain.Vals.Validators[0] // commit block to set VSC ID - suite.coordinator.CommitBlock(suite.providerChain) + s.coordinator.CommitBlock(s.providerChain) // Update suite.ctx bc CommitBlock updates only providerChain's current header block height - ctx = suite.providerChain.GetContext() - suite.Require().NotZero(providerKeeper.GetValsetUpdateBlockHeight(ctx, vscID)) + ctx = s.providerChain.GetContext() + s.Require().NotZero(providerKeeper.GetValsetUpdateBlockHeight(ctx, vscID)) // create validator signing info valInfo := slashingtypes.NewValidatorSigningInfo(sdk.ConsAddress(val.Address), ctx.BlockHeight(), @@ -397,7 +396,7 @@ func (suite *CCVTestSuite) TestOnRecvSlashPacketErrors() { slashingPkt.ValsetUpdateId = vscID // expect error ack when infraction type in unspecified - tmAddr := suite.providerChain.Vals.Validators[1].Address + tmAddr := s.providerChain.Vals.Validators[1].Address slashingPkt.Validator.Address = tmAddr slashingPkt.Infraction = stakingtypes.InfractionEmpty @@ -405,36 +404,36 @@ func (suite *CCVTestSuite) TestOnRecvSlashPacketErrors() { providerSlashingKeeper.SetValidatorSigningInfo(ctx, sdk.ConsAddress(tmAddr), valInfo) errAck = providerKeeper.OnRecvSlashPacket(ctx, packet, *slashingPkt) - suite.Require().False(errAck.Success()) + s.Require().False(errAck.Success()) // Expect nothing was queued - suite.Require().Equal(0, len(providerKeeper.GetAllGlobalSlashEntries(ctx))) - suite.Require().Equal(uint64(0), (providerKeeper.GetThrottledPacketDataSize(ctx, consumerChainID))) + s.Require().Equal(0, len(providerKeeper.GetAllGlobalSlashEntries(ctx))) + s.Require().Equal(uint64(0), (providerKeeper.GetThrottledPacketDataSize(ctx, consumerChainID))) // expect to queue entries for the slash request slashingPkt.Infraction = stakingtypes.Downtime ack = providerKeeper.OnRecvSlashPacket(ctx, packet, *slashingPkt) - suite.Require().True(ack.Success()) - suite.Require().Equal(1, len(providerKeeper.GetAllGlobalSlashEntries(ctx))) - suite.Require().Equal(uint64(1), (providerKeeper.GetThrottledPacketDataSize(ctx, consumerChainID))) + s.Require().True(ack.Success()) + s.Require().Equal(1, len(providerKeeper.GetAllGlobalSlashEntries(ctx))) + s.Require().Equal(uint64(1), (providerKeeper.GetThrottledPacketDataSize(ctx, consumerChainID))) } // TestValidatorDowntime tests if a slash packet is sent // and if the outstanding slashing flag is switched // when a validator has downtime on the slashing module -func (suite *CCVTestSuite) TestValidatorDowntime() { +func (s *CCVTestSuite) TestValidatorDowntime() { // initial setup - suite.SetupCCVChannel(suite.path) - suite.SendEmptyVSCPacket() + s.SetupCCVChannel(s.path) + s.SendEmptyVSCPacket() - consumerKeeper := suite.consumerApp.GetConsumerKeeper() - consumerSlashingKeeper := suite.consumerApp.GetE2eSlashingKeeper() - consumerIBCKeeper := suite.consumerApp.GetIBCKeeper() + consumerKeeper := s.consumerApp.GetConsumerKeeper() + consumerSlashingKeeper := s.consumerApp.GetE2eSlashingKeeper() + consumerIBCKeeper := s.consumerApp.GetIBCKeeper() // sync suite context after CCV channel is established - ctx := suite.consumerCtx() + ctx := s.consumerCtx() - channelID := suite.path.EndpointA.ChannelID + channelID := s.path.EndpointA.ChannelID // pick a cross-chain validator vals := consumerKeeper.GetAllCCValidator(ctx) @@ -443,7 +442,7 @@ func (suite *CCVTestSuite) TestValidatorDowntime() { // save next sequence before sending a slash packet seq, ok := consumerIBCKeeper.ChannelKeeper.GetNextSequenceSend( ctx, ccv.ConsumerPortID, channelID) - suite.Require().True(ok) + s.Require().True(ok) // Sign 100 blocks valPower := int64(1) @@ -454,7 +453,7 @@ func (suite *CCVTestSuite) TestValidatorDowntime() { } missedBlockThreshold := (2 * signedBlocksWindow) - consumerSlashingKeeper.MinSignedPerWindow(ctx) - ctx = suite.consumerCtx() + ctx = s.consumerCtx() // construct slash packet to be sent and get its commit packetData := ccv.NewSlashPacketData( @@ -463,7 +462,7 @@ func (suite *CCVTestSuite) TestValidatorDowntime() { consumerKeeper.GetHeightValsetUpdateID(ctx, uint64(missedBlockThreshold-sdk.ValidatorUpdateDelay-1)), stakingtypes.Downtime, ) - expCommit := suite.commitSlashPacket(ctx, *packetData) + expCommit := s.commitSlashPacket(ctx, *packetData) // Miss 50 blocks and expect a slash packet to be sent for ; height <= missedBlockThreshold; height++ { @@ -471,39 +470,39 @@ func (suite *CCVTestSuite) TestValidatorDowntime() { consumerSlashingKeeper.HandleValidatorSignature(ctx, vals[0].Address, valPower, false) } - ctx = suite.consumerCtx() + ctx = s.consumerCtx() // check validator signing info res, _ := consumerSlashingKeeper.GetValidatorSigningInfo(ctx, consAddr) // expect increased jail time - suite.Require().True(res.JailedUntil.Equal(ctx.BlockTime().Add(consumerSlashingKeeper.DowntimeJailDuration(ctx))), "did not update validator jailed until signing info") + s.Require().True(res.JailedUntil.Equal(ctx.BlockTime().Add(consumerSlashingKeeper.DowntimeJailDuration(ctx))), "did not update validator jailed until signing info") // expect missed block counters reseted - suite.Require().Zero(res.MissedBlocksCounter, "did not reset validator missed block counter") - suite.Require().Zero(res.IndexOffset) + s.Require().Zero(res.MissedBlocksCounter, "did not reset validator missed block counter") + s.Require().Zero(res.IndexOffset) consumerSlashingKeeper.IterateValidatorMissedBlockBitArray(ctx, consAddr, func(_ int64, missed bool) bool { - suite.Require().True(missed) + s.Require().True(missed) return false }) // check that slash packet is queued pendingPackets := consumerKeeper.GetPendingPackets(ctx) - suite.Require().NotEmpty(pendingPackets.List, "pending packets empty") - suite.Require().Len(pendingPackets.List, 1, "pending packets len should be 1 is %d", len(pendingPackets.List)) + s.Require().NotEmpty(pendingPackets.List, "pending packets empty") + s.Require().Len(pendingPackets.List, 1, "pending packets len should be 1 is %d", len(pendingPackets.List)) // clear queue, commit packets - suite.consumerApp.GetConsumerKeeper().SendPackets(ctx) + s.consumerApp.GetConsumerKeeper().SendPackets(ctx) // check queue was cleared - pendingPackets = suite.consumerApp.GetConsumerKeeper().GetPendingPackets(ctx) - suite.Require().Empty(pendingPackets.List, "pending packets NOT empty") + pendingPackets = s.consumerApp.GetConsumerKeeper().GetPendingPackets(ctx) + s.Require().Empty(pendingPackets.List, "pending packets NOT empty") // verify that the slash packet was sent gotCommit := consumerIBCKeeper.ChannelKeeper.GetPacketCommitment(ctx, ccv.ConsumerPortID, channelID, seq) - suite.Require().NotNil(gotCommit, "did not found slash packet commitment") - suite.Require().EqualValues(expCommit, gotCommit, "invalid slash packet commitment") + s.Require().NotNil(gotCommit, "did not found slash packet commitment") + s.Require().EqualValues(expCommit, gotCommit, "invalid slash packet commitment") // verify that the slash packet was sent - suite.Require().True(consumerKeeper.OutstandingDowntime(ctx, consAddr)) + s.Require().True(consumerKeeper.OutstandingDowntime(ctx, consAddr)) // check that the outstanding slashing flag prevents the jailed validator to keep missing block for ; height < missedBlockThreshold+signedBlocksWindow; height++ { @@ -513,25 +512,25 @@ func (suite *CCVTestSuite) TestValidatorDowntime() { res, _ = consumerSlashingKeeper.GetValidatorSigningInfo(ctx, consAddr) - suite.Require().Zero(res.MissedBlocksCounter, "did not reset validator missed block counter") - suite.Require().Zero(res.IndexOffset) + s.Require().Zero(res.MissedBlocksCounter, "did not reset validator missed block counter") + s.Require().Zero(res.IndexOffset) consumerSlashingKeeper.IterateValidatorMissedBlockBitArray(ctx, consAddr, func(_ int64, missed bool) bool { - suite.Require().True(missed, "did not reset validator missed block bit array") + s.Require().True(missed, "did not reset validator missed block bit array") return false }) } // TestValidatorDoubleSigning tests if a slash packet is sent // when a double-signing evidence is handled by the evidence module -func (suite *CCVTestSuite) TestValidatorDoubleSigning() { +func (s *CCVTestSuite) TestValidatorDoubleSigning() { // initial setup - suite.SetupCCVChannel(suite.path) - suite.SendEmptyVSCPacket() + s.SetupCCVChannel(s.path) + s.SendEmptyVSCPacket() // sync suite context after CCV channel is established - ctx := suite.consumerCtx() + ctx := s.consumerCtx() - channelID := suite.path.EndpointA.ChannelID + channelID := s.path.EndpointA.ChannelID // create a validator pubkey and address // note that the validator wont't necessarily be in valset to due the TM delay @@ -551,60 +550,60 @@ func (suite *CCVTestSuite) TestValidatorDoubleSigning() { } // add validator signing-info to the store - suite.consumerApp.GetE2eSlashingKeeper().SetValidatorSigningInfo(ctx, consAddr, slashingtypes.ValidatorSigningInfo{ + s.consumerApp.GetE2eSlashingKeeper().SetValidatorSigningInfo(ctx, consAddr, slashingtypes.ValidatorSigningInfo{ Address: consAddr.String(), Tombstoned: false, }) // save next sequence before sending a slash packet - seq, ok := suite.consumerApp.GetIBCKeeper().ChannelKeeper.GetNextSequenceSend(ctx, ccv.ConsumerPortID, channelID) - suite.Require().True(ok) + seq, ok := s.consumerApp.GetIBCKeeper().ChannelKeeper.GetNextSequenceSend(ctx, ccv.ConsumerPortID, channelID) + s.Require().True(ok) // construct slash packet data and get the expcted commit hash packetData := ccv.NewSlashPacketData( abci.Validator{Address: consAddr.Bytes(), Power: power}, - // get VSC ID mapping to the infraction height with the TM delay substracted - suite.consumerApp.GetConsumerKeeper().GetHeightValsetUpdateID(ctx, uint64(infractionHeight-sdk.ValidatorUpdateDelay)), + // get VSC ID mapping to the infraction height with the TM delay subtracted + s.consumerApp.GetConsumerKeeper().GetHeightValsetUpdateID(ctx, uint64(infractionHeight-sdk.ValidatorUpdateDelay)), stakingtypes.DoubleSign, ) - expCommit := suite.commitSlashPacket(ctx, *packetData) + expCommit := s.commitSlashPacket(ctx, *packetData) // expect to send slash packet when handling double-sign evidence - suite.consumerApp.GetE2eEvidenceKeeper().HandleEquivocationEvidence(ctx, e) + s.consumerApp.GetE2eEvidenceKeeper().HandleEquivocationEvidence(ctx, e) // check slash packet is queued - pendingPackets := suite.consumerApp.GetConsumerKeeper().GetPendingPackets(ctx) - suite.Require().NotEmpty(pendingPackets.List, "pending packets empty") - suite.Require().Len(pendingPackets.List, 1, "pending packets len should be 1 is %d", len(pendingPackets.List)) + pendingPackets := s.consumerApp.GetConsumerKeeper().GetPendingPackets(ctx) + s.Require().NotEmpty(pendingPackets.List, "pending packets empty") + s.Require().Len(pendingPackets.List, 1, "pending packets len should be 1 is %d", len(pendingPackets.List)) // clear queue, commit packets - suite.consumerApp.GetConsumerKeeper().SendPackets(ctx) + s.consumerApp.GetConsumerKeeper().SendPackets(ctx) // check queue was cleared - pendingPackets = suite.consumerApp.GetConsumerKeeper().GetPendingPackets(ctx) - suite.Require().Empty(pendingPackets.List, "pending packets NOT empty") + pendingPackets = s.consumerApp.GetConsumerKeeper().GetPendingPackets(ctx) + s.Require().Empty(pendingPackets.List, "pending packets NOT empty") // check slash packet is sent - gotCommit := suite.consumerApp.GetIBCKeeper().ChannelKeeper.GetPacketCommitment(ctx, ccv.ConsumerPortID, channelID, seq) - suite.NotNil(gotCommit) + gotCommit := s.consumerApp.GetIBCKeeper().ChannelKeeper.GetPacketCommitment(ctx, ccv.ConsumerPortID, channelID, seq) + s.NotNil(gotCommit) - suite.Require().EqualValues(expCommit, gotCommit) + s.Require().EqualValues(expCommit, gotCommit) } // TestQueueAndSendSlashPacket tests the integration of QueueSlashPacket with SendPackets. // In normal operation slash packets are queued in BeginBlock and sent in EndBlock. -func (suite *CCVTestSuite) TestQueueAndSendSlashPacket() { - suite.SetupCCVChannel(suite.path) +func (s *CCVTestSuite) TestQueueAndSendSlashPacket() { + s.SetupCCVChannel(s.path) - consumerKeeper := suite.consumerApp.GetConsumerKeeper() - consumerIBCKeeper := suite.consumerApp.GetIBCKeeper() + consumerKeeper := s.consumerApp.GetConsumerKeeper() + consumerIBCKeeper := s.consumerApp.GetIBCKeeper() - ctx := suite.consumerChain.GetContext() - channelID := suite.path.EndpointA.ChannelID + ctx := s.consumerChain.GetContext() + channelID := s.path.EndpointA.ChannelID // check that CCV channel isn't established _, ok := consumerKeeper.GetProviderChannel(ctx) - suite.Require().False(ok) + s.Require().False(ok) // expect to store 4 slash requests for downtime // and 4 slash request for double-signing @@ -619,7 +618,8 @@ func (suite *CCVTestSuite) TestQueueAndSendSlashPacket() { for i := 0; i < 4; i++ { addr := ed25519.GenPrivKey().PubKey().Address() val := abci.Validator{ - Address: addr} + Address: addr, + } consumerKeeper.QueueSlashPacket(ctx, val, 0, infraction) slashedVals = append(slashedVals, slashedVal{validator: val, infraction: infraction}) } @@ -635,26 +635,26 @@ func (suite *CCVTestSuite) TestQueueAndSendSlashPacket() { // verify that all requests are stored except for // the downtime slash request duplicates dataPackets := consumerKeeper.GetPendingPackets(ctx) - suite.Require().NotEmpty(dataPackets) - suite.Require().Len(dataPackets.GetList(), 12) + s.Require().NotEmpty(dataPackets) + s.Require().Len(dataPackets.GetList(), 12) // save consumer next sequence seq, _ := consumerIBCKeeper.ChannelKeeper.GetNextSequenceSend(ctx, ccv.ConsumerPortID, channelID) // establish ccv channel by sending an empty VSC packet to consumer endpoint - suite.SendEmptyVSCPacket() + s.SendEmptyVSCPacket() // check that each pending data packet is sent once for i := 0; i < 12; i++ { commit := consumerIBCKeeper.ChannelKeeper.GetPacketCommitment(ctx, ccv.ConsumerPortID, channelID, seq+uint64(i)) - suite.Require().NotNil(commit) + s.Require().NotNil(commit) } // check that outstanding downtime flags // are all set to true for validators slashed for downtime requests for i := 0; i < 4; i++ { consAddr := sdk.ConsAddress(slashedVals[i].validator.Address) - suite.Require().True(consumerKeeper.OutstandingDowntime(ctx, consAddr)) + s.Require().True(consumerKeeper.OutstandingDowntime(ctx, consAddr)) } // send all pending packets - only slash packets should be queued in this test @@ -662,6 +662,6 @@ func (suite *CCVTestSuite) TestQueueAndSendSlashPacket() { // check that pending data packets got cleared dataPackets = consumerKeeper.GetPendingPackets(ctx) - suite.Require().Empty(dataPackets) - suite.Require().Len(dataPackets.GetList(), 0) + s.Require().Empty(dataPackets) + s.Require().Len(dataPackets.GetList(), 0) } diff --git a/tests/e2e/stop_consumer.go b/tests/e2e/stop_consumer.go index 2f66f4f83d..29e5984f28 100644 --- a/tests/e2e/stop_consumer.go +++ b/tests/e2e/stop_consumer.go @@ -11,7 +11,6 @@ import ( // Tests the functionality of stopping a consumer chain at a higher level than unit tests func (s *CCVTestSuite) TestStopConsumerChain() { - providerKeeper := s.providerApp.GetProviderKeeper() providerStakingKeeper := s.providerApp.GetE2eStakingKeeper() @@ -55,7 +54,7 @@ func (s *CCVTestSuite) TestStopConsumerChain() { }, { func(suite *CCVTestSuite) error { - testShares, err = providerStakingKeeper.Delegate(s.providerCtx(), delAddr, bondAmt, stakingtypes.Unbonded, stakingtypes.Validator(validator), true) + testShares, err = providerStakingKeeper.Delegate(s.providerCtx(), delAddr, bondAmt, stakingtypes.Unbonded, validator, true) return err }, }, @@ -82,7 +81,6 @@ func (s *CCVTestSuite) TestStopConsumerChain() { }, { func(suite *CCVTestSuite) error { - // Queue slash and vsc packet data for consumer 0, these queue entries will be removed firstBundle := s.getFirstBundle() globalEntry := types.NewGlobalSlashEntry(s.providerCtx().BlockTime(), firstBundle.Chain.ChainID, 7, types.ProviderConsAddress{}) @@ -156,7 +154,7 @@ func (s *CCVTestSuite) TestStopConsumerOnChannelClosed() { // s.Require().NoError(err) // expect to panic in consumer chain's BeginBlock due to the above - //s.consumerChain.NextBlock() + // s.consumerChain.NextBlock() // check that the provider's channel is removed // _, found := s.consumerApp.GetConsumerKeeper().GetProviderChannel(s.consumerCtx()) @@ -188,7 +186,7 @@ func (s *CCVTestSuite) checkConsumerChainIsRemoved(chainID string, checkChannel // verify consumer chain's states are removed _, found := providerKeeper.GetConsumerGenesis(s.providerCtx(), chainID) s.Require().False(found) - _, found = providerKeeper.GetConsumerClientId(s.providerCtx(), chainID) + _, found = providerKeeper.GetConsumerClientID(s.providerCtx(), chainID) s.Require().False(found) _, found = providerKeeper.GetChainToChannel(s.providerCtx(), chainID) @@ -215,28 +213,27 @@ func (s *CCVTestSuite) checkConsumerChainIsRemoved(chainID string, checkChannel // TestProviderChannelClosed checks that a consumer chain panics // when the provider channel was established and then closed -func (suite *CCVTestSuite) TestProviderChannelClosed() { - - suite.SetupCCVChannel(suite.path) +func (s *CCVTestSuite) TestProviderChannelClosed() { + s.SetupCCVChannel(s.path) // establish provider channel with a first VSC packet - suite.SendEmptyVSCPacket() + s.SendEmptyVSCPacket() - consumerKeeper := suite.consumerApp.GetConsumerKeeper() + consumerKeeper := s.consumerApp.GetConsumerKeeper() - channelID, found := consumerKeeper.GetProviderChannel(suite.consumerChain.GetContext()) - suite.Require().True(found) + channelID, found := consumerKeeper.GetProviderChannel(s.consumerChain.GetContext()) + s.Require().True(found) // close provider channel - err := consumerKeeper.ChanCloseInit(suite.consumerChain.GetContext(), ccv.ConsumerPortID, channelID) - suite.Require().NoError(err) - suite.Require().True(consumerKeeper.IsChannelClosed(suite.consumerChain.GetContext(), channelID)) + err := consumerKeeper.ChanCloseInit(s.consumerChain.GetContext(), ccv.ConsumerPortID, channelID) + s.Require().NoError(err) + s.Require().True(consumerKeeper.IsChannelClosed(s.consumerChain.GetContext(), channelID)) // assert begin blocker did panics defer func() { if r := recover(); r != nil { return } - suite.Require().Fail("Begin blocker did not panic with a closed channel") + s.Require().Fail("Begin blocker did not panic with a closed channel") }() - suite.consumerApp.BeginBlocker(suite.consumerChain.GetContext(), abci.RequestBeginBlock{}) + s.consumerApp.BeginBlocker(s.consumerChain.GetContext(), abci.RequestBeginBlock{}) } diff --git a/tests/e2e/throttle.go b/tests/e2e/throttle.go index 1c19837a48..f43edb2eed 100644 --- a/tests/e2e/throttle.go +++ b/tests/e2e/throttle.go @@ -4,10 +4,9 @@ import ( "time" sdk "github.com/cosmos/cosmos-sdk/types" - sdktypes "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" - icstestingutils "github.com/cosmos/interchain-security/testutil/ibc_testing" + icstestingutils "github.com/cosmos/interchain-security/testutil/ibctesting" providertypes "github.com/cosmos/interchain-security/x/ccv/provider/types" ccvtypes "github.com/cosmos/interchain-security/x/ccv/types" tmtypes "github.com/tendermint/tendermint/types" @@ -16,7 +15,6 @@ import ( // TestBasicSlashPacketThrottling tests slash packet throttling with a single consumer, // two slash packets, and no VSC matured packets. The most basic scenario. func (s *CCVTestSuite) TestBasicSlashPacketThrottling() { - // setupValidatePowers gives the default 4 validators 25% power each (1000 power). // Note this in test cases. testCases := []struct { @@ -32,8 +30,8 @@ func (s *CCVTestSuite) TestBasicSlashPacketThrottling() { {"0.01", 40, -960, 30, 33}, // 960/30 = 32, so 33 replenishes to reach positive } + // Run test cases for _, tc := range testCases { - s.SetupTest() s.SetupAllCCVChannels() s.setupValidatorPowers() @@ -94,7 +92,6 @@ func (s *CCVTestSuite) TestBasicSlashPacketThrottling() { // Replenish slash meter until it is positive for i := 0; i < tc.expectedReplenishesTillPositive; i++ { - // Mutate cached context to have a block time after the current replenish candidate time. cacheCtx = s.getCtxAfterReplenishCandidate(cacheCtx) candidate := s.providerApp.GetProviderKeeper().GetSlashMeterReplenishTimeCandidate(cacheCtx) @@ -148,7 +145,6 @@ func (s *CCVTestSuite) TestBasicSlashPacketThrottling() { // TestMultiConsumerSlashPacketThrottling tests slash packet throttling in the context of multiple // consumers sending slash packets to the provider, with VSC matured packets sprinkled around. func (s *CCVTestSuite) TestMultiConsumerSlashPacketThrottling() { - // Setup test s.SetupAllCCVChannels() s.setupValidatorPowers() @@ -185,8 +181,8 @@ func (s *CCVTestSuite) TestMultiConsumerSlashPacketThrottling() { // They will each slash a different validator according to idx. idx = 0 valsToSlash := []tmtypes.Validator{} + // Send 2 VSC matured packets from every consumer to provider for _, bundle := range senderBundles { - // Setup signing info for validator to be jailed s.setDefaultValSigningInfo(*s.providerChain.Vals.Validators[idx]) @@ -271,7 +267,6 @@ func (s *CCVTestSuite) TestMultiConsumerSlashPacketThrottling() { // TestPacketSpam confirms that the provider can handle a large number of // incoming slash packets in a single block. func (s *CCVTestSuite) TestPacketSpam() { - // Setup ccv channels to all consumers s.SetupAllCCVChannels() @@ -334,7 +329,6 @@ func (s *CCVTestSuite) TestPacketSpam() { } func (s *CCVTestSuite) TestDoubleSignDoesNotAffectThrottling() { - // Setup ccv channels to all consumers s.SetupAllCCVChannels() @@ -399,7 +393,7 @@ func (s *CCVTestSuite) TestDoubleSignDoesNotAffectThrottling() { for _, val := range s.providerChain.Vals.Validators { power := stakingKeeper.GetLastValidatorPower(s.providerCtx(), sdk.ValAddress(val.Address)) s.Require().Equal(int64(1000), power) - stakingVal, found := stakingKeeper.GetValidatorByConsAddr(s.providerCtx(), sdktypes.ConsAddress(val.Address)) + stakingVal, found := stakingKeeper.GetValidatorByConsAddr(s.providerCtx(), sdk.ConsAddress(val.Address)) if !found { s.Require().Fail("validator not found") } @@ -423,7 +417,6 @@ func (s *CCVTestSuite) TestDoubleSignDoesNotAffectThrottling() { // Note: The global queue is ordered by: time, then IBC sequence number, see GlobalSlashEntryKey. // The chain specific queue is ordered by: IBC sequence number, see ThrottledPacketDataKey. func (s *CCVTestSuite) TestQueueOrdering() { - // Setup ccv channels to all consumers s.SetupAllCCVChannels() @@ -509,21 +502,21 @@ func (s *CCVTestSuite) TestQueueOrdering() { } // Confirm expected chain specific queue ordering. - expectedVscId := uint64(2000) + expectedVscID := uint64(2000) for _, slashPacket := range slashPacketData { // entries should be ordered by valset update id starting at 2000 - s.Require().Equal(expectedVscId, slashPacket.ValsetUpdateId) - expectedVscId++ - if (expectedVscId+5)%10 == 0 { + s.Require().Equal(expectedVscID, slashPacket.ValsetUpdateId) + expectedVscID++ + if (expectedVscID+5)%10 == 0 { // Skip over vsc matured packets - expectedVscId++ + expectedVscID++ } } for idx, vscMaturedPacket := range vscMaturedPacketData { // entries should be ordered by valset update id starting at 1005 // and show up every 10 packets - expectedVscId = uint64(1005) + 10*uint64(idx) - s.Require().Equal(expectedVscId, vscMaturedPacket.ValsetUpdateId) + expectedVscID = uint64(1005) + 10*uint64(idx) + s.Require().Equal(expectedVscID, vscMaturedPacket.ValsetUpdateId) } // Execute endblock to handle packets in throttled manner @@ -544,7 +537,7 @@ func (s *CCVTestSuite) TestQueueOrdering() { // Confirm total power is now 3000 once updated by staking end blocker s.providerChain.NextBlock() totalPower := s.providerApp.GetE2eStakingKeeper().GetLastTotalPower(s.providerCtx()) - s.Require().Equal(sdktypes.NewInt(3000), totalPower) + s.Require().Equal(sdk.NewInt(3000), totalPower) // Now change replenish frac to 0.67 and fully replenish the meter. params.SlashMeterReplenishFraction = "0.67" @@ -567,15 +560,14 @@ func (s *CCVTestSuite) TestQueueOrdering() { // TestSlashingSmallValidators tests that multiple slash packets from validators with small // power can be handled by the provider chain in a non-throttled manner. func (s *CCVTestSuite) TestSlashingSmallValidators() { - s.SetupAllCCVChannels() // Setup first val with 1000 power and the rest with 10 power. delAddr := s.providerChain.SenderAccount.GetAddress() - delegateByIdx(s, delAddr, sdktypes.NewInt(999999999), 0) - delegateByIdx(s, delAddr, sdktypes.NewInt(9999999), 1) - delegateByIdx(s, delAddr, sdktypes.NewInt(9999999), 2) - delegateByIdx(s, delAddr, sdktypes.NewInt(9999999), 3) + delegateByIdx(s, delAddr, sdk.NewInt(999999999), 0) + delegateByIdx(s, delAddr, sdk.NewInt(9999999), 1) + delegateByIdx(s, delAddr, sdk.NewInt(9999999), 2) + delegateByIdx(s, delAddr, sdk.NewInt(9999999), 3) s.providerChain.NextBlock() // Initialize slash meter @@ -649,7 +641,6 @@ func (s *CCVTestSuite) TestSlashMeterAllowanceChanges() { // but some of the slash packets are for the same validator, and therefore some packets // will be applied to a validator that is already jailed but still not unbonded (ie. still slashable). func (s *CCVTestSuite) TestSlashSameValidator() { - s.SetupAllCCVChannels() // Setup 4 validators with 25% of the total power each. @@ -704,7 +695,6 @@ func (s *CCVTestSuite) TestSlashSameValidator() { // the slash meter can allow any number of slash packets to be handled in a single block when // its allowance is set to "1.0". func (s CCVTestSuite) TestSlashAllValidators() { - s.SetupAllCCVChannels() // Setup 4 validators with 25% of the total power each. @@ -770,7 +760,6 @@ func (s CCVTestSuite) TestSlashAllValidators() { } func (s *CCVTestSuite) TestLeadingVSCMaturedAreDequeued() { - s.SetupAllCCVChannels() providerKeeper := s.providerApp.GetProviderKeeper() @@ -821,7 +810,7 @@ func (s *CCVTestSuite) TestLeadingVSCMaturedAreDequeued() { s.Require().Equal(len(globalEntries), 50*5) // Set slash meter to negative value to not allow any slash packets to be handled. - providerKeeper.SetSlashMeter(s.providerCtx(), sdktypes.NewInt(-1)) + providerKeeper.SetSlashMeter(s.providerCtx(), sdk.NewInt(-1)) // Set replenish time candidate so that no replenishment happens next block. providerKeeper.SetSlashMeterReplenishTimeCandidate(s.providerCtx()) @@ -841,7 +830,7 @@ func (s *CCVTestSuite) TestLeadingVSCMaturedAreDequeued() { func (s *CCVTestSuite) confirmValidatorJailed(tmVal tmtypes.Validator, checkPower bool) { sdkVal, found := s.providerApp.GetE2eStakingKeeper().GetValidator( - s.providerCtx(), sdktypes.ValAddress(tmVal.Address)) + s.providerCtx(), sdk.ValAddress(tmVal.Address)) s.Require().True(found) s.Require().True(sdkVal.IsJailed()) @@ -854,7 +843,7 @@ func (s *CCVTestSuite) confirmValidatorJailed(tmVal tmtypes.Validator, checkPowe func (s *CCVTestSuite) confirmValidatorNotJailed(tmVal tmtypes.Validator, expectedPower int64) { sdkVal, found := s.providerApp.GetE2eStakingKeeper().GetValidator( - s.providerCtx(), sdktypes.ValAddress(tmVal.Address)) + s.providerCtx(), sdk.ValAddress(tmVal.Address)) s.Require().True(found) valPower := s.providerApp.GetE2eStakingKeeper().GetLastValidatorPower( s.providerCtx(), sdkVal.GetOperator()) @@ -873,7 +862,7 @@ func (s *CCVTestSuite) replenishSlashMeterTillPositive() { } } -func (s *CCVTestSuite) getCtxAfterReplenishCandidate(ctx sdktypes.Context) sdktypes.Context { +func (s *CCVTestSuite) getCtxAfterReplenishCandidate(ctx sdk.Context) sdk.Context { providerKeeper := s.providerApp.GetProviderKeeper() candidate := providerKeeper.GetSlashMeterReplenishTimeCandidate(ctx) return ctx.WithBlockTime(candidate.Add(time.Minute)) diff --git a/tests/e2e/unbonding.go b/tests/e2e/unbonding.go index b5b02d896e..9f7e735c31 100644 --- a/tests/e2e/unbonding.go +++ b/tests/e2e/unbonding.go @@ -163,7 +163,7 @@ func (s *CCVTestSuite) TestUndelegationVscTimeout() { // check whether the chain was removed chainID := s.consumerChain.ChainID - _, found := providerKeeper.GetConsumerClientId(s.providerCtx(), chainID) + _, found := providerKeeper.GetConsumerClientID(s.providerCtx(), chainID) s.Require().Equal(false, found, "consumer chain was not removed") // check if the chain was properly removed @@ -300,7 +300,6 @@ func (s *CCVTestSuite) TestUndelegationDuringInit() { // Advance time so that provider's unbonding op completes // Check that unbonding has completed in provider staking func (s *CCVTestSuite) TestUnbondingNoConsumer() { - providerKeeper := s.providerApp.GetProviderKeeper() providerStakingKeeper := s.providerApp.GetE2eStakingKeeper() @@ -338,7 +337,6 @@ func (s *CCVTestSuite) TestUnbondingNoConsumer() { // TestRedelegationNoConsumer tests a redelegate transaction // submitted on a provider chain with no consumers func (s *CCVTestSuite) TestRedelegationNoConsumer() { - providerKeeper := s.providerApp.GetProviderKeeper() stakingKeeper := s.providerApp.GetE2eStakingKeeper() @@ -420,7 +418,7 @@ func (s *CCVTestSuite) TestRedelegationProviderFirst() { ) // Save the current valset update ID - valsetUpdateID := providerKeeper.GetValidatorSetUpdateId(s.providerCtx()) + valsetUpdateID := providerKeeper.GetValidatorSetUpdateID(s.providerCtx()) // Check that CCV unbonding op was created from AfterUnbondingInitiated hook checkCCVUnbondingOp(s, s.providerCtx(), s.consumerChain.ChainID, valsetUpdateID, true) diff --git a/tests/e2e/valset_update.go b/tests/e2e/valset_update.go index 2f5e6051cb..9489a08465 100644 --- a/tests/e2e/valset_update.go +++ b/tests/e2e/valset_update.go @@ -36,22 +36,21 @@ func (s *CCVTestSuite) TestPacketRoundtrip() { // TestQueueAndSendVSCMaturedPackets tests the behavior of EndBlock QueueVSCMaturedPackets call // and its integration with SendPackets call. -func (suite *CCVTestSuite) TestQueueAndSendVSCMaturedPackets() { - - consumerKeeper := suite.consumerApp.GetConsumerKeeper() +func (s *CCVTestSuite) TestQueueAndSendVSCMaturedPackets() { + consumerKeeper := s.consumerApp.GetConsumerKeeper() // setup CCV channel - suite.SetupCCVChannel(suite.path) + s.SetupCCVChannel(s.path) // send 3 packets to consumer chain at different times - pk, err := cryptocodec.FromTmPubKeyInterface(suite.providerChain.Vals.Validators[0].PubKey) - suite.Require().NoError(err) + pk, err := cryptocodec.FromTmPubKeyInterface(s.providerChain.Vals.Validators[0].PubKey) + s.Require().NoError(err) pk1, err := cryptocodec.ToTmProtoPublicKey(pk) - suite.Require().NoError(err) - pk, err = cryptocodec.FromTmPubKeyInterface(suite.providerChain.Vals.Validators[1].PubKey) - suite.Require().NoError(err) + s.Require().NoError(err) + pk, err = cryptocodec.FromTmPubKeyInterface(s.providerChain.Vals.Validators[1].PubKey) + s.Require().NoError(err) pk2, err := cryptocodec.ToTmProtoPublicKey(pk) - suite.Require().NoError(err) + s.Require().NoError(err) pd := ccv.NewValidatorSetChangePacketData( []abci.ValidatorUpdate{ @@ -69,65 +68,65 @@ func (suite *CCVTestSuite) TestQueueAndSendVSCMaturedPackets() { ) // send first packet - packet := channeltypes.NewPacket(pd.GetBytes(), 1, ccv.ProviderPortID, suite.path.EndpointB.ChannelID, ccv.ConsumerPortID, suite.path.EndpointA.ChannelID, + packet := channeltypes.NewPacket(pd.GetBytes(), 1, ccv.ProviderPortID, s.path.EndpointB.ChannelID, ccv.ConsumerPortID, s.path.EndpointA.ChannelID, clienttypes.NewHeight(1, 0), 0) - ack := consumerKeeper.OnRecvVSCPacket(suite.consumerChain.GetContext(), packet, pd) - suite.Require().NotNil(ack, "OnRecvVSCPacket did not return ack") - suite.Require().True(ack.Success(), "OnRecvVSCPacket did not return a Success Acknowledgment") + ack := consumerKeeper.OnRecvVSCPacket(s.consumerChain.GetContext(), packet, pd) + s.Require().NotNil(ack, "OnRecvVSCPacket did not return ack") + s.Require().True(ack.Success(), "OnRecvVSCPacket did not return a Success Acknowledgment") // increase time - incrementTime(suite, time.Hour) + incrementTime(s, time.Hour) // update time and send second packet pd.ValidatorUpdates[0].Power = 15 pd.ValsetUpdateId = 2 packet.Data = pd.GetBytes() packet.Sequence = 2 - ack = consumerKeeper.OnRecvVSCPacket(suite.consumerChain.GetContext(), packet, pd) - suite.Require().NotNil(ack, "OnRecvVSCPacket did not return ack") - suite.Require().True(ack.Success(), "OnRecvVSCPacket did not return a Success Acknowledgment") + ack = consumerKeeper.OnRecvVSCPacket(s.consumerChain.GetContext(), packet, pd) + s.Require().NotNil(ack, "OnRecvVSCPacket did not return ack") + s.Require().True(ack.Success(), "OnRecvVSCPacket did not return a Success Acknowledgment") // increase time - incrementTime(suite, 24*time.Hour) + incrementTime(s, 24*time.Hour) // update time and send third packet pd.ValidatorUpdates[1].Power = 40 pd.ValsetUpdateId = 3 packet.Data = pd.GetBytes() packet.Sequence = 3 - ack = consumerKeeper.OnRecvVSCPacket(suite.consumerChain.GetContext(), packet, pd) - suite.Require().NotNil(ack, "OnRecvVSCPacket did not return ack") - suite.Require().True(ack.Success(), "OnRecvVSCPacket did not return a Success Acknowledgment") + ack = consumerKeeper.OnRecvVSCPacket(s.consumerChain.GetContext(), packet, pd) + s.Require().NotNil(ack, "OnRecvVSCPacket did not return ack") + s.Require().True(ack.Success(), "OnRecvVSCPacket did not return a Success Acknowledgment") - packetMaturities := consumerKeeper.GetAllPacketMaturityTimes(suite.consumerChain.GetContext()) + packetMaturities := consumerKeeper.GetAllPacketMaturityTimes(s.consumerChain.GetContext()) // increase time such that first two packets are unbonded but third is not. - unbondingPeriod := consumerKeeper.GetUnbondingPeriod(suite.consumerChain.GetContext()) + unbondingPeriod := consumerKeeper.GetUnbondingPeriod(s.consumerChain.GetContext()) // increase time - incrementTime(suite, unbondingPeriod-time.Hour) + incrementTime(s, unbondingPeriod-time.Hour) // ensure first two packets are unbonded and VSCMatured packets are queued // unbonded time is deleted - suite.Require().False( + s.Require().False( consumerKeeper.PacketMaturityTimeExists( - suite.consumerChain.GetContext(), + s.consumerChain.GetContext(), packetMaturities[0].VscId, packetMaturities[0].MaturityTime, ), "maturity time not deleted for mature packet 1", ) - suite.Require().False( + s.Require().False( consumerKeeper.PacketMaturityTimeExists( - suite.consumerChain.GetContext(), + s.consumerChain.GetContext(), packetMaturities[1].VscId, packetMaturities[1].MaturityTime, ), "maturity time not deleted for mature packet 2", ) // ensure that third packet did not get unbonded and is still in store - suite.Require().True( + s.Require().True( consumerKeeper.PacketMaturityTimeExists( - suite.consumerChain.GetContext(), + s.consumerChain.GetContext(), packetMaturities[2].VscId, packetMaturities[2].MaturityTime, ), @@ -135,12 +134,12 @@ func (suite *CCVTestSuite) TestQueueAndSendVSCMaturedPackets() { ) // check that the packets are committed in state - commitments := suite.consumerApp.GetIBCKeeper().ChannelKeeper.GetAllPacketCommitmentsAtChannel( - suite.consumerChain.GetContext(), + commitments := s.consumerApp.GetIBCKeeper().ChannelKeeper.GetAllPacketCommitmentsAtChannel( + s.consumerChain.GetContext(), ccv.ConsumerPortID, - suite.path.EndpointA.ChannelID, + s.path.EndpointA.ChannelID, ) - suite.Require().Equal(2, len(commitments), "did not find packet commitments") - suite.Require().Equal(uint64(1), commitments[0].Sequence, "did not send VSCMatured packet for VSC packet 1") - suite.Require().Equal(uint64(2), commitments[1].Sequence, "did not send VSCMatured packet for VSC packet 2") + s.Require().Equal(2, len(commitments), "did not find packet commitments") + s.Require().Equal(uint64(1), commitments[0].Sequence, "did not send VSCMatured packet for VSC packet 1") + s.Require().Equal(uint64(2), commitments[1].Sequence, "did not send VSCMatured packet for VSC packet 2") } diff --git a/tests/integration/actions.go b/tests/integration/actions.go index 379488ab34..f82dd7bdfc 100644 --- a/tests/integration/actions.go +++ b/tests/integration/actions.go @@ -20,6 +20,8 @@ import ( "github.com/tidwall/gjson" ) +const done = "done!!!!!!!!" + type SendTokensAction struct { chain chainID from validatorID @@ -40,7 +42,7 @@ func (tr TestRun) sendTokens( tr.validatorConfigs[action.to].delAddress, fmt.Sprint(action.amount)+`stake`, - `--chain-id`, string(tr.chainConfigs[action.chain].chainId), + `--chain-id`, string(tr.chainConfigs[action.chain].chainID), `--home`, tr.getValidatorHome(action.chain, action.from), `--node`, tr.getValidatorNode(action.chain, action.from), `--keyring-backend`, `test`, @@ -51,7 +53,6 @@ func (tr TestRun) sendTokens( fmt.Println("sendTokens cmd:", cmd.String()) } bz, err := cmd.CombinedOutput() - if err != nil { log.Fatal(err, "\n", string(bz)) } @@ -80,10 +81,10 @@ func (tr TestRun) startChain( Mnemonic string `json:"mnemonic"` Allocation string `json:"allocation"` Stake string `json:"stake"` - ValId string `json:"val_id"` + ValID string `json:"val_id"` PrivValidatorKey string `json:"priv_validator_key"` NodeKey string `json:"node_key"` - IpSuffix string `json:"ip_suffix"` + IPSuffix string `json:"ip_suffix"` ConsumerMnemonic string `json:"consumer_mnemonic"` ConsumerPrivValidatorKey string `json:"consumer_priv_validator_key"` @@ -95,11 +96,11 @@ func (tr TestRun) startChain( validators = append(validators, jsonValAttrs{ Mnemonic: tr.validatorConfigs[val.id].mnemonic, NodeKey: tr.validatorConfigs[val.id].nodeKey, - ValId: fmt.Sprint(val.id), + ValID: fmt.Sprint(val.id), PrivValidatorKey: tr.validatorConfigs[val.id].privValidatorKey, Allocation: fmt.Sprint(val.allocation) + "stake", Stake: fmt.Sprint(val.stake) + "stake", - IpSuffix: tr.validatorConfigs[val.id].ipSuffix, + IPSuffix: tr.validatorConfigs[val.id].ipSuffix, ConsumerMnemonic: tr.validatorConfigs[val.id].consumerMnemonic, ConsumerPrivValidatorKey: tr.validatorConfigs[val.id].consumerPrivValidatorKey, @@ -124,7 +125,7 @@ func (tr TestRun) startChain( //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. cmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, "/bin/bash", "/testnet-scripts/start-chain.sh", chainConfig.binaryName, string(vals), - string(chainConfig.chainId), chainConfig.ipPrefix, genesisChanges, + string(chainConfig.chainID), chainConfig.ipPrefix, genesisChanges, fmt.Sprint(action.skipGentx), // override config/config.toml for each node on chain // usually timeout_commit and peer_gossip_sleep_duration are changed to vary the test run duration @@ -150,7 +151,7 @@ func (tr TestRun) startChain( if verbose { fmt.Println("startChain: " + out) } - if out == "done!!!!!!!!" { + if out == done { break } } @@ -175,10 +176,9 @@ type submitTextProposalAction struct { func (tr TestRun) submitTextProposal( action submitTextProposalAction, - verbose bool, + _ bool, ) { - //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - bz, err := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[action.chain].binaryName, + bz, err := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[action.chain].binaryName, //nolint:gosec // Bypass linter warning for spawning subprocess with cmd arguments. "tx", "gov", "submit-proposal", `--title`, action.title, @@ -187,14 +187,13 @@ func (tr TestRun) submitTextProposal( `--deposit`, fmt.Sprint(action.deposit)+`stake`, `--from`, `validator`+fmt.Sprint(action.from), - `--chain-id`, string(tr.chainConfigs[action.chain].chainId), + `--chain-id`, string(tr.chainConfigs[action.chain].chainID), `--home`, tr.getValidatorHome(action.chain, action.from), `--node`, tr.getValidatorNode(action.chain, action.from), `--keyring-backend`, `test`, `-b`, `block`, `-y`, ).CombinedOutput() - if err != nil { log.Fatal(err, "\n", string(bz)) } @@ -211,14 +210,14 @@ type submitConsumerAdditionProposalAction struct { func (tr TestRun) submitConsumerAdditionProposal( action submitConsumerAdditionProposalAction, - verbose bool, + _ bool, ) { spawnTime := tr.containerConfig.now.Add(time.Duration(action.spawnTime) * time.Millisecond) params := consumertypes.DefaultParams() prop := client.ConsumerAdditionProposalJSON{ Title: "Propose the addition of a new chain", Description: "Gonna be a great chain", - ChainId: string(tr.chainConfigs[action.consumerChain].chainId), + ChainID: string(tr.chainConfigs[action.consumerChain].chainID), InitialHeight: action.initialHeight, GenesisHash: []byte("gen_hash"), BinaryHash: []byte("bin_hash"), @@ -257,7 +256,7 @@ func (tr TestRun) submitConsumerAdditionProposal( "/temp-proposal.json", `--from`, `validator`+fmt.Sprint(action.from), - `--chain-id`, string(tr.chainConfigs[action.chain].chainId), + `--chain-id`, string(tr.chainConfigs[action.chain].chainID), `--home`, tr.getValidatorHome(action.chain, action.from), `--gas`, `900000`, `--node`, tr.getValidatorNode(action.chain, action.from), @@ -281,13 +280,13 @@ type submitConsumerRemovalProposalAction struct { func (tr TestRun) submitConsumerRemovalProposal( action submitConsumerRemovalProposalAction, - verbose bool, + _ bool, ) { stopTime := tr.containerConfig.now.Add(action.stopTimeOffset) prop := client.ConsumerRemovalProposalJSON{ Title: fmt.Sprintf("Stop the %v chain", action.consumerChain), Description: "It was a great chain", - ChainId: string(tr.chainConfigs[action.consumerChain].chainId), + ChainID: string(tr.chainConfigs[action.consumerChain].chainID), StopTime: stopTime, Deposit: fmt.Sprint(action.deposit) + `stake`, } @@ -317,7 +316,7 @@ func (tr TestRun) submitConsumerRemovalProposal( "/temp-proposal.json", `--from`, `validator`+fmt.Sprint(action.from), - `--chain-id`, string(tr.chainConfigs[action.chain].chainId), + `--chain-id`, string(tr.chainConfigs[action.chain].chainID), `--home`, tr.getValidatorHome(action.chain, action.from), `--node`, tr.getValidatorNode(action.chain, action.from), `--keyring-backend`, `test`, @@ -336,7 +335,7 @@ type submitParamChangeProposalAction struct { deposit uint subspace string key string - value interface{} + value any } type paramChangeProposalJSON struct { @@ -347,14 +346,14 @@ type paramChangeProposalJSON struct { } type paramChangeJSON struct { - Subspace string `json:"subspace"` - Key string `json:"key"` - Value interface{} `json:"value"` + Subspace string `json:"subspace"` + Key string `json:"key"` + Value any `json:"value"` } func (tr TestRun) submitParamChangeProposal( action submitParamChangeProposalAction, - verbose bool, + _ bool, ) { prop := paramChangeProposalJSON{ Title: "Param change", @@ -388,7 +387,7 @@ func (tr TestRun) submitParamChangeProposal( "/params-proposal.json", `--from`, `validator`+fmt.Sprint(action.from), - `--chain-id`, string(tr.chainConfigs[action.chain].chainId), + `--chain-id`, string(tr.chainConfigs[action.chain].chainID), `--home`, tr.getValidatorHome(action.chain, action.from), `--node`, tr.getValidatorNode(action.chain, action.from), `--gas`, "900000", @@ -412,7 +411,7 @@ type submitEquivocationProposalAction struct { from validatorID } -func (tr TestRun) submitEquivocationProposal(action submitEquivocationProposalAction, verbose bool) { +func (tr TestRun) submitEquivocationProposal(action submitEquivocationProposalAction, _ bool) { val := tr.validatorConfigs[action.validator] providerChain := tr.chainConfigs[chainID("provi")] @@ -457,9 +456,9 @@ func (tr TestRun) submitEquivocationProposal(action submitEquivocationProposalAc "/equivocation-proposal.json", `--from`, `validator`+fmt.Sprint(action.from), - `--chain-id`, string(providerChain.chainId), - `--home`, tr.getValidatorHome(providerChain.chainId, action.from), - `--node`, tr.getValidatorNode(providerChain.chainId, action.from), + `--chain-id`, string(providerChain.chainID), + `--home`, tr.getValidatorHome(providerChain.chainID, action.from), + `--node`, tr.getValidatorNode(providerChain.chainID, action.from), `--gas`, "9000000", `--keyring-backend`, `test`, `-b`, `block`, @@ -480,7 +479,7 @@ type voteGovProposalAction struct { func (tr TestRun) voteGovProposal( action voteGovProposalAction, - verbose bool, + _ bool, ) { var wg sync.WaitGroup for i, val := range action.from { @@ -488,14 +487,12 @@ func (tr TestRun) voteGovProposal( vote := action.vote[i] go func(val validatorID, vote string) { defer wg.Done() - //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - bz, err := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[action.chain].binaryName, - + bz, err := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[action.chain].binaryName, //nolint:gosec // Bypass linter warning for spawning subprocess with cmd arguments. "tx", "gov", "vote", fmt.Sprint(action.propNumber), vote, `--from`, `validator`+fmt.Sprint(val), - `--chain-id`, string(tr.chainConfigs[action.chain].chainId), + `--chain-id`, string(tr.chainConfigs[action.chain].chainID), `--home`, tr.getValidatorHome(action.chain, val), `--node`, tr.getValidatorNode(action.chain, val), `--keyring-backend`, `test`, @@ -503,7 +500,6 @@ func (tr TestRun) voteGovProposal( `-b`, `block`, `-y`, ).CombinedOutput() - if err != nil { log.Fatal(err, "\n", string(bz)) } @@ -528,7 +524,7 @@ func (tr TestRun) startConsumerChain( cmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[action.providerChain].binaryName, "query", "provider", "consumer-genesis", - string(tr.chainConfigs[action.consumerChain].chainId), + string(tr.chainConfigs[action.consumerChain].chainID), `--node`, tr.getQueryNode(action.providerChain), `-o`, `json`, @@ -539,7 +535,6 @@ func (tr TestRun) startConsumerChain( } bz, err := cmd.CombinedOutput() - if err != nil { log.Fatal(err, "\n", string(bz)) } @@ -590,10 +585,10 @@ websocket_addr = "%s" func (tr TestRun) addChainToRelayer( action addChainToRelayerAction, - verbose bool, + _ bool, ) { queryNodeIP := tr.getQueryNodeIP(action.chain) - chainId := tr.chainConfigs[action.chain].chainId + chainID := tr.chainConfigs[action.chain].chainID keyName := "query" rpcAddr := "http://" + queryNodeIP + ":26658" grpcAddr := "tcp://" + queryNodeIP + ":9091" @@ -601,7 +596,7 @@ func (tr TestRun) addChainToRelayer( chainConfig := fmt.Sprintf(hermesChainConfigTemplate, grpcAddr, - chainId, + chainID, keyName, rpcAddr, wsAddr, @@ -609,8 +604,7 @@ func (tr TestRun) addChainToRelayer( bashCommand := fmt.Sprintf(`echo '%s' >> %s`, chainConfig, "/root/.hermes/config.toml") - //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - bz, err := exec.Command("docker", "exec", tr.containerConfig.instanceName, "bash", "-c", + bz, err := exec.Command("docker", "exec", tr.containerConfig.instanceName, "bash", "-c", //nolint:gosec // G204 -- Bypass linter warning for spawning subprocess with cmd arguments. bashCommand, ).CombinedOutput() if err != nil { @@ -619,8 +613,8 @@ func (tr TestRun) addChainToRelayer( // Save mnemonic to file within container saveMnemonicCommand := fmt.Sprintf(`echo '%s' > %s`, tr.validatorConfigs[action.validator].mnemonic, "/root/.hermes/mnemonic.txt") - //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - bz, err = exec.Command("docker", "exec", tr.containerConfig.instanceName, "bash", "-c", + + bz, err = exec.Command("docker", "exec", tr.containerConfig.instanceName, "bash", "-c", //nolint:gosec // G204 -- Bypass linter warning for spawning subprocess with cmd arguments. saveMnemonicCommand, ).CombinedOutput() if err != nil { @@ -630,7 +624,7 @@ func (tr TestRun) addChainToRelayer( //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. bz, err = exec.Command("docker", "exec", tr.containerConfig.instanceName, "hermes", "keys", "add", - "--chain", string(tr.chainConfigs[action.chain].chainId), + "--chain", string(tr.chainConfigs[action.chain].chainID), "--mnemonic-file", "/root/.hermes/mnemonic.txt", ).CombinedOutput() @@ -653,7 +647,7 @@ func (tr TestRun) addIbcConnection( //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. cmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, "hermes", "create", "connection", - "--a-chain", string(tr.chainConfigs[action.chainA].chainId), + "--a-chain", string(tr.chainConfigs[action.chainA].chainID), "--a-client", "07-tendermint-"+fmt.Sprint(action.clientA), "--b-client", "07-tendermint-"+fmt.Sprint(action.clientB), ) @@ -675,7 +669,7 @@ func (tr TestRun) addIbcConnection( if verbose { fmt.Println("addIbcConnection: " + out) } - if out == "done!!!!!!!!" { + if out == done { break } } @@ -693,11 +687,10 @@ type addIbcChannelAction struct { order string } -type startHermesAction struct { -} +type startHermesAction struct{} func (tr TestRun) startHermes( - action startHermesAction, + _ startHermesAction, verbose bool, ) { // hermes start is running in detached mode @@ -722,7 +715,7 @@ func (tr TestRun) addIbcChannel( //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. cmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, "hermes", "create", "channel", - "--a-chain", string(tr.chainConfigs[action.chainA].chainId), + "--a-chain", string(tr.chainConfigs[action.chainA].chainID), "--a-connection", "connection-"+fmt.Sprint(action.connectionA), "--a-port", action.portA, "--b-port", action.portB, @@ -751,7 +744,7 @@ func (tr TestRun) addIbcChannel( if verbose { fmt.Println("addIBCChannel: " + out) } - if out == "done!!!!!!!!" { + if out == done { break } } @@ -773,13 +766,13 @@ type transferChannelCompleteAction struct { func (tr TestRun) transferChannelComplete( action transferChannelCompleteAction, - verbose bool, + _ bool, ) { //#nosec G204 -- Bypass linter warning for spawning subprocess with chanOpenTryCmd arguments. chanOpenTryCmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, "hermes", "tx", "chan-open-try", - "--dst-chain", string(tr.chainConfigs[action.chainB].chainId), - "--src-chain", string(tr.chainConfigs[action.chainA].chainId), + "--dst-chain", string(tr.chainConfigs[action.chainB].chainID), + "--src-chain", string(tr.chainConfigs[action.chainA].chainID), "--dst-connection", "connection-"+fmt.Sprint(action.connectionA), "--dst-port", action.portB, "--src-port", action.portA, @@ -790,8 +783,8 @@ func (tr TestRun) transferChannelComplete( //#nosec G204 -- Bypass linter warning for spawning subprocess with chanOpenAckCmd arguments. chanOpenAckCmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, "hermes", "tx", "chan-open-ack", - "--dst-chain", string(tr.chainConfigs[action.chainA].chainId), - "--src-chain", string(tr.chainConfigs[action.chainB].chainId), + "--dst-chain", string(tr.chainConfigs[action.chainA].chainID), + "--src-chain", string(tr.chainConfigs[action.chainB].chainID), "--dst-connection", "connection-"+fmt.Sprint(action.connectionA), "--dst-port", action.portA, "--src-port", action.portB, @@ -803,8 +796,8 @@ func (tr TestRun) transferChannelComplete( //#nosec G204 -- Bypass linter warning for spawning subprocess with chanOpenConfirmCmd arguments. chanOpenConfirmCmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, "hermes", "tx", "chan-open-confirm", - "--dst-chain", string(tr.chainConfigs[action.chainB].chainId), - "--src-chain", string(tr.chainConfigs[action.chainA].chainId), + "--dst-chain", string(tr.chainConfigs[action.chainB].chainID), + "--src-chain", string(tr.chainConfigs[action.chainA].chainID), "--dst-connection", "connection-"+fmt.Sprint(action.connectionA), "--dst-port", action.portB, "--src-port", action.portA, @@ -855,7 +848,7 @@ func (tr TestRun) relayPackets( // hermes clear packets ibc0 transfer channel-13 //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. cmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, "hermes", "clear", "packets", - "--chain", string(tr.chainConfigs[action.chain].chainId), + "--chain", string(tr.chainConfigs[action.chain].chainID), "--port", action.port, "--channel", "channel-"+fmt.Sprint(action.channel), ) @@ -863,7 +856,6 @@ func (tr TestRun) relayPackets( log.Println("relayPackets cmd:", cmd.String()) } bz, err := cmd.CombinedOutput() - if err != nil { log.Fatal(err, "\n", string(bz)) } @@ -914,7 +906,7 @@ func (tr TestRun) delegateTokens( fmt.Sprint(action.amount)+`stake`, `--from`, `validator`+fmt.Sprint(action.from), - `--chain-id`, string(tr.chainConfigs[action.chain].chainId), + `--chain-id`, string(tr.chainConfigs[action.chain].chainID), `--home`, tr.getValidatorHome(action.chain, action.from), `--node`, tr.getValidatorNode(action.chain, action.from), `--keyring-backend`, `test`, @@ -955,7 +947,7 @@ func (tr TestRun) unbondTokens( fmt.Sprint(action.amount)+`stake`, `--from`, `validator`+fmt.Sprint(action.sender), - `--chain-id`, string(tr.chainConfigs[action.chain].chainId), + `--chain-id`, string(tr.chainConfigs[action.chain].chainID), `--home`, tr.getValidatorHome(action.chain, action.sender), `--node`, tr.getValidatorNode(action.chain, action.sender), `--gas`, "900000", @@ -994,8 +986,7 @@ func (tr TestRun) redelegateTokens(action redelegateTokensAction, verbose bool) if action.chain != chainID("provi") && dstCfg.useConsumerKey { redelegateDst = dstCfg.consumerValoperAddress } - //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - cmd := exec.Command("docker", "exec", + cmd := exec.Command("docker", "exec", //nolint:gosec // Bypass linter warning for spawning subprocess with cmd arguments. tr.containerConfig.instanceName, tr.chainConfigs[action.chain].binaryName, @@ -1004,7 +995,7 @@ func (tr TestRun) redelegateTokens(action redelegateTokensAction, verbose bool) redelegateDst, fmt.Sprint(action.amount)+`stake`, `--from`, `validator`+fmt.Sprint(action.txSender), - `--chain-id`, string(tr.chainConfigs[action.chain].chainId), + `--chain-id`, string(tr.chainConfigs[action.chain].chainID), `--home`, tr.getValidatorHome(action.chain, action.txSender), `--node`, tr.getValidatorNode(action.chain, action.txSender), // Need to manually set gas limit past default (200000), since redelegate has a lot of operations @@ -1039,8 +1030,7 @@ func (tr TestRun) invokeDowntimeSlash(action downtimeSlashAction, verbose bool) } // Sets validator downtime by setting the virtual ethernet interface of a node to "up" or "down" -func (tr TestRun) setValidatorDowntime(chain chainID, validator validatorID, down bool, verbose bool) { - +func (tr TestRun) setValidatorDowntime(chain chainID, validator validatorID, down, verbose bool) { var lastArg string if down { lastArg = "down" @@ -1077,7 +1067,6 @@ type unjailValidatorAction struct { // Sends an unjail transaction to the provider chain func (tr TestRun) unjailValidator(action unjailValidatorAction, verbose bool) { - // wait a block to be sure downtime_jail_duration has elapsed tr.waitBlocks(action.provider, 1, time.Minute) @@ -1088,7 +1077,7 @@ func (tr TestRun) unjailValidator(action unjailValidatorAction, verbose bool) { "tx", "slashing", "unjail", // Validator is sender here `--from`, `validator`+fmt.Sprint(action.validator), - `--chain-id`, string(tr.chainConfigs[action.provider].chainId), + `--chain-id`, string(tr.chainConfigs[action.provider].chainID), `--home`, tr.getValidatorHome(action.provider, action.validator), `--node`, tr.getValidatorNode(action.provider, action.validator), `--gas`, "900000", @@ -1106,7 +1095,7 @@ func (tr TestRun) unjailValidator(action unjailValidatorAction, verbose bool) { } // wait for 1 blocks to make sure that tx got included - // in a block and packets commited before proceeding + // in a block and packets committed before proceeding tr.waitBlocks(action.provider, 1, time.Minute) } @@ -1118,7 +1107,7 @@ type registerRepresentativeAction struct { func (tr TestRun) registerRepresentative( action registerRepresentativeAction, - verbose bool, + _ bool, ) { var wg sync.WaitGroup for i, val := range action.representatives { @@ -1149,14 +1138,13 @@ func (tr TestRun) registerRepresentative( `--commission-max-change-rate`, "0.01", `--min-self-delegation`, "1", `--from`, `validator`+fmt.Sprint(val), - `--chain-id`, string(tr.chainConfigs[action.chain].chainId), + `--chain-id`, string(tr.chainConfigs[action.chain].chainID), `--home`, tr.getValidatorHome(action.chain, val), `--node`, tr.getValidatorNode(action.chain, val), `--keyring-backend`, `test`, `-b`, `block`, `-y`, ).CombinedOutput() - if err != nil { log.Fatal(err, "\n", string(bz)) } @@ -1184,14 +1172,13 @@ type doublesignSlashAction struct { func (tr TestRun) invokeDoublesignSlash( action doublesignSlashAction, - verbose bool, + _ bool, ) { chainConfig := tr.chainConfigs[action.chain] //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. bz, err := exec.Command("docker", "exec", tr.containerConfig.instanceName, "/bin/bash", "/testnet-scripts/cause-doublesign.sh", chainConfig.binaryName, string(action.validator), - string(chainConfig.chainId), chainConfig.ipPrefix).CombinedOutput() - + string(chainConfig.chainID), chainConfig.ipPrefix).CombinedOutput() if err != nil { log.Fatal(err, "\n", string(bz)) } @@ -1214,10 +1201,10 @@ func (tr TestRun) assignConsumerPubKey(action assignConsumerPubKeyAction, verbos assignKey := fmt.Sprintf( `%s tx provider assign-consensus-key %s '%s' --from validator%s --chain-id %s --home %s --node %s --gas 900000 --keyring-backend test -b block -y -o json`, tr.chainConfigs[chainID("provi")].binaryName, - string(tr.chainConfigs[action.chain].chainId), + string(tr.chainConfigs[action.chain].chainID), action.consumerPubkey, action.validator, - tr.chainConfigs[chainID("provi")].chainId, + tr.chainConfigs[chainID("provi")].chainID, tr.getValidatorHome(chainID("provi"), action.validator), tr.getValidatorNode(chainID("provi"), action.validator), ) @@ -1245,8 +1232,7 @@ func (tr TestRun) assignConsumerPubKey(action assignConsumerPubKeyAction, verbos } if action.expectError { - if code.Int() == 0 { - } else if verbose { + if verbose { fmt.Printf("got expected error during key assignment | code: %v | log: %s\n", code, rawLog) } } @@ -1284,7 +1270,7 @@ func (tr TestRun) assignConsumerPubKey(action assignConsumerPubKeyAction, verbos if verbose { fmt.Println("assign key - reconfigure: " + out) } - if out == "done!!!!!!!!" { + if out == done { break } } @@ -1312,7 +1298,6 @@ func (tr TestRun) waitForSlashThrottleDequeue( action slashThrottleDequeue, verbose bool, ) { - timeout := time.Now().Add(action.timeout) initialGlobalQueueSize := int(tr.getGlobalSlashQueueSize()) @@ -1326,7 +1311,8 @@ func (tr TestRun) waitForSlashThrottleDequeue( fmt.Printf("waiting for packed queue size to reach: %d - current: %d\n", action.nextQueueSize, globalQueueSize) } - if globalQueueSize == chainQueueSize && globalQueueSize == action.nextQueueSize { + // wait for both queues to reach the same size + if globalQueueSize == chainQueueSize && globalQueueSize == action.nextQueueSize { //nolint:gocritic // we're just waiting for the queues to reach the same size break } diff --git a/tests/integration/config.go b/tests/integration/config.go index f29d015863..8b1b38ca6f 100644 --- a/tests/integration/config.go +++ b/tests/integration/config.go @@ -7,8 +7,10 @@ import ( ) // TODO: Determine if user defined type (wrapping a primitive string) is desired in long run -type chainID string -type validatorID string +type ( + chainID string + validatorID string +) // Attributes that are unique to a validator. Allows us to map (part of) // the set of strings defined above to a set of viable validators @@ -37,7 +39,7 @@ type ValidatorConfig struct { // Attributes that are unique to a chain. Allows us to map (part of) // the set of strings defined above to a set of viable chains type ChainConfig struct { - chainId chainID + chainID chainID // Must be unique per chain ipPrefix string votingWaitTime uint @@ -147,7 +149,7 @@ func SlashThrottleTestRun() TestRun { validatorConfigs: getDefaultValidators(), chainConfigs: map[chainID]ChainConfig{ chainID("provi"): { - chainId: chainID("provi"), + chainID: chainID("provi"), binaryName: "interchain-security-pd", ipPrefix: "7.7.7", votingWaitTime: 20, @@ -162,7 +164,7 @@ func SlashThrottleTestRun() TestRun { ".app_state.provider.params.slash_meter_replenish_period = \"20s\"", }, chainID("consu"): { - chainId: chainID("consu"), + chainID: chainID("consu"), binaryName: "interchain-security-cd", ipPrefix: "7.7.8", votingWaitTime: 20, @@ -190,7 +192,7 @@ func DefaultTestRun() TestRun { validatorConfigs: getDefaultValidators(), chainConfigs: map[chainID]ChainConfig{ chainID("provi"): { - chainId: chainID("provi"), + chainID: chainID("provi"), binaryName: "interchain-security-pd", ipPrefix: "7.7.7", votingWaitTime: 20, @@ -205,7 +207,7 @@ func DefaultTestRun() TestRun { ".app_state.provider.params.slash_meter_replenish_period = \"3s\"", }, chainID("consu"): { - chainId: chainID("consu"), + chainID: chainID("consu"), binaryName: "interchain-security-cd", ipPrefix: "7.7.8", votingWaitTime: 20, @@ -233,7 +235,7 @@ func DemocracyTestRun() TestRun { validatorConfigs: getDefaultValidators(), chainConfigs: map[chainID]ChainConfig{ chainID("provi"): { - chainId: chainID("provi"), + chainID: chainID("provi"), binaryName: "interchain-security-pd", ipPrefix: "7.7.7", votingWaitTime: 20, @@ -247,7 +249,7 @@ func DemocracyTestRun() TestRun { ".app_state.provider.params.slash_meter_replenish_fraction = \"1.0\"", // This disables slash packet throttling }, chainID("democ"): { - chainId: chainID("democ"), + chainID: chainID("democ"), binaryName: "interchain-security-cdd", ipPrefix: "7.7.9", votingWaitTime: 20, @@ -276,7 +278,7 @@ func MultiConsumerTestRun() TestRun { validatorConfigs: getDefaultValidators(), chainConfigs: map[chainID]ChainConfig{ chainID("provi"): { - chainId: chainID("provi"), + chainID: chainID("provi"), binaryName: "interchain-security-pd", ipPrefix: "7.7.7", votingWaitTime: 20, @@ -290,7 +292,7 @@ func MultiConsumerTestRun() TestRun { ".app_state.provider.params.slash_meter_replenish_fraction = \"1.0\"", // This disables slash packet throttling }, chainID("consu"): { - chainId: chainID("consu"), + chainID: chainID("consu"), binaryName: "interchain-security-cd", ipPrefix: "7.7.8", votingWaitTime: 20, @@ -301,7 +303,7 @@ func MultiConsumerTestRun() TestRun { ".app_state.slashing.params.slash_fraction_downtime = \"0.010000000000000000\"", }, chainID("densu"): { - chainId: chainID("densu"), + chainID: chainID("densu"), binaryName: "interchain-security-cd", ipPrefix: "7.7.9", votingWaitTime: 20, @@ -317,7 +319,7 @@ func MultiConsumerTestRun() TestRun { } } -func (s *TestRun) SetDockerConfig(localSdkPath string, useGaia bool, gaiaTag string) { +func (tr *TestRun) SetDockerConfig(localSdkPath string, useGaia bool, gaiaTag string) { if localSdkPath != "" { fmt.Println("USING LOCAL SDK", localSdkPath) } @@ -325,9 +327,9 @@ func (s *TestRun) SetDockerConfig(localSdkPath string, useGaia bool, gaiaTag str fmt.Println("USING GAIA INSTEAD OF ICS provider app", gaiaTag) } - s.useGaia = useGaia - s.gaiaTag = gaiaTag - s.localSdkPath = localSdkPath + tr.useGaia = useGaia + tr.gaiaTag = gaiaTag + tr.localSdkPath = localSdkPath } // validateStringLiterals enforces that configs follow the constraints @@ -337,9 +339,9 @@ func (s *TestRun) SetDockerConfig(localSdkPath string, useGaia bool, gaiaTag str // within the container will be named as "$CHAIN_ID-$VAL_ID-out" etc. // where this name is constrained to 15 bytes or less. Therefore each string literal // used as a validatorID or chainID needs to be 5 char or less. -func (s *TestRun) validateStringLiterals() { - for valID, valConfig := range s.validatorConfigs { - +func (tr *TestRun) validateStringLiterals() { + // range through validators to check for duplicate ip suffixes + for valID, valConfig := range tr.validatorConfigs { if len(valID) > 5 { panic("validator id string literal must be 5 char or less") } @@ -362,12 +364,12 @@ func (s *TestRun) validateStringLiterals() { } } - for chainID, chainConfig := range s.chainConfigs { + for chainID, chainConfig := range tr.chainConfigs { if len(chainID) > 5 { panic("chain id string literal must be 5 char or less") } - if chainID != chainConfig.chainId { + if chainID != chainConfig.chainID { panic("chain config is mapped to a chain id that is different than what's stored in the config") } } diff --git a/tests/integration/main.go b/tests/integration/main.go index d2b4266ddd..786a920786 100644 --- a/tests/integration/main.go +++ b/tests/integration/main.go @@ -15,14 +15,19 @@ import ( "github.com/kylelemons/godebug/pretty" ) -var verbose = flag.Bool("verbose", false, "turn verbose logging on/off") -var happyPathOnly = flag.Bool("happy-path-only", false, "run happy path tests only") -var includeMultiConsumer = flag.Bool("include-multi-consumer", false, "include multiconsumer tests in run") -var parallel = flag.Bool("parallel", false, "run all tests in parallel") -var localSdkPath = flag.String("local-sdk-path", "", - "path of a local sdk version to build and reference in integration tests") -var useGaia = flag.Bool("use-gaia", false, "use gaia instead of ICS provider app") -var gaiaTag = flag.String("gaia-tag", "", "gaia tag to use - default is latest") +var ( + verbose = flag.Bool("verbose", false, "turn verbose logging on/off") + happyPathOnly = flag.Bool("happy-path-only", false, "run happy path tests only") + includeMultiConsumer = flag.Bool("include-multi-consumer", false, "include multiconsumer tests in run") + parallel = flag.Bool("parallel", false, "run all tests in parallel") + localSdkPath = flag.String("local-sdk-path", "", + "path of a local sdk version to build and reference in integration tests") +) + +var ( + useGaia = flag.Bool("use-gaia", false, "use gaia instead of ICS provider app") + gaiaTag = flag.String("gaia-tag", "", "gaia tag to use - default is latest") +) // runs integration tests // all docker containers are built sequentially to avoid race conditions when using local cosmos-sdk diff --git a/tests/integration/state.go b/tests/integration/state.go index ae35767f05..b40e7f25ef 100644 --- a/tests/integration/state.go +++ b/tests/integration/state.go @@ -39,7 +39,7 @@ type TextProposal struct { Status string } -func (p TextProposal) isProposal() {} +func (TextProposal) isProposal() {} type ConsumerAdditionProposal struct { Deposit uint @@ -49,7 +49,7 @@ type ConsumerAdditionProposal struct { Status string } -func (p ConsumerAdditionProposal) isProposal() {} +func (ConsumerAdditionProposal) isProposal() {} type ConsumerRemovalProposal struct { Deposit uint @@ -58,7 +58,7 @@ type ConsumerRemovalProposal struct { Status string } -func (p ConsumerRemovalProposal) isProposal() {} +func (ConsumerRemovalProposal) isProposal() {} type EquivocationProposal struct { Height uint @@ -68,15 +68,15 @@ type EquivocationProposal struct { Status string } -func (p EquivocationProposal) isProposal() {} +func (EquivocationProposal) isProposal() {} type Rewards struct { IsRewarded map[validatorID]bool - //if true it will calculate if the validator/delegator is rewarded between 2 successive blocks, - //otherwise it will calculate if it received any rewards since the 1st block + // if true it will calculate if the validator/delegator is rewarded between 2 successive blocks, + // otherwise it will calculate if it received any rewards since the 1st block IsIncrementalReward bool - //if true checks rewards for "stake" token, otherwise checks rewards from - //other chains (e.g. false is used to check if provider received rewards from a consumer chain) + // if true checks rewards for "stake" token, otherwise checks rewards from + // other chains (e.g. false is used to check if provider received rewards from a consumer chain) IsNativeDenom bool } @@ -88,7 +88,7 @@ type ParamsProposal struct { Value string } -func (p ParamsProposal) isProposal() {} +func (ParamsProposal) isProposal() {} type Param struct { Subspace string @@ -180,7 +180,6 @@ func (tr TestRun) getBlockHeight(chain chainID) uint { `--node`, tr.getQueryNode(chain), ).CombinedOutput() - if err != nil { log.Fatal(err, "\n", string(bz)) } @@ -273,7 +272,6 @@ func (tr TestRun) getRewards(chain chainID, modelState Rewards) Rewards { } func (tr TestRun) getReward(chain chainID, validator validatorID, blockHeight uint, isNativeDenom bool) float64 { - delAddresss := tr.validatorConfigs[validator].delAddress if chain != chainID("provi") && tr.validatorConfigs[validator].useConsumerKey { delAddresss = tr.validatorConfigs[validator].consumerDelAddress @@ -288,7 +286,6 @@ func (tr TestRun) getReward(chain chainID, validator validatorID, blockHeight ui `--node`, tr.getQueryNode(chain), `-o`, `json`, ).CombinedOutput() - if err != nil { log.Fatal(err, "\n", string(bz)) } @@ -317,7 +314,6 @@ func (tr TestRun) getBalance(chain chainID, validator validatorID) uint { `--node`, tr.getQueryNode(chain), `-o`, `json`, ).CombinedOutput() - if err != nil { log.Fatal(err, "\n", string(bz)) } @@ -367,12 +363,12 @@ func (tr TestRun) getProposal(chain chainID, proposal uint) Proposal { Description: description, } case "/interchain_security.ccv.provider.v1.ConsumerAdditionProposal": - chainId := gjson.Get(string(bz), `content.chain_id`).String() + chainIDvar := gjson.Get(string(bz), `content.chain_id`).String() spawnTime := gjson.Get(string(bz), `content.spawn_time`).Time().Sub(tr.containerConfig.now) var chain chainID for i, conf := range tr.chainConfigs { - if string(conf.chainId) == chainId { + if string(conf.chainID) == chainIDvar { chain = i break } @@ -389,12 +385,12 @@ func (tr TestRun) getProposal(chain chainID, proposal uint) Proposal { }, } case "/interchain_security.ccv.provider.v1.ConsumerRemovalProposal": - chainId := gjson.Get(string(bz), `content.chain_id`).String() + chainIDvar := gjson.Get(string(bz), `content.chain_id`).String() stopTime := gjson.Get(string(bz), `content.stop_time`).Time().Sub(tr.containerConfig.now) var chain chainID for i, conf := range tr.chainConfigs { - if string(conf.chainId) == chainId { + if string(conf.chainID) == chainIDvar { chain = i break } @@ -452,7 +448,6 @@ func (tr TestRun) getValPower(chain chainID, validator validatorID) uint { `--node`, tr.getQueryNode(chain), ).CombinedOutput() - if err != nil { log.Fatalf("error: %v", err) } @@ -474,10 +469,10 @@ func (tr TestRun) getValPower(chain chainID, validator validatorID) uint { valset.Total, uint(len(valset.Validators))) } + // Find validator in set. for _, val := range valset.Validators { if val.Address == tr.validatorConfigs[validator].valconsAddress || val.Address == tr.validatorConfigs[validator].consumerValconsAddress { - votingPower, err := strconv.Atoi(val.VotingPower) if err != nil { log.Fatalf("error: %v", err) @@ -501,7 +496,6 @@ func (tr TestRun) getRepresentativePower(chain chainID, validator validatorID) u `--node`, tr.getQueryNode(chain), `-o`, `json`, ).CombinedOutput() - if err != nil { log.Fatal(err, "\n", string(bz)) } @@ -522,7 +516,6 @@ func (tr TestRun) getParam(chain chainID, param Param) string { `--node`, tr.getQueryNode(chain), `-o`, `json`, ).CombinedOutput() - if err != nil { log.Fatal(err, "\n", string(bz)) } @@ -656,7 +649,7 @@ func (tr TestRun) getValidatorIP(chain chainID, validator validatorID) string { } func (tr TestRun) getValidatorHome(chain chainID, validator validatorID) string { - return `/` + string(tr.chainConfigs[chain].chainId) + `/validator` + fmt.Sprint(validator) + return `/` + string(tr.chainConfigs[chain].chainID) + `/validator` + fmt.Sprint(validator) } // getQueryNode returns query node tcp address on chain. diff --git a/tests/integration/step_delegation.go b/tests/integration/step_delegation.go index d1fb2e9de6..92f42dc77e 100644 --- a/tests/integration/step_delegation.go +++ b/tests/integration/step_delegation.go @@ -81,7 +81,7 @@ func stepsDelegate(consumerName string) []Step { } // stepsDelegate tests unbonding and resulting validator power changes. -func stepsUnbond(consumerName string) []Step { +func stepsUnbond() []Step { return []Step{ { action: unbondTokensAction{ diff --git a/tests/integration/steps.go b/tests/integration/steps.go index 448b6d3bce..3ead5a62ad 100644 --- a/tests/integration/steps.go +++ b/tests/integration/steps.go @@ -1,7 +1,7 @@ package main type Step struct { - action interface{} + action any state State } @@ -17,7 +17,7 @@ var happyPathSteps = concatSteps( stepsStartChains([]string{"consu"}, false), stepsDelegate("consu"), stepsAssignConsumerKeyOnStartedChain("consu", "bob"), - stepsUnbond("consu"), + stepsUnbond(), stepsRedelegate("consu"), stepsDowntime("consu"), stepsRejectEquivocationProposal("consu", 2), // prop to tombstone bob is rejected diff --git a/tests/integration/steps_democracy.go b/tests/integration/steps_democracy.go index fd01fc38a8..376b176c0c 100644 --- a/tests/integration/steps_democracy.go +++ b/tests/integration/steps_democracy.go @@ -35,7 +35,7 @@ func stepsDemocracy(consumerName string) []Step { }, state: State{ chainID(consumerName): ChainState{ - //Check that delegators on gov-consumer chain can change representative powers + // Check that delegators on gov-consumer chain can change representative powers RepresentativePowers: &map[validatorID]uint{ validatorID("alice"): 100500000, validatorID("bob"): 40000000, @@ -46,7 +46,7 @@ func stepsDemocracy(consumerName string) []Step { validatorID("bob"): 500, validatorID("carol"): 500, }, - //Check that tokens are minted and distributed to representatives and their delegators + // Check that tokens are minted and distributed to representatives and their delegators Rewards: &Rewards{ IsRewarded: map[validatorID]bool{ validatorID("alice"): true, @@ -87,7 +87,7 @@ func stepsDemocracy(consumerName string) []Step { }, }, { - //Have accounts vote on something on the gov-consumer chain + // Have accounts vote on something on the gov-consumer chain action: voteGovProposalAction{ chain: chainID(consumerName), from: []validatorID{validatorID("alice"), validatorID("bob")}, @@ -100,7 +100,7 @@ func stepsDemocracy(consumerName string) []Step { validatorID("alice"): 9899999999, validatorID("bob"): 9960000001, }, - //Check that the parameter is changed on gov-consumer chain + // Check that the parameter is changed on gov-consumer chain Params: &([]Param{{Subspace: "staking", Key: "MaxValidators", Value: "105"}}), }, }, @@ -114,7 +114,7 @@ func stepsDemocracy(consumerName string) []Step { }, state: State{ chainID("provi"): ChainState{ - //Check that tokens are minted and sent to provider chain and distributed to validators and their delegators on provider chain + // Check that tokens are minted and sent to provider chain and distributed to validators and their delegators on provider chain Rewards: &Rewards{ IsRewarded: map[validatorID]bool{ validatorID("alice"): true, @@ -228,7 +228,7 @@ func stepsDemocracy(consumerName string) []Step { validatorID("bob"): 500, validatorID("carol"): 500, }, - //Check that slashing on the gov-consumer chain does not result in slashing for the representatives or their delegators + // Check that slashing on the gov-consumer chain does not result in slashing for the representatives or their delegators RepresentativePowers: &map[validatorID]uint{ validatorID("alice"): 100500000, validatorID("bob"): 40000000, diff --git a/tests/integration/steps_downtime.go b/tests/integration/steps_downtime.go index 264035b572..d478b05052 100644 --- a/tests/integration/steps_downtime.go +++ b/tests/integration/steps_downtime.go @@ -6,7 +6,7 @@ import "time" // // Note: These steps are not affected by slash packet throttling since // only one consumer initiated slash is implemented. Throttling is also -// psuedo-disabled in this test by setting the slash meter replenish +// pseudo-disabled in this test by setting the slash meter replenish // fraction to 1.0 in the config file. // // No slashing should occur for downtime slash initiated from the consumer chain diff --git a/tests/integration/steps_multi_consumer_double_sign.go b/tests/integration/steps_multi_consumer_double_sign.go index 9d7859605d..a50f21e11f 100644 --- a/tests/integration/steps_multi_consumer_double_sign.go +++ b/tests/integration/steps_multi_consumer_double_sign.go @@ -5,7 +5,7 @@ package main // Note: These steps would be affected by slash packet throttling, since the // consumer-initiated slash steps are executed after consumer-initiated downtime // slashes have already occurred. However slash packet throttling is -// psuedo-disabled in this test by setting the slash meter replenish +// pseudo-disabled in this test by setting the slash meter replenish // fraction to 1.0 in the config file. // // only double sign on provider chain will cause slashing and tombstoning diff --git a/tests/integration/steps_multi_consumer_downtime.go b/tests/integration/steps_multi_consumer_downtime.go index 5ed66d52b7..181ced029f 100644 --- a/tests/integration/steps_multi_consumer_downtime.go +++ b/tests/integration/steps_multi_consumer_downtime.go @@ -328,7 +328,7 @@ func stepsMultiConsumerDowntimeFromProvider(consumer1, consumer2 string) []Step ValPowers: &map[validatorID]uint{ validatorID("alice"): 509, validatorID("bob"): 500, - validatorID("carol"): 495, // slashed because infraction was commited on provider + validatorID("carol"): 495, // slashed because infraction was committed on provider }, }, chainID(consumer1): ChainState{ diff --git a/tests/integration/steps_start_chains.go b/tests/integration/steps_start_chains.go index 336160092c..a53e7b4893 100644 --- a/tests/integration/steps_start_chains.go +++ b/tests/integration/steps_start_chains.go @@ -92,7 +92,7 @@ func stepsStartConsumerChain(consumerName string, proposalIndex, chainIndex uint state: State{}, }, { - // op should fail - key allready assigned by another validator + // op should fail - key already assigned by another validator action: assignConsumerPubKeyAction{ chain: chainID(consumerName), validator: validatorID("bob"), diff --git a/tests/integration/steps_stop_chain.go b/tests/integration/steps_stop_chain.go index 5884afe9f8..229b40b215 100644 --- a/tests/integration/steps_stop_chain.go +++ b/tests/integration/steps_stop_chain.go @@ -73,7 +73,6 @@ func stepsStopChain(consumerName string, propNumber uint) []Step { // the chain should not be removed func stepsConsumerRemovalPropNotPassing(consumerName string, propNumber uint) []Step { s := []Step{ - { action: submitConsumerRemovalProposalAction{ chain: chainID("provi"), diff --git a/testutil/crypto/crypto.go b/testutil/crypto/crypto.go index a27d7caece..1bf93fc421 100644 --- a/testutil/crypto/crypto.go +++ b/testutil/crypto/crypto.go @@ -18,40 +18,40 @@ import ( tmtypes "github.com/tendermint/tendermint/types" ) -// CryptoIdentity is a test helper for generating keys and addresses of +// Identity is a test helper for generating keys and addresses of // various interfaces and types used by the SDK and Tendermint from a single // 'root' seed. -type CryptoIdentity struct { +type Identity struct { // private key for validators to run consensus consensus sdkcryptotypes.PrivKey // key for validator operator account operator sdkcryptotypes.PrivKey } -func NewCryptoIdentityFromBytesSeed(seed []byte) *CryptoIdentity { +func NewCryptoIdentityFromBytesSeed(seed []byte) *Identity { //lint:ignore SA1019 We don't care because this is only a test. - consKey := &sdkcryptoEd25519.PrivKey{Key: cryptoEd25519.NewKeyFromSeed(seed)} + consKey := &sdkcryptoEd25519.PrivKey{Key: cryptoEd25519.NewKeyFromSeed(seed)} //nolint:staticcheck // SA1019: crypto/ed25519 is deprecated: Use golang.org/x/crypto/ed25519 instead. (staticcheck) opKey := sdkcryptoSecp256k1.GenPrivKeyFromSecret(seed) - return &CryptoIdentity{ + return &Identity{ consensus: consKey, operator: opKey, } } -func NewCryptoIdentityFromIntSeed(i int) *CryptoIdentity { +func NewCryptoIdentityFromIntSeed(i int) *Identity { iUint64 := uint64(i) seed := []byte("AAAAAAAAabcdefghijklmnopqrstuvwx") // 8+24 bytes binary.LittleEndian.PutUint64(seed[:8], iUint64) return NewCryptoIdentityFromBytesSeed(seed) } -func (v *CryptoIdentity) TMValidator(power int64) *tmtypes.Validator { +func (v *Identity) TMValidator(power int64) *tmtypes.Validator { return tmtypes.NewValidator(v.TMCryptoPubKey(), power) } -func (v *CryptoIdentity) TMProtoCryptoPublicKey() tmprotocrypto.PublicKey { +func (v *Identity) TMProtoCryptoPublicKey() tmprotocrypto.PublicKey { ret, err := sdkcryptocodec.ToTmProtoPublicKey(v.ConsensusSDKPubKey()) if err != nil { panic(err) @@ -59,7 +59,7 @@ func (v *CryptoIdentity) TMProtoCryptoPublicKey() tmprotocrypto.PublicKey { return ret } -func (v *CryptoIdentity) TMCryptoPubKey() tmcrypto.PubKey { +func (v *Identity) TMCryptoPubKey() tmcrypto.PubKey { ret, err := sdkcryptocodec.ToTmPubKeyInterface(v.ConsensusSDKPubKey()) if err != nil { panic(err) @@ -67,7 +67,7 @@ func (v *CryptoIdentity) TMCryptoPubKey() tmcrypto.PubKey { return ret } -func (v *CryptoIdentity) SDKStakingValidator() sdkstakingtypes.Validator { +func (v *Identity) SDKStakingValidator() sdkstakingtypes.Validator { ret, err := sdkstakingtypes.NewValidator(v.SDKValOpAddress(), v.ConsensusSDKPubKey(), sdkstakingtypes.Description{}) if err != nil { panic(err) @@ -75,32 +75,32 @@ func (v *CryptoIdentity) SDKStakingValidator() sdkstakingtypes.Validator { return ret } -func (v *CryptoIdentity) ConsensusSDKPubKey() sdkcryptotypes.PubKey { +func (v *Identity) ConsensusSDKPubKey() sdkcryptotypes.PubKey { return v.consensus.PubKey() } -func (v *CryptoIdentity) OperatorSDKPubKey() sdkcryptotypes.PubKey { +func (v *Identity) OperatorSDKPubKey() sdkcryptotypes.PubKey { return v.operator.PubKey() } -func (v *CryptoIdentity) SDKValOpAddress() sdktypes.ValAddress { +func (v *Identity) SDKValOpAddress() sdktypes.ValAddress { return sdktypes.ValAddress(v.OperatorSDKPubKey().Address()) } -func (v *CryptoIdentity) SDKValConsAddress() sdktypes.ConsAddress { +func (v *Identity) SDKValConsAddress() sdktypes.ConsAddress { return sdktypes.ConsAddress(v.ConsensusSDKPubKey().Address()) } // Returns the cons address of the crypto identity as a ProviderConsAddress. // In most cases, one crypto identity should NOT be casted to both a ProviderConsAddress and ConsumerConsAddress. // However, test intention is left to the caller. -func (v *CryptoIdentity) ProviderConsAddress() providertypes.ProviderConsAddress { +func (v *Identity) ProviderConsAddress() providertypes.ProviderConsAddress { return providertypes.NewProviderConsAddress(v.SDKValConsAddress()) } // Returns the cons address of the crypto identity as a ConsumerConsAddress. // In most cases, one crypto identity should NOT be casted to both a ProviderConsAddress and ConsumerConsAddress. // However, test intention is left to the caller. -func (v *CryptoIdentity) ConsumerConsAddress() providertypes.ConsumerConsAddress { +func (v *Identity) ConsumerConsAddress() providertypes.ConsumerConsAddress { return providertypes.NewConsumerConsAddress(v.SDKValConsAddress()) } diff --git a/testutil/e2e/debug_test.go b/testutil/e2e/debug_test.go index 75cf6b420f..6b83fed37b 100644 --- a/testutil/e2e/debug_test.go +++ b/testutil/e2e/debug_test.go @@ -10,13 +10,12 @@ import ( appConsumerDemocracy "github.com/cosmos/interchain-security/app/consumer-democracy" appProvider "github.com/cosmos/interchain-security/app/provider" "github.com/cosmos/interchain-security/tests/e2e" - icstestingutils "github.com/cosmos/interchain-security/testutil/ibc_testing" + icstestingutils "github.com/cosmos/interchain-security/testutil/ibctesting" ) // runCCVTestByName runs a single CCV e2e test by name, using a CCVTestSuite // initialized with the dummy provider and consumer defined in this repo. func runCCVTestByName(t *testing.T, methodName string) { - suite := e2e.NewCCVTestSuite[*appProvider.App, *appConsumer.App]( icstestingutils.ProviderAppIniter, icstestingutils.ConsumerAppIniter, []string{}) suite.SetT(t) @@ -29,7 +28,6 @@ func runCCVTestByName(t *testing.T, methodName string) { // using a ConsumerDemocracyTestSuite initialized with the dummy // democracy consumer defined in this repo. func runConsumerDemocracyTestByName(t *testing.T, methodName string) { - suite := e2e.NewConsumerDemocracyTestSuite[*appConsumerDemocracy.App]( icstestingutils.DemocracyConsumerAppIniter) suite.SetT(t) diff --git a/testutil/e2e/interfaces.go b/testutil/e2e/interfaces.go index a5b8e1962f..c80965e9b2 100644 --- a/testutil/e2e/interfaces.go +++ b/testutil/e2e/interfaces.go @@ -23,7 +23,7 @@ import ( // The interface that any provider app must implement to be compatible with ccv e2e tests. // This is a wrapper around the ibc testing app interface with additional constraints. type ProviderApp interface { - ibctesting.TestingApp + ibctesting.AppTest // // Keeper getters @@ -31,19 +31,19 @@ type ProviderApp interface { GetProviderKeeper() providerkeeper.Keeper // Returns a staking keeper interface with more capabilities than the expected_keepers interface - GetE2eStakingKeeper() E2eStakingKeeper + GetE2eStakingKeeper() StakingKeeper // Returns a bank keeper interface with more capabilities than the expected_keepers interface - GetE2eBankKeeper() E2eBankKeeper + GetE2eBankKeeper() BankKeeper // Returns a slashing keeper interface with more capabilities than the expected_keepers interface - GetE2eSlashingKeeper() E2eSlashingKeeper + GetE2eSlashingKeeper() SlashingKeeper // Returns a distribution keeper interface with more capabilities than the expected_keepers interface - GetE2eDistributionKeeper() E2eDistributionKeeper + GetE2eDistributionKeeper() DistributionKeeper } // The interface that any consumer app must implement to be compatible with e2e tests // This is a wrapper around the ibc testing app interface with additional constraints. type ConsumerApp interface { - ibctesting.TestingApp + ibctesting.AppTest BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock GetConsumerKeeper() consumerkeeper.Keeper @@ -54,25 +54,25 @@ type ConsumerApp interface { // // Returns a bank keeper interface with more capabilities than the expected_keepers interface - GetE2eBankKeeper() E2eBankKeeper + GetE2eBankKeeper() BankKeeper // Returns an account keeper interface with more capabilities than the expected_keepers interface - GetE2eAccountKeeper() E2eAccountKeeper + GetE2eAccountKeeper() AccountKeeper // Returns a slashing keeper interface with more capabilities than the expected_keepers interface - GetE2eSlashingKeeper() E2eSlashingKeeper + GetE2eSlashingKeeper() SlashingKeeper // Returns an evidence keeper interface with more capabilities than the expected_keepers interface - GetE2eEvidenceKeeper() E2eEvidenceKeeper + GetE2eEvidenceKeeper() EvidenceKeeper } type DemocConsumerApp interface { ConsumerApp // Returns a distribution keeper interface with more capabilities than the expected_keepers interface - GetE2eDistributionKeeper() E2eDistributionKeeper + GetE2eDistributionKeeper() DistributionKeeper // Returns a staking keeper interface with more capabilities than the expected_keepers interface - GetE2eStakingKeeper() E2eStakingKeeper + GetE2eStakingKeeper() StakingKeeper // Returns a mint keeper interface with more capabilities than the expected_keepers interface - GetE2eMintKeeper() E2eMintKeeper + GetE2eMintKeeper() MintKeeper // Returns a gov keeper interface with more capabilities than the expected_keepers interface - GetE2eGovKeeper() E2eGovKeeper + GetE2eGovKeeper() GovKeeper } // @@ -80,7 +80,7 @@ type DemocConsumerApp interface { // since e2e tests require extra functionality from external keepers. // -type E2eStakingKeeper interface { +type StakingKeeper interface { ccvtypes.StakingKeeper Delegate(ctx sdk.Context, delAddr sdk.AccAddress, bondAmt sdk.Int, tokenSrc types.BondStatus, validator types.Validator, subtractAccount bool) (newShares sdk.Dec, err error) @@ -100,18 +100,18 @@ type E2eStakingKeeper interface { GetValidatorSet() types.ValidatorSet } -type E2eBankKeeper interface { +type BankKeeper interface { ccvtypes.BankKeeper SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error } -type E2eAccountKeeper interface { +type AccountKeeper interface { ccvtypes.AccountKeeper GetParams(sdk.Context) authtypes.Params } -type E2eSlashingKeeper interface { +type SlashingKeeper interface { ccvtypes.SlashingKeeper SetValidatorSigningInfo(ctx sdk.Context, address sdk.ConsAddress, info slashingtypes.ValidatorSigningInfo) @@ -122,11 +122,11 @@ type E2eSlashingKeeper interface { address sdk.ConsAddress, handler func(index int64, missed bool) (stop bool)) } -type E2eEvidenceKeeper interface { +type EvidenceKeeper interface { HandleEquivocationEvidence(ctx sdk.Context, evidence *evidencetypes.Equivocation) } -type E2eDistributionKeeper interface { +type DistributionKeeper interface { GetFeePoolCommunityCoins(ctx sdk.Context) sdk.DecCoins GetDistributionAccount(ctx sdk.Context) authtypes.ModuleAccountI GetValidatorOutstandingRewards(ctx sdk.Context, @@ -134,11 +134,11 @@ type E2eDistributionKeeper interface { GetCommunityTax(ctx sdk.Context) (percent sdk.Dec) } -type E2eMintKeeper interface { +type MintKeeper interface { GetParams(ctx sdk.Context) (params minttypes.Params) } -type E2eGovKeeper interface { +type GovKeeper interface { GetDepositParams(ctx sdk.Context) govtypes.DepositParams GetVotingParams(ctx sdk.Context) govtypes.VotingParams SetVotingParams(ctx sdk.Context, votingParams govtypes.VotingParams) diff --git a/testutil/ibc_testing/specific_setup.go b/testutil/ibc_testing/specific_setup.go deleted file mode 100644 index be6b513323..0000000000 --- a/testutil/ibc_testing/specific_setup.go +++ /dev/null @@ -1,45 +0,0 @@ -package ibc_testing - -// Contains example setup code for running e2e tests against a provider, consumer, -// and/or democracy consumer app.go implementation. This file is meant to be pattern matched -// for apps running e2e tests against their implementation. - -import ( - "encoding/json" - - "github.com/cosmos/cosmos-sdk/simapp" - - ibctesting "github.com/cosmos/interchain-security/legacy_ibc_testing/testing" - - "github.com/tendermint/spm/cosmoscmd" - "github.com/tendermint/tendermint/libs/log" - tmdb "github.com/tendermint/tm-db" - - appConsumer "github.com/cosmos/interchain-security/app/consumer" - appConsumerDemocracy "github.com/cosmos/interchain-security/app/consumer-democracy" - appProvider "github.com/cosmos/interchain-security/app/provider" -) - -// ProviderAppIniter implements ibctesting.AppIniter for a provider app -func ProviderAppIniter() (ibctesting.TestingApp, map[string]json.RawMessage) { - encoding := cosmoscmd.MakeEncodingConfig(appProvider.ModuleBasics) - testApp := appProvider.New(log.NewNopLogger(), tmdb.NewMemDB(), nil, true, map[int64]bool{}, - simapp.DefaultNodeHome, 5, encoding, simapp.EmptyAppOptions{}).(ibctesting.TestingApp) - return testApp, appProvider.NewDefaultGenesisState(encoding.Marshaler) -} - -// ConsumerAppIniter implements ibctesting.AppIniter for a consumer app -func ConsumerAppIniter() (ibctesting.TestingApp, map[string]json.RawMessage) { - encoding := cosmoscmd.MakeEncodingConfig(appConsumer.ModuleBasics) - testApp := appConsumer.New(log.NewNopLogger(), tmdb.NewMemDB(), nil, true, map[int64]bool{}, - simapp.DefaultNodeHome, 5, encoding, simapp.EmptyAppOptions{}).(ibctesting.TestingApp) - return testApp, appConsumer.NewDefaultGenesisState(encoding.Marshaler) -} - -// DemocracyConsumerAppIniter implements ibctesting.AppIniter for a democracy consumer app -func DemocracyConsumerAppIniter() (ibctesting.TestingApp, map[string]json.RawMessage) { - encoding := cosmoscmd.MakeEncodingConfig(appConsumerDemocracy.ModuleBasics) - testApp := appConsumerDemocracy.New(log.NewNopLogger(), tmdb.NewMemDB(), nil, true, map[int64]bool{}, - simapp.DefaultNodeHome, 5, encoding, simapp.EmptyAppOptions{}).(ibctesting.TestingApp) - return testApp, appConsumerDemocracy.NewDefaultGenesisState(encoding.Marshaler) -} diff --git a/testutil/ibc_testing/generic_setup.go b/testutil/ibctesting/generic_setup.go similarity index 97% rename from testutil/ibc_testing/generic_setup.go rename to testutil/ibctesting/generic_setup.go index ff50760c2b..25682b9716 100644 --- a/testutil/ibc_testing/generic_setup.go +++ b/testutil/ibctesting/generic_setup.go @@ -1,4 +1,4 @@ -package ibc_testing +package ibctesting import ( "fmt" @@ -48,8 +48,8 @@ func (cb ConsumerBundle) GetKeeper() consumerkeeper.Keeper { // AddProvider adds a new provider chain to the coordinator and returns the test chain and app type func AddProvider[T e2eutil.ProviderApp](coordinator *ibctesting.Coordinator, t *testing.T, appIniter ibctesting.AppIniter) ( - *ibctesting.TestChain, T) { - + *ibctesting.TestChain, T, +) { provider := ibctesting.NewTestChain(t, coordinator, appIniter, provChainID) coordinator.Chains[provChainID] = provider @@ -63,8 +63,8 @@ func AddProvider[T e2eutil.ProviderApp](coordinator *ibctesting.Coordinator, t * // AddDemocracyConsumer adds a new democ consumer chain to the coordinator and returns the test chain and app type func AddDemocracyConsumer[T e2eutil.DemocConsumerApp](coordinator *ibctesting.Coordinator, t *testing.T, - appIniter ibctesting.AppIniter) (*ibctesting.TestChain, T) { - + appIniter ibctesting.AppIniter, +) (*ibctesting.TestChain, T) { democConsumer := ibctesting.NewTestChain(t, coordinator, appIniter, democConsumerChainID) coordinator.Chains[democConsumerChainID] = democConsumer diff --git a/testutil/ibctesting/specific_setup.go b/testutil/ibctesting/specific_setup.go new file mode 100644 index 0000000000..5bfe5dc8cc --- /dev/null +++ b/testutil/ibctesting/specific_setup.go @@ -0,0 +1,69 @@ +package ibctesting + +// Contains example setup code for running e2e tests against a provider, consumer, +// and/or democracy consumer app.go implementation. This file is meant to be pattern matched +// for apps running e2e tests against their implementation. + +import ( + "encoding/json" + + "github.com/cosmos/cosmos-sdk/simapp" + + cdappparams "github.com/cosmos/interchain-security/app/consumer-democracy/params" + consumerappparams "github.com/cosmos/interchain-security/app/consumer/params" + providerappparams "github.com/cosmos/interchain-security/app/provider/params" + ibctesting "github.com/cosmos/interchain-security/legacy_ibc_testing/testing" + + "github.com/tendermint/tendermint/libs/log" + tmdb "github.com/tendermint/tm-db" + + appConsumer "github.com/cosmos/interchain-security/app/consumer" + appConsumerDemocracy "github.com/cosmos/interchain-security/app/consumer-democracy" + appProvider "github.com/cosmos/interchain-security/app/provider" +) + +// ProviderAppIniter implements ibctesting.AppIniter for a provider app +func ProviderAppIniter() (ibctesting.AppTest, map[string]json.RawMessage) { + encoding := providerappparams.MakeEncodingConfig() + testApp := appProvider.New(log.NewNopLogger(), tmdb.NewMemDB(), nil, true, map[int64]bool{}, + simapp.DefaultNodeHome, 5, encoding, simapp.EmptyAppOptions{}) + return testApp, appProvider.NewDefaultGenesisState(encoding.Codec) +} + +// ConsumerAppIniter implements ibctesting.AppIniter for a consumer app +func ConsumerAppIniter() (ibctesting.AppTest, map[string]json.RawMessage) { + encoding := consumerappparams.MakeEncodingConfig() + testApp := appConsumer.New(log.NewNopLogger(), tmdb.NewMemDB(), nil, true, map[int64]bool{}, + simapp.DefaultNodeHome, 5, encoding, simapp.EmptyAppOptions{}) + return testApp, appConsumer.NewDefaultGenesisState(encoding.Codec) +} + +// DemocracyConsumerAppIniter implements ibctesting.AppIniter for a democracy consumer app +func DemocracyConsumerAppIniter() (ibctesting.AppTest, map[string]json.RawMessage) { + encoding := cdappparams.MakeEncodingConfig() + testApp := appConsumerDemocracy.New(log.NewNopLogger(), tmdb.NewMemDB(), nil, true, map[int64]bool{}, + simapp.DefaultNodeHome, 5, encoding, simapp.EmptyAppOptions{}) + return testApp, appConsumerDemocracy.NewDefaultGenesisState(encoding.Codec) +} + +// Previous state to help with debug + +// func ProviderAppIniter() (ibctesting.AppTest, map[string]json.RawMessage) { +// encoding := cosmoscmd.MakeEncodingConfig(appProvider.ModuleBasics) +// testApp := appProvider.New(log.NewNopLogger(), tmdb.NewMemDB(), nil, true, map[int64]bool{}, +// simapp.DefaultNodeHome, 5, encoding, simapp.EmptyAppOptions{}).(ibctesting.AppTest) +// return testApp, appProvider.NewDefaultGenesisState(encoding.Marshaler) +//} + +// func ConsumerAppIniter() (ibctesting.AppTest, map[string]json.RawMessage) { +// encoding := cosmoscmd.MakeEncodingConfig(appConsumer.ModuleBasics) +// testApp := appConsumer.New(log.NewNopLogger(), tmdb.NewMemDB(), nil, true, map[int64]bool{}, +// simapp.DefaultNodeHome, 5, encoding, simapp.EmptyAppOptions{}).(ibctesting.AppTest) +// return testApp, appConsumer.NewDefaultGenesisState(encoding.Marshaler) +//} + +// encoding := cosmoscmd.MakeEncodingConfig(appConsumerDemocracy.ModuleBasics) +// testApp := appConsumerDemocracy.New(log.NewNopLogger(), tmdb.NewMemDB(), nil, true, map[int64]bool{}, +// simapp.DefaultNodeHome, 5, encoding, simapp.EmptyAppOptions{}).(ibctesting.AppTest) +// return testApp, appConsumerDemocracy.NewDefaultGenesisState(encoding.Marshaler) +// } diff --git a/testutil/keeper/expectations.go b/testutil/keeper/expectations.go index c11a73f550..5eb33522d6 100644 --- a/testutil/keeper/expectations.go +++ b/testutil/keeper/expectations.go @@ -27,8 +27,8 @@ import ( // GetMocksForCreateConsumerClient returns mock expectations needed to call CreateConsumerClient(). func GetMocksForCreateConsumerClient(ctx sdk.Context, mocks *MockedKeepers, - expectedChainID string, expectedLatestHeight clienttypes.Height) []*gomock.Call { - + expectedChainID string, expectedLatestHeight clienttypes.Height, +) []*gomock.Call { // append MakeConsumerGenesis and CreateClient expectations expectations := GetMocksForMakeConsumerGenesis(ctx, mocks, time.Hour) createClientExp := mocks.MockClientKeeper.EXPECT().CreateClient( @@ -48,8 +48,8 @@ func GetMocksForCreateConsumerClient(ctx sdk.Context, mocks *MockedKeepers, // GetMocksForMakeConsumerGenesis returns mock expectations needed to call MakeConsumerGenesis(). func GetMocksForMakeConsumerGenesis(ctx sdk.Context, mocks *MockedKeepers, - unbondingTimeToInject time.Duration) []*gomock.Call { - + unbondingTimeToInject time.Duration, +) []*gomock.Call { return []*gomock.Call{ mocks.MockStakingKeeper.EXPECT().UnbondingTime(gomock.Any()).Return(unbondingTimeToInject).Times(1), @@ -62,7 +62,8 @@ func GetMocksForMakeConsumerGenesis(ctx sdk.Context, mocks *MockedKeepers, // GetMocksForSetConsumerChain returns mock expectations needed to call SetConsumerChain(). func GetMocksForSetConsumerChain(ctx sdk.Context, mocks *MockedKeepers, - chainIDToInject string) []*gomock.Call { + chainIDToInject string, +) []*gomock.Call { return []*gomock.Call{ mocks.MockChannelKeeper.EXPECT().GetChannel(ctx, ccv.ProviderPortID, gomock.Any()).Return( channeltypes.Channel{ @@ -81,7 +82,7 @@ func GetMocksForSetConsumerChain(ctx sdk.Context, mocks *MockedKeepers, } // GetMocksForStopConsumerChain returns mock expectations needed to call StopConsumerChain(). -func GetMocksForStopConsumerChain(ctx sdk.Context, mocks *MockedKeepers) []*gomock.Call { +func GetMocksForStopConsumerChain(mocks *MockedKeepers) []*gomock.Call { dummyCap := &capabilitytypes.Capability{} return []*gomock.Call{ mocks.MockChannelKeeper.EXPECT().GetChannel(gomock.Any(), ccv.ProviderPortID, "channelID").Return( @@ -94,11 +95,10 @@ func GetMocksForStopConsumerChain(ctx sdk.Context, mocks *MockedKeepers) []*gomo func GetMocksForHandleSlashPacket(ctx sdk.Context, mocks MockedKeepers, expectedProviderValConsAddr providertypes.ProviderConsAddress, - valToReturn stakingtypes.Validator, expectJailing bool) []*gomock.Call { - + valToReturn stakingtypes.Validator, expectJailing bool, +) []*gomock.Call { // These first two calls are always made. calls := []*gomock.Call{ - mocks.MockStakingKeeper.EXPECT().GetValidatorByConsAddr( ctx, expectedProviderValConsAddr.ToSdkConsAddr()).Return( valToReturn, true, diff --git a/testutil/keeper/unit_test_helpers.go b/testutil/keeper/unit_test_helpers.go index ab0eeef2ea..ffa08f34c3 100644 --- a/testutil/keeper/unit_test_helpers.go +++ b/testutil/keeper/unit_test_helpers.go @@ -20,7 +20,6 @@ import ( consumertypes "github.com/cosmos/interchain-security/x/ccv/consumer/types" providerkeeper "github.com/cosmos/interchain-security/x/ccv/provider/keeper" providertypes "github.com/cosmos/interchain-security/x/ccv/provider/types" - "github.com/cosmos/interchain-security/x/ccv/types" ccvtypes "github.com/cosmos/interchain-security/x/ccv/types" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" @@ -226,7 +225,7 @@ func SetupForStoppingConsumerChain(t *testing.T, ctx sdk.Context, expectations := GetMocksForCreateConsumerClient(ctx, &mocks, "chainID", clienttypes.NewHeight(4, 5)) expectations = append(expectations, GetMocksForSetConsumerChain(ctx, &mocks, "chainID")...) - expectations = append(expectations, GetMocksForStopConsumerChain(ctx, &mocks)...) + expectations = append(expectations, GetMocksForStopConsumerChain(&mocks)...) gomock.InOrder(expectations...) @@ -249,7 +248,7 @@ func GetTestConsumerAdditionProp() *providertypes.ConsumerAdditionProposal { consumertypes.DefaultConsumerRedistributeFrac, consumertypes.DefaultBlocksPerDistributionTransmission, consumertypes.DefaultHistoricalEntries, - types.DefaultCCVTimeoutPeriod, + ccvtypes.DefaultCCVTimeoutPeriod, consumertypes.DefaultTransferTimeoutPeriod, consumertypes.DefaultConsumerUnbondingPeriod, ).(*providertypes.ConsumerAdditionProposal) diff --git a/testutil/simibc/chain_util.go b/testutil/simibc/chain_util.go index ad94b6a919..a7ecf7f9de 100644 --- a/testutil/simibc/chain_util.go +++ b/testutil/simibc/chain_util.go @@ -17,7 +17,6 @@ import ( // // NOTE: this method may be used independently of the rest of simibc. func BeginBlock(c *ibctesting.TestChain, dt time.Duration) { - c.CurrentHeader = tmproto.Header{ ChainID: c.ChainID, Height: c.App.LastBlockHeight() + 1, diff --git a/testutil/simibc/ordered_outbox.go b/testutil/simibc/ordered_outbox.go index a408b0b9cc..f115141c4a 100644 --- a/testutil/simibc/ordered_outbox.go +++ b/testutil/simibc/ordered_outbox.go @@ -106,9 +106,9 @@ func (n OrderedOutbox) ConsumeAcks(sender string, num int) []Ack { // needs to have block h + 1 to be able to verify the packet in block h. func (n OrderedOutbox) Commit(sender string) { for i := range n.OutboxPackets[sender] { - n.OutboxPackets[sender][i].Commits += 1 + n.OutboxPackets[sender][i].Commits++ } for i := range n.OutboxAcks[sender] { - n.OutboxAcks[sender][i].Commits += 1 + n.OutboxAcks[sender][i].Commits++ } } diff --git a/testutil/simibc/relay_util.go b/testutil/simibc/relay_util.go index 97f402813d..b6cfd05580 100644 --- a/testutil/simibc/relay_util.go +++ b/testutil/simibc/relay_util.go @@ -20,8 +20,7 @@ import ( // must have a client of the sender chain that it can update. // // NOTE: this function MAY be used independently of the rest of simibc. -func UpdateReceiverClient(sender *ibctesting.Endpoint, receiver *ibctesting.Endpoint, header *ibctmtypes.Header) (err error) { - +func UpdateReceiverClient(sender, receiver *ibctesting.Endpoint, header *ibctmtypes.Header) (err error) { err = augmentHeader(sender.Chain, receiver.Chain, receiver.ClientID, header) if err != nil { @@ -66,24 +65,23 @@ func UpdateReceiverClient(sender *ibctesting.Endpoint, receiver *ibctesting.Endp // The packet must be sent from the sender chain to the receiver chain, and the // receiver chain must have a client for the sender chain which has been updated // to a recent height of the sender chain so that it can verify the packet. -func TryRecvPacket(sender *ibctesting.Endpoint, receiver *ibctesting.Endpoint, packet channeltypes.Packet) (ack []byte, err error) { +func TryRecvPacket(sender, receiver *ibctesting.Endpoint, packet channeltypes.Packet) (ack []byte, err error) { packetKey := host.PacketCommitmentKey(packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence()) proof, proofHeight := sender.Chain.QueryProof(packetKey) - RPmsg := channeltypes.NewMsgRecvPacket(packet, proof, proofHeight, receiver.Chain.SenderAccount.GetAddress().String()) + rpMsg := channeltypes.NewMsgRecvPacket(packet, proof, proofHeight, receiver.Chain.SenderAccount.GetAddress().String()) _, resWithAck, err := simapp.SignAndDeliver( receiver.Chain.T, receiver.Chain.TxConfig, receiver.Chain.App.GetBaseApp(), receiver.Chain.GetContext().BlockHeader(), - []sdk.Msg{RPmsg}, + []sdk.Msg{rpMsg}, receiver.Chain.ChainID, []uint64{receiver.Chain.SenderAccount.GetAccountNumber()}, []uint64{receiver.Chain.SenderAccount.GetSequence()}, true, true, receiver.Chain.SenderPrivKey, ) - if err != nil { return nil, err } @@ -109,7 +107,7 @@ func TryRecvPacket(sender *ibctesting.Endpoint, receiver *ibctesting.Endpoint, p // to packet which was previously delivered from the receiver to the sender. // The receiver chain must have a client for the sender chain which has been // updated to a recent height of the sender chain so that it can verify the packet. -func TryRecvAck(sender *ibctesting.Endpoint, receiver *ibctesting.Endpoint, packet channeltypes.Packet, ack []byte) (err error) { +func TryRecvAck(sender, receiver *ibctesting.Endpoint, packet channeltypes.Packet, ack []byte) (err error) { p := packet packetKey := host.PacketAcknowledgementKey(p.GetDestPort(), p.GetDestChannel(), p.GetSequence()) proof, proofHeight := sender.Chain.QueryProof(packetKey) @@ -143,8 +141,7 @@ func TryRecvAck(sender *ibctesting.Endpoint, receiver *ibctesting.Endpoint, pack // augmentHeader is a helper that augments the header with the height and validators that are most recently trusted // by the receiver chain. If there is an error, the header will not be modified. -func augmentHeader(sender *ibctesting.TestChain, receiver *ibctesting.TestChain, clientID string, header *ibctmtypes.Header) error { - +func augmentHeader(sender, receiver *ibctesting.TestChain, clientID string, header *ibctmtypes.Header) error { trustedHeight := receiver.GetClientState(clientID).GetLatestHeight().(clienttypes.Height) var ( diff --git a/testutil/simibc/relayed_path.go b/testutil/simibc/relayed_path.go index 33c4feab90..9d884159ab 100644 --- a/testutil/simibc/relayed_path.go +++ b/testutil/simibc/relayed_path.go @@ -1,9 +1,8 @@ package simibc import ( - "time" - "testing" + "time" ibctmtypes "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types" ibctesting "github.com/cosmos/interchain-security/legacy_ibc_testing/testing" diff --git a/x/ccv/consumer/ibc_module.go b/x/ccv/consumer/ibc_module.go index eadd6d7cea..af9c692257 100644 --- a/x/ccv/consumer/ibc_module.go +++ b/x/ccv/consumer/ibc_module.go @@ -15,7 +15,6 @@ import ( "github.com/cosmos/interchain-security/x/ccv/consumer/keeper" consumertypes "github.com/cosmos/interchain-security/x/ccv/consumer/types" providertypes "github.com/cosmos/interchain-security/x/ccv/provider/types" - "github.com/cosmos/interchain-security/x/ccv/types" ccv "github.com/cosmos/interchain-security/x/ccv/types" ) @@ -31,11 +30,10 @@ func (am AppModule) OnChanOpenInit( counterparty channeltypes.Counterparty, version string, ) (string, error) { - // set to the default version if the provided version is empty according to the ICS26 spec // https://github.com/cosmos/ibc/blob/main/spec/core/ics-026-routing-module/README.md#technical-specification if strings.TrimSpace(version) == "" { - version = types.Version + version = ccv.Version } // ensure provider channel hasn't already been created @@ -74,7 +72,7 @@ func (am AppModule) OnChanOpenInit( // validateCCVChannelParams validates a ccv channel func validateCCVChannelParams( ctx sdk.Context, - keeper keeper.Keeper, + ccvkeeper keeper.Keeper, order channeltypes.Order, portID string, version string, @@ -85,7 +83,7 @@ func validateCCVChannelParams( } // the port ID must match the port ID the CCV module is bounded to - boundPort := keeper.GetPort(ctx) + boundPort := ccvkeeper.GetPort(ctx) if boundPort != portID { return sdkerrors.Wrapf(porttypes.ErrInvalidPort, "invalid port: %s, expected %s", portID, boundPort) } @@ -98,15 +96,15 @@ func validateCCVChannelParams( } // OnChanOpenTry implements the IBCModule interface -func (am AppModule) OnChanOpenTry( - ctx sdk.Context, - order channeltypes.Order, - connectionHops []string, - portID, - channelID string, - chanCap *capabilitytypes.Capability, - counterparty channeltypes.Counterparty, - counterpartyVersion string, +func (AppModule) OnChanOpenTry( + _ sdk.Context, + _ channeltypes.Order, + _ []string, + _ string, + _ string, + _ *capabilitytypes.Capability, + _ channeltypes.Counterparty, + _ string, ) (string, error) { return "", sdkerrors.Wrap(ccv.ErrInvalidChannelFlow, "channel handshake must be initiated by consumer chain") } @@ -180,10 +178,10 @@ func (am AppModule) OnChanOpenAck( } // OnChanOpenConfirm implements the IBCModule interface -func (am AppModule) OnChanOpenConfirm( - ctx sdk.Context, - portID, - channelID string, +func (AppModule) OnChanOpenConfirm( + _ sdk.Context, + _ string, + _ string, ) error { return sdkerrors.Wrap(ccv.ErrInvalidChannelFlow, "channel handshake must be initiated by consumer chain") } @@ -191,7 +189,7 @@ func (am AppModule) OnChanOpenConfirm( // OnChanCloseInit implements the IBCModule interface func (am AppModule) OnChanCloseInit( ctx sdk.Context, - portID, + _ string, channelID string, ) error { // allow relayers to close duplicate OPEN channels, if the provider channel has already been established @@ -202,10 +200,10 @@ func (am AppModule) OnChanCloseInit( } // OnChanCloseConfirm implements the IBCModule interface -func (am AppModule) OnChanCloseConfirm( - ctx sdk.Context, - portID, - channelID string, +func (AppModule) OnChanCloseConfirm( + _ sdk.Context, + _ string, + _ string, ) error { return nil } @@ -285,12 +283,11 @@ func (am AppModule) OnAcknowledgementPacket( // OnTimeoutPacket implements the IBCModule interface // the CCV channel state is changed to CLOSED // by the IBC module as the channel is ORDERED -func (am AppModule) OnTimeoutPacket( +func (AppModule) OnTimeoutPacket( ctx sdk.Context, - packet channeltypes.Packet, + _ channeltypes.Packet, _ sdk.AccAddress, ) error { - ctx.EventManager().EmitEvent( sdk.NewEvent( ccv.EventTypeTimeout, diff --git a/x/ccv/consumer/ibc_module_test.go b/x/ccv/consumer/ibc_module_test.go index ac71b7cfaf..cff3ee1cb8 100644 --- a/x/ccv/consumer/ibc_module_test.go +++ b/x/ccv/consumer/ibc_module_test.go @@ -24,7 +24,6 @@ import ( // See: https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/methods.md#ccv-ccf-coinit1 // Spec tag: [CCV-CCF-COINIT.1] func TestOnChanOpenInit(t *testing.T) { - // Params for the OnChanOpenInit method type params struct { ctx sdk.Context @@ -119,8 +118,8 @@ func TestOnChanOpenInit(t *testing.T) { }, } + // Run test cases for _, tc := range testCases { - // Common setup consumerKeeper, ctx, ctrl, mocks := testkeeper.GetConsumerKeeperAndCtx( t, testkeeper.NewInMemKeeperParams(t)) @@ -173,7 +172,6 @@ func TestOnChanOpenInit(t *testing.T) { // See: https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/methods.md#ccv-ccf-cotry1 // Spec tag: [CCV-CCF-COTRY.1] func TestOnChanOpenTry(t *testing.T) { - consumerKeeper, ctx, ctrl, _ := testkeeper.GetConsumerKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) // No external keeper methods should be called defer ctrl.Finish() @@ -198,7 +196,6 @@ func TestOnChanOpenTry(t *testing.T) { // See: https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/methods.md#ccv-ccf-coack1 // Spec tag: [CCV-CCF-COACK.1] func TestOnChanOpenAck(t *testing.T) { - // Params for the OnChanOpenAck method type params struct { ctx sdk.Context @@ -332,7 +329,6 @@ func TestOnChanOpenConfirm(t *testing.T) { // See: https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/methods.md#ccv-ccf-ccinit1 // Spec tag: [CCV-CCF-CCINIT.1] func TestOnChanCloseInit(t *testing.T) { - testCases := []struct { name string channelToClose string @@ -383,7 +379,6 @@ func TestOnChanCloseInit(t *testing.T) { // See: https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/methods.md#ccv-pcf-ccconfirm1// Spec tag: [CCV-CCF-CCINIT.1] // Spec tag: [CCV-PCF-CCCONFIRM.1] func TestOnChanCloseConfirm(t *testing.T) { - consumerKeeper, ctx, ctrl, _ := testkeeper.GetConsumerKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) // No external keeper methods should be called diff --git a/x/ccv/consumer/keeper/distribution.go b/x/ccv/consumer/keeper/distribution.go index f2a534cd14..f2a499d21e 100644 --- a/x/ccv/consumer/keeper/distribution.go +++ b/x/ccv/consumer/keeper/distribution.go @@ -173,7 +173,8 @@ func (k Keeper) SetLastTransmissionBlockHeight(ctx sdk.Context, ltbh types.LastT } func (k Keeper) ChannelOpenInit(ctx sdk.Context, msg *channeltypes.MsgChannelOpenInit) ( - *channeltypes.MsgChannelOpenInitResponse, error) { + *channeltypes.MsgChannelOpenInitResponse, error, +) { return k.ibcCoreKeeper.ChannelOpenInit(sdk.WrapSDKContext(ctx), msg) } diff --git a/x/ccv/consumer/keeper/genesis.go b/x/ccv/consumer/keeper/genesis.go index b97a5d00f8..46864a421c 100644 --- a/x/ccv/consumer/keeper/genesis.go +++ b/x/ccv/consumer/keeper/genesis.go @@ -53,7 +53,6 @@ func (k Keeper) InitGenesis(ctx sdk.Context, state *consumertypes.GenesisState) // set default value for valset update ID k.SetHeightValsetUpdateID(ctx, uint64(ctx.BlockHeight()), uint64(0)) - } else { // chain restarts with the CCV channel established if state.ProviderChannelId != "" { @@ -71,7 +70,6 @@ func (k Keeper) InitGenesis(ctx sdk.Context, state *consumertypes.GenesisState) } k.SetOutstandingDowntime(ctx, consAddr) } - // set last transmission block height k.SetLastTransmissionBlockHeight(ctx, state.LastTransmissionBlockHeight) } @@ -87,12 +85,10 @@ func (k Keeper) InitGenesis(ctx sdk.Context, state *consumertypes.GenesisState) // set provider client id k.SetProviderClientID(ctx, state.ProviderClientId) - } // populate cross chain validators states with initial valset k.ApplyCCValidatorChanges(ctx, state.InitialValSet) - return state.InitialValSet } @@ -147,5 +143,5 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) (genesis *consumertypes.GenesisSt ) } - return + return genesis } diff --git a/x/ccv/consumer/keeper/genesis_test.go b/x/ccv/consumer/keeper/genesis_test.go index 3460a8617c..dbe5d0334f 100644 --- a/x/ccv/consumer/keeper/genesis_test.go +++ b/x/ccv/consumer/keeper/genesis_test.go @@ -26,7 +26,6 @@ import ( // It covers the start of a new chain, the restart of a chain during the CCV channel handshake // and finally the restart of chain when the CCV channel is already established. func TestInitGenesis(t *testing.T) { - // mock the consumer genesis state values provClientID := "tendermint-07" provChannelID := "ChannelID" @@ -45,7 +44,7 @@ func TestInitGenesis(t *testing.T) { provConsState := ibctmtypes.NewConsensusState( time.Time{}, commitmenttypes.NewMerkleRoot([]byte("apphash")), - tmtypes.NewValidatorSet([]*tmtypes.Validator{validator}).Hash()[:], + tmtypes.NewValidatorSet([]*tmtypes.Validator{validator}).Hash(), ) provClientState := ibctmtypes.NewClientState( @@ -87,7 +86,7 @@ func TestInitGenesis(t *testing.T) { defaultHeightValsetUpdateIDs := []consumertypes.HeightToValsetUpdateID{ {ValsetUpdateId: vscID, Height: blockHeight}, } - updatedHeightValsetUpdateIDs := append(defaultHeightValsetUpdateIDs, + updatedHeightValsetUpdateIDs := append(defaultHeightValsetUpdateIDs, //nolint:gocritic // we mean to append to another slice consumertypes.HeightToValsetUpdateID{ValsetUpdateId: vscID + 1, Height: blockHeight + 1}, ) @@ -224,7 +223,6 @@ func TestInitGenesis(t *testing.T) { // TestExportGenesis tests that a consumer chain genesis is correctly exported to genesis // It covers the restart of chain when a CCV channel is or isn't established yet. func TestExportGenesis(t *testing.T) { - // create provider channel and client ids provClientID := "tendermint-07" provChannelID := "provChannelID" @@ -268,7 +266,7 @@ func TestExportGenesis(t *testing.T) { defaultHeightValsetUpdateIDs := []consumertypes.HeightToValsetUpdateID{ {ValsetUpdateId: vscID, Height: blockHeight}, } - updatedHeightValsetUpdateIDs := append(defaultHeightValsetUpdateIDs, + updatedHeightValsetUpdateIDs := append(defaultHeightValsetUpdateIDs, //nolint:gocritic // we mean to append to another slice consumertypes.HeightToValsetUpdateID{ValsetUpdateId: vscID + 1, Height: blockHeight + 1}, ) ltbh := consumertypes.LastTransmissionBlockHeight{Height: int64(1000)} @@ -296,7 +294,6 @@ func TestExportGenesis(t *testing.T) { ck.AppendPendingPacket(ctx, consPackets.List...) ck.SetHeightValsetUpdateID(ctx, defaultHeightValsetUpdateIDs[0].Height, defaultHeightValsetUpdateIDs[0].ValsetUpdateId) - }, consumertypes.NewRestartGenesisState( provClientID, @@ -350,7 +347,6 @@ func TestExportGenesis(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - keeperParams := testkeeper.NewInMemKeeperParams(t) // Explicitly register codec with public key interface keeperParams.RegisterSdkCryptoCodecInterfaces() diff --git a/x/ccv/consumer/keeper/grpc_query.go b/x/ccv/consumer/keeper/grpc_query.go index f30f93133a..b82b3db7e4 100644 --- a/x/ccv/consumer/keeper/grpc_query.go +++ b/x/ccv/consumer/keeper/grpc_query.go @@ -12,8 +12,8 @@ import ( var _ types.QueryServer = Keeper{} func (k Keeper) QueryNextFeeDistribution(c context.Context, - req *types.QueryNextFeeDistributionEstimateRequest) (*types.QueryNextFeeDistributionEstimateResponse, error) { - + req *types.QueryNextFeeDistributionEstimateRequest, +) (*types.QueryNextFeeDistributionEstimateResponse, error) { ctx := sdk.UnwrapSDKContext(c) if req == nil { @@ -26,8 +26,8 @@ func (k Keeper) QueryNextFeeDistribution(c context.Context, } func (k Keeper) QueryParams(c context.Context, - req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { - + req *types.QueryParamsRequest, +) (*types.QueryParamsResponse, error) { ctx := sdk.UnwrapSDKContext(c) if req == nil { diff --git a/x/ccv/consumer/keeper/hooks.go b/x/ccv/consumer/keeper/hooks.go index 791164cb4e..5643d15cb2 100644 --- a/x/ccv/consumer/keeper/hooks.go +++ b/x/ccv/consumer/keeper/hooks.go @@ -5,9 +5,7 @@ import ( ccv "github.com/cosmos/interchain-security/x/ccv/types" ) -var ( - _ ccv.ConsumerHooks = Keeper{} -) +var _ ccv.ConsumerHooks = Keeper{} // Hooks wrapper struct for ConsumerKeeper type Hooks struct { diff --git a/x/ccv/consumer/keeper/keeper.go b/x/ccv/consumer/keeper/keeper.go index cf59cf372b..8734661ff7 100644 --- a/x/ccv/consumer/keeper/keeper.go +++ b/x/ccv/consumer/keeper/keeper.go @@ -18,7 +18,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/interchain-security/x/ccv/consumer/types" - consumertypes "github.com/cosmos/interchain-security/x/ccv/consumer/types" ccv "github.com/cosmos/interchain-security/x/ccv/types" "github.com/cosmos/interchain-security/x/ccv/utils" "github.com/tendermint/tendermint/libs/log" @@ -84,7 +83,6 @@ func NewKeeper( // Validates that the consumer keeper is initialized with non-zero and // non-nil values for all its fields. Otherwise this method will panic. func (k Keeper) mustValidateFields() { - // Ensures no fields are missed in this validation if reflect.ValueOf(k).NumField() != 15 { panic("number of fields in provider keeper is not 15") @@ -109,7 +107,7 @@ func (k Keeper) mustValidateFields() { } // Logger returns a module-specific logger. -func (k Keeper) Logger(ctx sdk.Context) log.Logger { +func (Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", "x/"+host.ModuleName+"-"+types.ModuleName) } @@ -145,8 +143,8 @@ func (k Keeper) IsBound(ctx sdk.Context, portID string) bool { // BindPort defines a wrapper function for the ort Keeper's function in // order to expose it to module's InitGenesis function func (k Keeper) BindPort(ctx sdk.Context, portID string) error { - cap := k.portKeeper.BindPort(ctx, portID) - return k.ClaimCapability(ctx, cap, host.PortPath(portID)) + portCap := k.portKeeper.BindPort(ctx, portID) + return k.ClaimCapability(ctx, portCap, host.PortPath(portID)) } // GetPort returns the portID for the transfer module. Used in ExportGenesis @@ -181,11 +179,11 @@ func (k Keeper) SetProviderClientID(ctx sdk.Context, clientID string) { // GetProviderClientID gets the clientID for the client to the provider. func (k Keeper) GetProviderClientID(ctx sdk.Context) (string, bool) { store := ctx.KVStore(k.storeKey) - clientIdBytes := store.Get(types.ProviderClientIDKey()) - if clientIdBytes == nil { + clientIDBytes := store.Get(types.ProviderClientIDKey()) + if clientIDBytes == nil { return "", false } - return string(clientIdBytes), true + return string(clientIDBytes), true } // SetProviderChannel sets the channelID for the channel to the provider. @@ -197,11 +195,11 @@ func (k Keeper) SetProviderChannel(ctx sdk.Context, channelID string) { // GetProviderChannel gets the channelID for the channel to the provider. func (k Keeper) GetProviderChannel(ctx sdk.Context) (string, bool) { store := ctx.KVStore(k.storeKey) - channelIdBytes := store.Get(types.ProviderChannelKey()) - if len(channelIdBytes) == 0 { + channelIDBytes := store.Get(types.ProviderChannelKey()) + if len(channelIDBytes) == 0 { return "", false } - return string(channelIdBytes), true + return string(channelIDBytes), true } // DeleteProviderChannel deletes the channelID for the channel to the provider. @@ -245,14 +243,14 @@ func (k Keeper) DeletePendingChanges(ctx sdk.Context) { // GetElapsedPacketMaturityTimes returns a slice of already elapsed PacketMaturityTimes, sorted by maturity times, // i.e., the slice contains the IDs of the matured VSCPackets. -func (k Keeper) GetElapsedPacketMaturityTimes(ctx sdk.Context) (maturingVSCPackets []consumertypes.MaturingVSCPacket) { +func (k Keeper) GetElapsedPacketMaturityTimes(ctx sdk.Context) (maturingVSCPackets []types.MaturingVSCPacket) { store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, []byte{types.PacketMaturityTimeBytePrefix}) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - var maturingVSCPacket consumertypes.MaturingVSCPacket + var maturingVSCPacket types.MaturingVSCPacket if err := maturingVSCPacket.Unmarshal(iterator.Value()); err != nil { // An error here would indicate something is very wrong, // the MaturingVSCPackets are assumed to be correctly serialized in SetPacketMaturityTime. @@ -277,13 +275,13 @@ func (k Keeper) GetElapsedPacketMaturityTimes(ctx sdk.Context) (maturingVSCPacke // PacketMaturityTimeBytePrefix | maturityTime.UnixNano() | vscID // Thus, the returned array is in ascending order of maturityTimes. // If two entries have the same maturityTime, then they are ordered by vscID. -func (k Keeper) GetAllPacketMaturityTimes(ctx sdk.Context) (maturingVSCPackets []consumertypes.MaturingVSCPacket) { +func (k Keeper) GetAllPacketMaturityTimes(ctx sdk.Context) (maturingVSCPackets []types.MaturingVSCPacket) { store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, []byte{types.PacketMaturityTimeBytePrefix}) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - var maturingVSCPacket consumertypes.MaturingVSCPacket + var maturingVSCPacket types.MaturingVSCPacket if err := maturingVSCPacket.Unmarshal(iterator.Value()); err != nil { // An error here would indicate something is very wrong, // the MaturingVSCPackets are assumed to be correctly serialized in SetPacketMaturityTime. @@ -296,10 +294,10 @@ func (k Keeper) GetAllPacketMaturityTimes(ctx sdk.Context) (maturingVSCPackets [ } // SetPacketMaturityTime sets the maturity time for a given received VSC packet id -func (k Keeper) SetPacketMaturityTime(ctx sdk.Context, vscId uint64, maturityTime time.Time) { +func (k Keeper) SetPacketMaturityTime(ctx sdk.Context, vscID uint64, maturityTime time.Time) { store := ctx.KVStore(k.storeKey) - maturingVSCPacket := consumertypes.MaturingVSCPacket{ - VscId: vscId, + maturingVSCPacket := types.MaturingVSCPacket{ + VscId: vscID, MaturityTime: maturityTime, } bz, err := maturingVSCPacket.Marshal() @@ -308,22 +306,22 @@ func (k Keeper) SetPacketMaturityTime(ctx sdk.Context, vscId uint64, maturityTim // maturingVSCPacket is instantiated in this method and should be able to be marshaled. panic(fmt.Errorf("failed to marshal MaturingVSCPacket: %w", err)) } - store.Set(types.PacketMaturityTimeKey(vscId, maturityTime), bz) + store.Set(types.PacketMaturityTimeKey(vscID, maturityTime), bz) } // PacketMaturityExists checks whether the packet maturity time for a given vscId and maturityTime exists. // // Note: this method is only used in testing. -func (k Keeper) PacketMaturityTimeExists(ctx sdk.Context, vscId uint64, maturityTime time.Time) bool { +func (k Keeper) PacketMaturityTimeExists(ctx sdk.Context, vscID uint64, maturityTime time.Time) bool { store := ctx.KVStore(k.storeKey) - bz := store.Get(types.PacketMaturityTimeKey(vscId, maturityTime)) + bz := store.Get(types.PacketMaturityTimeKey(vscID, maturityTime)) return bz != nil } // DeletePacketMaturityTimes deletes the packet maturity time for a given vscId and maturityTime -func (k Keeper) DeletePacketMaturityTimes(ctx sdk.Context, vscId uint64, maturityTime time.Time) { +func (k Keeper) DeletePacketMaturityTimes(ctx sdk.Context, vscID uint64, maturityTime time.Time) { store := ctx.KVStore(k.storeKey) - store.Delete(types.PacketMaturityTimeKey(vscId, maturityTime)) + store.Delete(types.PacketMaturityTimeKey(vscID, maturityTime)) } // VerifyProviderChain verifies that the chain trying to connect on the channel handshake @@ -338,22 +336,22 @@ func (k Keeper) VerifyProviderChain(ctx sdk.Context, connectionHops []string) er return sdkerrors.Wrapf(conntypes.ErrConnectionNotFound, "connection not found for connection ID: %s", connectionID) } // Verify that client id is expected clientID - expectedClientId, ok := k.GetProviderClientID(ctx) + expectedClientID, ok := k.GetProviderClientID(ctx) if !ok { return sdkerrors.Wrapf(clienttypes.ErrInvalidClient, "could not find provider client id") } - if expectedClientId != conn.ClientId { - return sdkerrors.Wrapf(clienttypes.ErrInvalidClient, "invalid client: %s, channel must be built on top of client: %s", conn.ClientId, expectedClientId) + if expectedClientID != conn.ClientId { + return sdkerrors.Wrapf(clienttypes.ErrInvalidClient, "invalid client: %s, channel must be built on top of client: %s", conn.ClientId, expectedClientID) } return nil } // SetHeightValsetUpdateID sets the valset update id for a given block height -func (k Keeper) SetHeightValsetUpdateID(ctx sdk.Context, height, valsetUpdateId uint64) { +func (k Keeper) SetHeightValsetUpdateID(ctx sdk.Context, height, valsetUpdateID uint64) { store := ctx.KVStore(k.storeKey) valBytes := make([]byte, 8) - binary.BigEndian.PutUint64(valBytes, valsetUpdateId) + binary.BigEndian.PutUint64(valBytes, valsetUpdateID) store.Set(types.HeightValsetUpdateIDKey(height), valBytes) } @@ -424,7 +422,7 @@ func (k Keeper) DeleteOutstandingDowntime(ctx sdk.Context, consAddress string) { // Note that the outstanding downtime flags are stored under keys with the following format: // OutstandingDowntimeBytePrefix | consAddress // Thus, the returned array is in ascending order of consAddresses. -func (k Keeper) GetAllOutstandingDowntimes(ctx sdk.Context) (downtimes []consumertypes.OutstandingDowntime) { +func (k Keeper) GetAllOutstandingDowntimes(ctx sdk.Context) (downtimes []types.OutstandingDowntime) { store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, []byte{types.OutstandingDowntimeBytePrefix}) @@ -433,7 +431,7 @@ func (k Keeper) GetAllOutstandingDowntimes(ctx sdk.Context) (downtimes []consume addrBytes := iterator.Key()[1:] addr := sdk.ConsAddress(addrBytes).String() - downtimes = append(downtimes, consumertypes.OutstandingDowntime{ + downtimes = append(downtimes, types.OutstandingDowntime{ ValidatorConsensusAddress: addr, }) } @@ -454,12 +452,12 @@ func (k Keeper) GetCCValidator(ctx sdk.Context, addr []byte) (validator types.Cr store := ctx.KVStore(k.storeKey) v := store.Get(types.CrossChainValidatorKey(addr)) if v == nil { - return + return validator, false } k.cdc.MustUnmarshal(v, &validator) found = true - return + return validator, found } // DeleteCCValidator deletes a cross-chain validator for a given address diff --git a/x/ccv/consumer/keeper/keeper_test.go b/x/ccv/consumer/keeper/keeper_test.go index b544b3b3ed..1979777631 100644 --- a/x/ccv/consumer/keeper/keeper_test.go +++ b/x/ccv/consumer/keeper/keeper_test.go @@ -22,7 +22,6 @@ import ( // TestProviderClientID tests getter and setter functionality for the client ID stored on consumer keeper func TestProviderClientID(t *testing.T) { - consumerKeeper, ctx, ctrl, _ := testkeeper.GetConsumerKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() @@ -36,7 +35,6 @@ func TestProviderClientID(t *testing.T) { // TestProviderChannel tests getter and setter functionality for the channel ID stored on consumer keeper func TestProviderChannel(t *testing.T) { - consumerKeeper, ctx, ctrl, _ := testkeeper.GetConsumerKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() @@ -138,7 +136,6 @@ func TestPacketMaturityTime(t *testing.T) { // TestCrossChainValidator tests the getter, setter, and deletion method for cross chain validator records func TestCrossChainValidator(t *testing.T) { - keeperParams := testkeeper.NewInMemKeeperParams(t) // Explicitly register codec with public key interface keeperParams.RegisterSdkCryptoCodecInterfaces() @@ -208,7 +205,6 @@ func TestGetAllCCValidator(t *testing.T) { } func TestSetPendingPackets(t *testing.T) { - consumerKeeper, ctx, ctrl, _ := testkeeper.GetConsumerKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() @@ -228,11 +224,12 @@ func TestSetPendingPackets(t *testing.T) { }, { Type: ccv.SlashPacket, - Data: &ccv.ConsumerPacketData_SlashPacketData{SlashPacketData: ccv.NewSlashPacketData( - abci.Validator{Address: ed25519.GenPrivKey().PubKey().Address(), Power: int64(0)}, - 3, - stakingtypes.DoubleSign, - ), + Data: &ccv.ConsumerPacketData_SlashPacketData{ + SlashPacketData: ccv.NewSlashPacketData( + abci.Validator{Address: ed25519.GenPrivKey().PubKey().Address(), Power: int64(0)}, + 3, + stakingtypes.DoubleSign, + ), }, }, { @@ -249,14 +246,17 @@ func TestSetPendingPackets(t *testing.T) { require.Equal(t, dataPackets, storedDataPackets.List) slashPacket := ccv.NewSlashPacketData( - abci.Validator{Address: ed25519.GenPrivKey().PubKey().Address(), - Power: int64(2)}, + abci.Validator{ + Address: ed25519.GenPrivKey().PubKey().Address(), + Power: int64(2), + }, uint64(4), stakingtypes.Downtime, ) dataPackets = append(dataPackets, ccv.ConsumerPacketData{ Type: ccv.SlashPacket, - Data: &ccv.ConsumerPacketData_SlashPacketData{SlashPacketData: slashPacket}}, + Data: &ccv.ConsumerPacketData_SlashPacketData{SlashPacketData: slashPacket}, + }, ) consumerKeeper.AppendPendingPacket(ctx, dataPackets[len(dataPackets)-1]) storedDataPackets = consumerKeeper.GetPendingPackets(ctx) @@ -264,8 +264,10 @@ func TestSetPendingPackets(t *testing.T) { require.Equal(t, dataPackets, storedDataPackets.List) vscMaturedPakcet := ccv.NewVSCMaturedPacketData(4) - dataPackets = append(dataPackets, ccv.ConsumerPacketData{Type: ccv.VscMaturedPacket, - Data: &ccv.ConsumerPacketData_VscMaturedPacketData{VscMaturedPacketData: vscMaturedPakcet}}, + dataPackets = append(dataPackets, ccv.ConsumerPacketData{ + Type: ccv.VscMaturedPacket, + Data: &ccv.ConsumerPacketData_VscMaturedPacketData{VscMaturedPacketData: vscMaturedPakcet}, + }, ) consumerKeeper.AppendPendingPacket(ctx, dataPackets[len(dataPackets)-1]) storedDataPackets = consumerKeeper.GetPendingPackets(ctx) @@ -280,7 +282,6 @@ func TestSetPendingPackets(t *testing.T) { // TestVerifyProviderChain tests the VerifyProviderChain method for the consumer keeper func TestVerifyProviderChain(t *testing.T) { - testCases := []struct { name string // State-mutating setup specific to this test case @@ -339,8 +340,8 @@ func TestVerifyProviderChain(t *testing.T) { }, } + // Run test cases for _, tc := range testCases { - keeperParams := testkeeper.NewInMemKeeperParams(t) consumerKeeper, ctx, ctrl, mocks := testkeeper.GetConsumerKeeperAndCtx(t, keeperParams) diff --git a/x/ccv/consumer/keeper/params_test.go b/x/ccv/consumer/keeper/params_test.go index 2d2061e2a1..3cdc5f54c6 100644 --- a/x/ccv/consumer/keeper/params_test.go +++ b/x/ccv/consumer/keeper/params_test.go @@ -5,7 +5,6 @@ import ( "time" testkeeper "github.com/cosmos/interchain-security/testutil/keeper" - "github.com/cosmos/interchain-security/x/ccv/consumer/types" consumertypes "github.com/cosmos/interchain-security/x/ccv/consumer/types" ccv "github.com/cosmos/interchain-security/x/ccv/types" "github.com/stretchr/testify/require" @@ -15,9 +14,9 @@ import ( func TestParams(t *testing.T) { consumerKeeper, ctx, ctrl, _ := testkeeper.GetConsumerKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() - consumerKeeper.SetParams(ctx, types.DefaultParams()) + consumerKeeper.SetParams(ctx, consumertypes.DefaultParams()) - expParams := types.NewParams( + expParams := consumertypes.NewParams( false, 1000, "", @@ -32,7 +31,7 @@ func TestParams(t *testing.T) { params := consumerKeeper.GetParams(ctx) require.Equal(t, expParams, params) - newParams := types.NewParams(false, 1000, + newParams := consumertypes.NewParams(false, 1000, "channel-2", "cosmos19pe9pg5dv9k5fzgzmsrgnw9rl9asf7ddwhu7lm", 7*24*time.Hour, 25*time.Hour, "0.5", 500, 24*21*time.Hour) consumerKeeper.SetParams(ctx, newParams) diff --git a/x/ccv/consumer/keeper/relay.go b/x/ccv/consumer/keeper/relay.go index a86ef654e3..ae5ff974b7 100644 --- a/x/ccv/consumer/keeper/relay.go +++ b/x/ccv/consumer/keeper/relay.go @@ -178,15 +178,14 @@ func (k Keeper) QueueSlashPacket(ctx sdk.Context, validator abci.Validator, vals // operations that resulted in validator updates included in that VSC have matured on // the consumer chain. func (k Keeper) SendPackets(ctx sdk.Context) { - channelID, ok := k.GetProviderChannel(ctx) if !ok { return } pending := k.GetPendingPackets(ctx) + // send packets in FIFO order for _, p := range pending.GetList() { - // send packet over IBC err := utils.SendIBCPacket( ctx, @@ -197,7 +196,6 @@ func (k Keeper) SendPackets(ctx sdk.Context) { p.GetBytes(), k.GetCCVTimeoutPeriod(ctx), ) - if err != nil { if clienttypes.ErrClientNotActive.Is(err) { k.Logger(ctx).Debug("IBC client is inactive, packet remains in queue", "type", p.Type.String()) @@ -209,7 +207,6 @@ func (k Keeper) SendPackets(ctx sdk.Context) { panic(fmt.Errorf("packet could not be sent over IBC: %w", err)) } } - // clear pending data packets k.DeletePendingDataPackets(ctx) } @@ -236,7 +233,7 @@ func (k Keeper) OnAcknowledgementPacket(ctx sdk.Context, packet channeltypes.Pac // check if there is an established CCV channel to provider channelID, found := k.GetProviderChannel(ctx) if !found { - return sdkerrors.Wrapf(types.ErrNoProposerChannelId, "recv ErrorAcknowledgement on non-established channel %s", packet.SourceChannel) + return sdkerrors.Wrapf(types.ErrNoProposerChannelID, "recv ErrorAcknowledgement on non-established channel %s", packet.SourceChannel) } if channelID != packet.SourceChannel { // Close the established CCV channel as well diff --git a/x/ccv/consumer/keeper/relay_test.go b/x/ccv/consumer/keeper/relay_test.go index 99e11c1c17..ad7a59e7d0 100644 --- a/x/ccv/consumer/keeper/relay_test.go +++ b/x/ccv/consumer/keeper/relay_test.go @@ -15,7 +15,6 @@ import ( host "github.com/cosmos/ibc-go/v4/modules/core/24-host" testkeeper "github.com/cosmos/interchain-security/testutil/keeper" consumertypes "github.com/cosmos/interchain-security/x/ccv/consumer/types" - "github.com/cosmos/interchain-security/x/ccv/types" ccv "github.com/cosmos/interchain-security/x/ccv/types" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" @@ -57,13 +56,13 @@ func TestOnRecvVSCPacket(t *testing.T) { }, } - pd := types.NewValidatorSetChangePacketData( + pd := ccv.NewValidatorSetChangePacketData( changes1, 1, nil, ) - pd2 := types.NewValidatorSetChangePacketData( + pd2 := ccv.NewValidatorSetChangePacketData( changes2, 2, nil, @@ -72,29 +71,29 @@ func TestOnRecvVSCPacket(t *testing.T) { testCases := []struct { name string packet channeltypes.Packet - newChanges types.ValidatorSetChangePacketData - expectedPendingChanges types.ValidatorSetChangePacketData + newChanges ccv.ValidatorSetChangePacketData + expectedPendingChanges ccv.ValidatorSetChangePacketData }{ { "success on first packet", channeltypes.NewPacket(pd.GetBytes(), 1, ccv.ProviderPortID, providerCCVChannelID, ccv.ConsumerPortID, consumerCCVChannelID, clienttypes.NewHeight(1, 0), 0), - types.ValidatorSetChangePacketData{ValidatorUpdates: changes1}, - types.ValidatorSetChangePacketData{ValidatorUpdates: changes1}, + ccv.ValidatorSetChangePacketData{ValidatorUpdates: changes1}, + ccv.ValidatorSetChangePacketData{ValidatorUpdates: changes1}, }, { "success on subsequent packet", channeltypes.NewPacket(pd.GetBytes(), 2, ccv.ProviderPortID, providerCCVChannelID, ccv.ConsumerPortID, consumerCCVChannelID, clienttypes.NewHeight(1, 0), 0), - types.ValidatorSetChangePacketData{ValidatorUpdates: changes1}, - types.ValidatorSetChangePacketData{ValidatorUpdates: changes1}, + ccv.ValidatorSetChangePacketData{ValidatorUpdates: changes1}, + ccv.ValidatorSetChangePacketData{ValidatorUpdates: changes1}, }, { "success on packet with more changes", channeltypes.NewPacket(pd2.GetBytes(), 3, ccv.ProviderPortID, providerCCVChannelID, ccv.ConsumerPortID, consumerCCVChannelID, clienttypes.NewHeight(1, 0), 0), - types.ValidatorSetChangePacketData{ValidatorUpdates: changes2}, - types.ValidatorSetChangePacketData{ValidatorUpdates: []abci.ValidatorUpdate{ + ccv.ValidatorSetChangePacketData{ValidatorUpdates: changes2}, + ccv.ValidatorSetChangePacketData{ValidatorUpdates: []abci.ValidatorUpdate{ { PubKey: pk1, Power: 30, @@ -157,7 +156,6 @@ func TestOnRecvVSCPacket(t *testing.T) { // in conjunction with the ibc module's execution of "acknowledgePacket", // according to https://github.com/cosmos/ibc/tree/main/spec/core/ics-004-channel-and-packet-semantics#processing-acknowledgements func TestOnAcknowledgementPacket(t *testing.T) { - // Channel ID to some dest chain that's not the established provider channelIDToDestChain := "channelIDToDestChain" @@ -178,7 +176,7 @@ func TestOnAcknowledgementPacket(t *testing.T) { // Set an established provider channel for later in test consumerKeeper.SetProviderChannel(ctx, channelIDToProvider) - packetData := types.NewSlashPacketData( + packetData := ccv.NewSlashPacketData( abci.Validator{Address: bytes.HexBytes{}, Power: int64(1)}, uint64(1), stakingtypes.Downtime, ) diff --git a/x/ccv/consumer/keeper/validators.go b/x/ccv/consumer/keeper/validators.go index debb4c66ce..be457632d7 100644 --- a/x/ccv/consumer/keeper/validators.go +++ b/x/ccv/consumer/keeper/validators.go @@ -26,7 +26,7 @@ func (k Keeper) ApplyCCValidatorChanges(ctx sdk.Context, changes []abci.Validato addr := pubkey.Address() val, found := k.GetCCValidator(ctx, addr) - if found { + if found { //nolint:gocritic // this if-else chain isn't worth a conversion to a switch statement // update or delete an existing validator if change.Power < 1 { k.DeleteCCValidator(ctx, addr) @@ -34,7 +34,6 @@ func (k Keeper) ApplyCCValidatorChanges(ctx sdk.Context, changes []abci.Validato val.Power = change.Power k.SetCCValidator(ctx, val) } - } else if 0 < change.Power { // create a new validator consAddr := sdk.ConsAddress(addr) @@ -45,17 +44,14 @@ func (k Keeper) ApplyCCValidatorChanges(ctx sdk.Context, changes []abci.Validato // received from the provider are invalid. panic(err) } - k.SetCCValidator(ctx, ccVal) k.AfterValidatorBonded(ctx, consAddr, nil) - } else { // edge case: we received an update for 0 power // but the validator is already deleted. Do not forward // to tendermint. continue } - ret = append(ret, change) } return ret @@ -64,11 +60,11 @@ func (k Keeper) ApplyCCValidatorChanges(ctx sdk.Context, changes []abci.Validato // IterateValidators - unimplemented on CCV keeper but perform a no-op in order to pass the slashing module InitGenesis. // It is allowed since the condition verifying validator public keys in HandleValidatorSignature (x/slashing/keeper/infractions.go) is removed // therefore it isn't required to store any validator public keys to the slashing states during genesis. -func (k Keeper) IterateValidators(sdk.Context, func(index int64, validator stakingtypes.ValidatorI) (stop bool)) { +func (Keeper) IterateValidators(sdk.Context, func(index int64, validator stakingtypes.ValidatorI) (stop bool)) { } // Validator - unimplemented on CCV keeper -func (k Keeper) Validator(ctx sdk.Context, addr sdk.ValAddress) stakingtypes.ValidatorI { +func (Keeper) Validator(_ sdk.Context, _ sdk.ValAddress) stakingtypes.ValidatorI { panic("unimplemented on CCV keeper") } @@ -78,7 +74,7 @@ func (k Keeper) IsValidatorJailed(ctx sdk.Context, addr sdk.ConsAddress) bool { } // ValidatorByConsAddr returns an empty validator -func (k Keeper) ValidatorByConsAddr(sdk.Context, sdk.ConsAddress) stakingtypes.ValidatorI { +func (Keeper) ValidatorByConsAddr(sdk.Context, sdk.ConsAddress) stakingtypes.ValidatorI { /* NOTE: @@ -111,25 +107,26 @@ func (k Keeper) Slash(ctx sdk.Context, addr sdk.ConsAddress, infractionHeight, p ctx, abci.Validator{ Address: addr.Bytes(), - Power: power}, + Power: power, + }, vscID, infraction, ) } // Jail - unimplemented on CCV keeper -func (k Keeper) Jail(ctx sdk.Context, addr sdk.ConsAddress) {} +func (Keeper) Jail(_ sdk.Context, _ sdk.ConsAddress) {} // Unjail - unimplemented on CCV keeper -func (k Keeper) Unjail(sdk.Context, sdk.ConsAddress) {} +func (Keeper) Unjail(_ sdk.Context, _ sdk.ConsAddress) {} // Delegation - unimplemented on CCV keeper -func (k Keeper) Delegation(sdk.Context, sdk.AccAddress, sdk.ValAddress) stakingtypes.DelegationI { +func (Keeper) Delegation(sdk.Context, sdk.AccAddress, sdk.ValAddress) stakingtypes.DelegationI { panic("unimplemented on CCV keeper") } // MaxValidators - unimplemented on CCV keeper -func (k Keeper) MaxValidators(sdk.Context) uint32 { +func (Keeper) MaxValidators(sdk.Context) uint32 { panic("unimplemented on CCV keeper") } @@ -171,7 +168,6 @@ func (k Keeper) DeleteHistoricalInfo(ctx sdk.Context, height int64) { // TrackHistoricalInfo saves the latest historical-info and deletes the oldest // heights that are below pruning height func (k Keeper) TrackHistoricalInfo(ctx sdk.Context) { - numHistoricalEntries := k.GetHistoricalEntries(ctx) // Prune store to ensure we only have parameter-defined historical entries. @@ -181,7 +177,7 @@ func (k Keeper) TrackHistoricalInfo(ctx sdk.Context) { // Since the entries to be deleted are always in a continuous range, we can iterate // over the historical entries starting from the most recent version to be pruned // and then return at the first empty entry. - for i := ctx.BlockHeight() - int64(numHistoricalEntries); i >= 0; i-- { + for i := ctx.BlockHeight() - numHistoricalEntries; i >= 0; i-- { _, found := k.GetHistoricalInfo(ctx, i) if found { k.DeleteHistoricalInfo(ctx, i) diff --git a/x/ccv/consumer/keeper/validators_test.go b/x/ccv/consumer/keeper/validators_test.go index 2b4f1484fe..68c6487128 100644 --- a/x/ccv/consumer/keeper/validators_test.go +++ b/x/ccv/consumer/keeper/validators_test.go @@ -17,7 +17,6 @@ import ( // TestApplyCCValidatorChanges tests the ApplyCCValidatorChanges method for a consumer keeper func TestApplyCCValidatorChanges(t *testing.T) { - keeperParams := testkeeper.NewInMemKeeperParams(t) // Explicitly register cdc with public key interface keeperParams.RegisterSdkCryptoCodecInterfaces() @@ -27,7 +26,7 @@ func TestApplyCCValidatorChanges(t *testing.T) { // utility functions getCCVals := func() (vals []types.CrossChainValidator) { vals = consumerKeeper.GetAllCCValidator(ctx) - return + return vals } clearCCVals := func() { @@ -41,7 +40,7 @@ func TestApplyCCValidatorChanges(t *testing.T) { for _, v := range vals { power += v.Power } - return + return power } // prepare the testing setup by clearing the current cross-chain validators in states @@ -69,19 +68,22 @@ func TestApplyCCValidatorChanges(t *testing.T) { changes []abci.ValidatorUpdate expTotalPower int64 expValsNum int - }{{ // add new bonded validator - changes: changes[len(changes)-1:], - expTotalPower: changesPower, - expValsNum: len(ccVals) + 1, - }, { // update a validator voting power - changes: []abci.ValidatorUpdate{{PubKey: changes[0].PubKey, Power: changes[0].Power + 3}}, - expTotalPower: changesPower + 3, - expValsNum: len(ccVals) + 1, - }, { // unbond a validator - changes: []abci.ValidatorUpdate{{PubKey: changes[0].PubKey, Power: 0}}, - expTotalPower: changesPower - changes[0].Power, - expValsNum: len(ccVals), - }, + }{ + { // add new bonded validator + changes: changes[len(changes)-1:], + expTotalPower: changesPower, + expValsNum: len(ccVals) + 1, + }, + { // update a validator voting power + changes: []abci.ValidatorUpdate{{PubKey: changes[0].PubKey, Power: changes[0].Power + 3}}, + expTotalPower: changesPower + 3, + expValsNum: len(ccVals) + 1, + }, + { // unbond a validator + changes: []abci.ValidatorUpdate{{PubKey: changes[0].PubKey, Power: 0}}, + expTotalPower: changesPower - changes[0].Power, + expValsNum: len(ccVals), + }, { // update all validators voting power changes: []abci.ValidatorUpdate{ {PubKey: changes[0].PubKey, Power: changes[0].Power + 1}, @@ -94,8 +96,8 @@ func TestApplyCCValidatorChanges(t *testing.T) { }, } + // run test cases for _, tc := range testCases { - consumerKeeper.ApplyCCValidatorChanges(ctx, tc.changes) gotVals := getCCVals() @@ -106,7 +108,6 @@ func TestApplyCCValidatorChanges(t *testing.T) { // Tests the getter and setter behavior for historical info func TestHistoricalInfo(t *testing.T) { - keeperParams := testkeeper.NewInMemKeeperParams(t) // Explicitly register cdc with public key interface keeperParams.RegisterSdkCryptoCodecInterfaces() @@ -177,7 +178,8 @@ func GenerateValidators(t testing.TB) []*tmtypes.Validator { // Sets each input tmtypes.Validator as a types.CrossChainValidator in the consumer keeper store func SetCCValidators(t testing.TB, consumerKeeper keeper.Keeper, - ctx sdk.Context, validators []*tmtypes.Validator) { + ctx sdk.Context, validators []*tmtypes.Validator, +) { for _, v := range validators { publicKey, err := cryptocodec.FromTmPubKeyInterface(v.PubKey) require.NoError(t, err) diff --git a/x/ccv/consumer/module.go b/x/ccv/consumer/module.go index 68a2d60c1c..7cf0d0ea7b 100644 --- a/x/ccv/consumer/module.go +++ b/x/ccv/consumer/module.go @@ -40,12 +40,12 @@ func (AppModuleBasic) Name() string { } // RegisterLegacyAminoCodec implements AppModuleBasic interface -func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { +func (AppModuleBasic) RegisterLegacyAminoCodec(_ *codec.LegacyAmino) { // ccv.RegisterLegacyAminoCodec(cdc) } // RegisterInterfaces registers module concrete types into protobuf Any. -func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { +func (AppModuleBasic) RegisterInterfaces(_ codectypes.InterfaceRegistry) { // ccv.RegisterInterfaces(registry) } @@ -56,7 +56,7 @@ func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { } // ValidateGenesis performs genesis state validation for the ibc consumer module. -func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error { +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error { var data consumertypes.GenesisState if err := cdc.UnmarshalJSON(bz, &data); err != nil { return fmt.Errorf("failed to unmarshal %s genesis state: %w", consumertypes.ModuleName, err) @@ -66,12 +66,12 @@ func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncod } // RegisterRESTRoutes implements AppModuleBasic interface -func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router) { +func (AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) { } // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the ibc-consumer module. -func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { - err := consumertypes.RegisterQueryHandlerClient(context.Background(), mux, consumertypes.NewQueryClient(clientCtx)) +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, runtimeMux *runtime.ServeMux) { + err := consumertypes.RegisterQueryHandlerClient(context.Background(), runtimeMux, consumertypes.NewQueryClient(clientCtx)) if err != nil { // same behavior as in cosmos-sdk panic(err) @@ -102,12 +102,12 @@ func NewAppModule(k keeper.Keeper) AppModule { } // RegisterInvariants implements the AppModule interface -func (AppModule) RegisterInvariants(ir sdk.InvariantRegistry) { +func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry) { // TODO } // Route implements the AppModule interface -func (am AppModule) Route() sdk.Route { +func (AppModule) Route() sdk.Route { return sdk.Route{} } @@ -117,7 +117,7 @@ func (AppModule) QuerierRoute() string { } // LegacyQuerierHandler implements the AppModule interface -func (am AppModule) LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier { +func (AppModule) LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier { return nil } @@ -148,7 +148,7 @@ func (AppModule) ConsensusVersion() uint64 { return 1 } // BeginBlock implements the AppModule interface // Set the VSC ID for the subsequent block to the same value as the current block // Panic if the provider's channel was established and then closed -func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { +func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { channelID, found := am.keeper.GetProviderChannel(ctx) if found && am.keeper.IsChannelClosed(ctx, channelID) { // The CCV channel was established, but it was then closed; @@ -171,7 +171,7 @@ func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { // EndBlock implements the AppModule interface // Flush PendingChanges to ABCI, send pending packets, write acknowledgements for packets that have finished unbonding. -func (am AppModule) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.ValidatorUpdate { +func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { // Execute EndBlock logic for the Reward Distribution sub-protocol am.keeper.EndBlockRD(ctx) @@ -199,7 +199,7 @@ func (am AppModule) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.V // GenerateGenesisState creates a randomized GenState of the transfer module. // TODO -func (AppModule) GenerateGenesisState(simState *module.SimulationState) { +func (AppModule) GenerateGenesisState(_ *module.SimulationState) { } // ProposalContents doesn't return any content functions for governance proposals. @@ -209,16 +209,16 @@ func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedP // RandomizedParams creates randomized consumer param changes for the simulator. // TODO -func (AppModule) RandomizedParams(r *rand.Rand) []simtypes.ParamChange { +func (AppModule) RandomizedParams(_ *rand.Rand) []simtypes.ParamChange { return nil } // RegisterStoreDecoder registers a decoder for consumer module's types // TODO -func (am AppModule) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry) { +func (AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) { } // WeightedOperations returns the all the consumer module operations with their respective weights. -func (am AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { +func (AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { return nil } diff --git a/x/ccv/consumer/types/errors.go b/x/ccv/consumer/types/errors.go index 486281139e..cf6dda2c17 100644 --- a/x/ccv/consumer/types/errors.go +++ b/x/ccv/consumer/types/errors.go @@ -6,5 +6,5 @@ import ( // Consumer sentinel errors var ( - ErrNoProposerChannelId = sdkerrors.Register(ModuleName, 1, "no established CCV channel") + ErrNoProposerChannelID = sdkerrors.Register(ModuleName, 1, "no established CCV channel") ) diff --git a/x/ccv/consumer/types/genesis.go b/x/ccv/consumer/types/genesis.go index 2910f929ff..6c5a66b7f3 100644 --- a/x/ccv/consumer/types/genesis.go +++ b/x/ccv/consumer/types/genesis.go @@ -10,8 +10,8 @@ import ( // NewInitialGenesisState returns a consumer GenesisState for a completely new consumer chain. func NewInitialGenesisState(cs *ibctmtypes.ClientState, consState *ibctmtypes.ConsensusState, - initValSet []abci.ValidatorUpdate, params Params) *GenesisState { - + initValSet []abci.ValidatorUpdate, params Params, +) *GenesisState { return &GenesisState{ Params: params, NewChain: true, @@ -32,7 +32,6 @@ func NewRestartGenesisState( lastTransBlockHeight LastTransmissionBlockHeight, params Params, ) *GenesisState { - return &GenesisState{ Params: params, ProviderClientId: clientID, @@ -162,7 +161,7 @@ func (mat MaturingVSCPacket) Validate() error { return sdkerrors.Wrap(ccv.ErrInvalidVSCMaturedTime, "cannot have 0 maturity time") } if mat.VscId == 0 { - return sdkerrors.Wrap(ccv.ErrInvalidVSCMaturedId, "cannot have 0 maturity time") + return sdkerrors.Wrap(ccv.ErrInvalidVSCMaturedID, "cannot have 0 maturity time") } return nil } diff --git a/x/ccv/consumer/types/genesis_test.go b/x/ccv/consumer/types/genesis_test.go index a0046a5387..cc5a6d7035 100644 --- a/x/ccv/consumer/types/genesis_test.go +++ b/x/ccv/consumer/types/genesis_test.go @@ -48,7 +48,7 @@ func TestValidateInitialGenesisState(t *testing.T) { valUpdates := tmtypes.TM2PB.ValidatorUpdates(valSet) cs := ibctmtypes.NewClientState(chainID, ibctmtypes.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, height, commitmenttypes.GetSDKSpecs(), upgradePath, false, false) - consensusState := ibctmtypes.NewConsensusState(time.Now(), commitmenttypes.NewMerkleRoot([]byte("apphash")), valHash[:]) + consensusState := ibctmtypes.NewConsensusState(time.Now(), commitmenttypes.NewMerkleRoot([]byte("apphash")), valHash) params := types.DefaultParams() params.Enabled = true @@ -268,7 +268,7 @@ func TestValidateRestartGenesisState(t *testing.T) { } cs := ibctmtypes.NewClientState(chainID, ibctmtypes.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, height, commitmenttypes.GetSDKSpecs(), upgradePath, false, false) - consensusState := ibctmtypes.NewConsensusState(time.Now(), commitmenttypes.NewMerkleRoot([]byte("apphash")), valHash[:]) + consensusState := ibctmtypes.NewConsensusState(time.Now(), commitmenttypes.NewMerkleRoot([]byte("apphash")), valHash) params := types.DefaultParams() params.Enabled = true @@ -367,7 +367,8 @@ func TestValidateRestartGenesisState(t *testing.T) { types.NewRestartGenesisState("ccvclient", "", []types.MaturingVSCPacket{{1, time.Time{}}}, valUpdates, nil, ccv.ConsumerPacketDataList{}, nil, types.LastTransmissionBlockHeight{}, params), true, - }, { + }, + { "invalid restart consumer genesis state: maturing packet defined when handshake is still in progress", types.NewRestartGenesisState("ccvclient", "", []types.MaturingVSCPacket{{1, time.Time{}}}, valUpdates, heightToValsetUpdateID, ccv.ConsumerPacketDataList{}, nil, types.LastTransmissionBlockHeight{}, params), diff --git a/x/ccv/consumer/types/keys_test.go b/x/ccv/consumer/types/keys_test.go index 7df0e45607..460d553213 100644 --- a/x/ccv/consumer/types/keys_test.go +++ b/x/ccv/consumer/types/keys_test.go @@ -9,7 +9,6 @@ import ( // Tests that all singular keys, or prefixes to fully resolves keys are a single byte long, // preventing injection attacks into restricted parts of a full store. func TestSameLength(t *testing.T) { - keys := getSingleByteKeys() for _, keyByteArray := range keys { @@ -19,7 +18,6 @@ func TestSameLength(t *testing.T) { // Tests that all singular keys, or prefixes to fully resolves keys are non duplicate byte values. func TestNoDuplicates(t *testing.T) { - keys := getSingleByteKeys() for i, keyByteArray := range keys { @@ -31,7 +29,6 @@ func TestNoDuplicates(t *testing.T) { // Returns all singular keys, or prefixes to fully resolved keys, // any of which should be a single, unique byte. func getSingleByteKeys() [][]byte { - keys := make([][]byte, 32) i := 0 diff --git a/x/ccv/consumer/types/params.go b/x/ccv/consumer/types/params.go index 7a0a96832e..7fa9e0969f 100644 --- a/x/ccv/consumer/types/params.go +++ b/x/ccv/consumer/types/params.go @@ -57,9 +57,10 @@ func ParamKeyTable() paramtypes.KeyTable { // NewParams creates new consumer parameters with provided arguments func NewParams(enabled bool, blocksPerDistributionTransmission int64, distributionTransmissionChannel, providerFeePoolAddrStr string, - ccvTimeoutPeriod time.Duration, transferTimeoutPeriod time.Duration, + ccvTimeoutPeriod, transferTimeoutPeriod time.Duration, consumerRedistributionFraction string, historicalEntries int64, - consumerUnbondingPeriod time.Duration) Params { + consumerUnbondingPeriod time.Duration, +) Params { return Params{ Enabled: enabled, BlocksPerDistributionTransmission: blocksPerDistributionTransmission, @@ -114,10 +115,8 @@ func (p Params) Validate() error { if err := ccvtypes.ValidatePositiveInt64(p.HistoricalEntries); err != nil { return err } - if err := ccvtypes.ValidateDuration(p.UnbondingPeriod); err != nil { - return err - } - return nil + err := ccvtypes.ValidateDuration(p.UnbondingPeriod) + return err } // ParamSetPairs implements params.ParamSet @@ -143,7 +142,7 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { } } -func validateDistributionTransmissionChannel(i interface{}) error { +func validateDistributionTransmissionChannel(i any) error { // Accept empty string as valid, since this will be the default value on genesis if i == "" { return nil @@ -152,7 +151,7 @@ func validateDistributionTransmissionChannel(i interface{}) error { return ccvtypes.ValidateChannelIdentifier(i) } -func validateProviderFeePoolAddrStr(i interface{}) error { +func validateProviderFeePoolAddrStr(i any) error { // Accept empty string as valid, since this will be the default value on genesis if i == "" { return nil diff --git a/x/ccv/consumer/types/params_test.go b/x/ccv/consumer/types/params_test.go index 0fd7f87eb2..fa38d9f90b 100644 --- a/x/ccv/consumer/types/params_test.go +++ b/x/ccv/consumer/types/params_test.go @@ -11,35 +11,56 @@ import ( // Tests the validation of consumer params that happens at genesis func TestValidateParams(t *testing.T) { - testCases := []struct { name string params consumertypes.Params expPass bool }{ {"default params", consumertypes.DefaultParams(), true}, - {"custom valid params", - consumertypes.NewParams(true, 5, "", "", 1004, 1005, "0.5", 1000, 24*21*time.Hour), true}, - {"custom invalid params, block per dist transmission", - consumertypes.NewParams(true, -5, "", "", 5, 1005, "0.5", 1000, 24*21*time.Hour), false}, - {"custom invalid params, dist transmission channel", - consumertypes.NewParams(true, 5, "badchannel/", "", 5, 1005, "0.5", 1000, 24*21*time.Hour), false}, - {"custom invalid params, provider fee pool addr string", - consumertypes.NewParams(true, 5, "", "imabadaddress", 5, 1005, "0.5", 1000, 24*21*time.Hour), false}, - {"custom invalid params, ccv timeout", - consumertypes.NewParams(true, 5, "", "", -5, 1005, "0.5", 1000, 24*21*time.Hour), false}, - {"custom invalid params, transfer timeout", - consumertypes.NewParams(true, 5, "", "", 1004, -7, "0.5", 1000, 24*21*time.Hour), false}, - {"custom invalid params, consumer redist fraction is negative", - consumertypes.NewParams(true, 5, "", "", 5, 1005, "-0.5", 1000, 24*21*time.Hour), false}, - {"custom invalid params, consumer redist fraction is over 1", - consumertypes.NewParams(true, 5, "", "", 5, 1005, "1.2", 1000, 24*21*time.Hour), false}, - {"custom invalid params, bad consumer redist fraction ", - consumertypes.NewParams(true, 5, "", "", 5, 1005, "notFrac", 1000, 24*21*time.Hour), false}, - {"custom invalid params, negative num historical entries", - consumertypes.NewParams(true, 5, "", "", 5, 1005, "0.5", -100, 24*21*time.Hour), false}, - {"custom invalid params, negative unbonding period", - consumertypes.NewParams(true, 5, "", "", 5, 1005, "0.5", 1000, -24*21*time.Hour), false}, + { + "custom valid params", + consumertypes.NewParams(true, 5, "", "", 1004, 1005, "0.5", 1000, 24*21*time.Hour), true, + }, + { + "custom invalid params, block per dist transmission", + consumertypes.NewParams(true, -5, "", "", 5, 1005, "0.5", 1000, 24*21*time.Hour), false, + }, + { + "custom invalid params, dist transmission channel", + consumertypes.NewParams(true, 5, "badchannel/", "", 5, 1005, "0.5", 1000, 24*21*time.Hour), false, + }, + { + "custom invalid params, provider fee pool addr string", + consumertypes.NewParams(true, 5, "", "imabadaddress", 5, 1005, "0.5", 1000, 24*21*time.Hour), false, + }, + { + "custom invalid params, ccv timeout", + consumertypes.NewParams(true, 5, "", "", -5, 1005, "0.5", 1000, 24*21*time.Hour), false, + }, + { + "custom invalid params, transfer timeout", + consumertypes.NewParams(true, 5, "", "", 1004, -7, "0.5", 1000, 24*21*time.Hour), false, + }, + { + "custom invalid params, consumer redist fraction is negative", + consumertypes.NewParams(true, 5, "", "", 5, 1005, "-0.5", 1000, 24*21*time.Hour), false, + }, + { + "custom invalid params, consumer redist fraction is over 1", + consumertypes.NewParams(true, 5, "", "", 5, 1005, "1.2", 1000, 24*21*time.Hour), false, + }, + { + "custom invalid params, bad consumer redist fraction ", + consumertypes.NewParams(true, 5, "", "", 5, 1005, "notFrac", 1000, 24*21*time.Hour), false, + }, + { + "custom invalid params, negative num historical entries", + consumertypes.NewParams(true, 5, "", "", 5, 1005, "0.5", -100, 24*21*time.Hour), false, + }, + { + "custom invalid params, negative unbonding period", + consumertypes.NewParams(true, 5, "", "", 5, 1005, "0.5", 1000, -24*21*time.Hour), false, + }, } for _, tc := range testCases { diff --git a/x/ccv/consumer/types/validator.go b/x/ccv/consumer/types/validator.go index a128a8e803..69314b15d3 100644 --- a/x/ccv/consumer/types/validator.go +++ b/x/ccv/consumer/types/validator.go @@ -7,7 +7,6 @@ import ( ) func NewCCValidator(address []byte, power int64, pubKey cryptotypes.PubKey) (CrossChainValidator, error) { - pkAny, err := codectypes.NewAnyWithValue(pubKey) if err != nil { return CrossChainValidator{}, err @@ -34,5 +33,4 @@ func (ccv CrossChainValidator) ConsPubKey() (cryptotypes.PubKey, error) { } return pk, nil - } diff --git a/x/ccv/democracy/distribution/module.go b/x/ccv/democracy/distribution/module.go index 3872b70b90..731f1a5eb6 100644 --- a/x/ccv/democracy/distribution/module.go +++ b/x/ccv/democracy/distribution/module.go @@ -45,13 +45,13 @@ type AppModule struct { // NewAppModule creates a new AppModule object using the native x/distribution module // AppModule constructor. func NewAppModule( - cdc codec.Codec, keeper keeper.Keeper, ak distrtypes.AccountKeeper, + cdc codec.Codec, distrkeeper keeper.Keeper, ak distrtypes.AccountKeeper, bk distrtypes.BankKeeper, sk stakingkeeper.Keeper, feeCollectorName string, ) AppModule { - distrAppMod := distr.NewAppModule(cdc, keeper, ak, bk, sk) + distrAppMod := distr.NewAppModule(cdc, distrkeeper, ak, bk, sk) return AppModule{ AppModule: distrAppMod, - keeper: keeper, + keeper: distrkeeper, accountKeeper: ak, bankKeeper: bk, stakingKeeper: sk, @@ -61,7 +61,7 @@ func NewAppModule( // BeginBlocker mirror functionality of cosmos-sdk/distribution BeginBlocker // however it allocates no proposer reward -func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { +func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { defer telemetry.ModuleMeasureSince(distrtypes.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) // TODO this is Tendermint-dependent @@ -75,7 +75,6 @@ func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { func (am AppModule) AllocateTokens( ctx sdk.Context, ) { - // fetch and clear the collected fees for distribution, since this is // called in BeginBlock, collected fees will be from the previous block // (and distributed to the current representatives) @@ -109,9 +108,9 @@ func (am AppModule) AllocateTokens( // allocate tokens proportionally to representatives voting power vs.IterateBondedValidatorsByPower(ctx, func(_ int64, validator stakingtypes.ValidatorI) bool { - //we get this validator's percentage of the total power by dividing their tokens by the total bonded tokens + // we get this validator's percentage of the total power by dividing their tokens by the total bonded tokens powerFraction := sdk.NewDecFromInt(validator.GetTokens()).QuoTruncate(sdk.NewDecFromInt(totalBondedTokens)) - //we truncate here again, which means that the reward will be slightly lower than it should be + // we truncate here again, which means that the reward will be slightly lower than it should be reward := feesCollected.MulDecTruncate(representativesFraction).MulDecTruncate(powerFraction) am.keeper.AllocateTokensToValidator(ctx, validator, reward) remaining = remaining.Sub(reward) @@ -120,7 +119,7 @@ func (am AppModule) AllocateTokens( }) // allocate community funding - //due to the 3 truncations above, remaining sent to the community pool will be slightly more than it should be. This is OK + // due to the 3 truncations above, remaining sent to the community pool will be slightly more than it should be. This is OK feePool.CommunityPool = feePool.CommunityPool.Add(remaining...) am.keeper.SetFeePool(ctx, feePool) } diff --git a/x/ccv/democracy/governance/module.go b/x/ccv/democracy/governance/module.go index 4e7fe7b4a5..c911f9156c 100644 --- a/x/ccv/democracy/governance/module.go +++ b/x/ccv/democracy/governance/module.go @@ -32,20 +32,19 @@ type AppModule struct { } // NewAppModule creates a new AppModule object using the native x/governance module AppModule constructor. -func NewAppModule(cdc codec.Codec, keeper keeper.Keeper, ak govtypes.AccountKeeper, bk govtypes.BankKeeper, isProposalWhitelisted func(govtypes.Content) bool) AppModule { - govAppModule := gov.NewAppModule(cdc, keeper, ak, bk) +func NewAppModule(cdc codec.Codec, govkeeper keeper.Keeper, ak govtypes.AccountKeeper, bk govtypes.BankKeeper, isProposalWhitelisted func(govtypes.Content) bool) AppModule { + govAppModule := gov.NewAppModule(cdc, govkeeper, ak, bk) return AppModule{ AppModule: govAppModule, - keeper: keeper, + keeper: govkeeper, isProposalWhitelisted: isProposalWhitelisted, } } func (am AppModule) EndBlock(ctx sdk.Context, request abci.RequestEndBlock) []abci.ValidatorUpdate { - am.keeper.IterateActiveProposalsQueue(ctx, ctx.BlockHeader().Time, func(proposal govtypes.Proposal) bool { - //if there are forbidden proposals in active proposals queue, refund deposit, delete votes for that proposal - //and delete proposal from all storages + // if there are forbidden proposals in active proposals queue, refund deposit, delete votes for that proposal + // and delete proposal from all storages deleteForbiddenProposal(ctx, am, proposal) return false }) @@ -58,9 +57,9 @@ func deleteForbiddenProposal(ctx sdk.Context, am AppModule, proposal govtypes.Pr return } - //delete the votes related to the proposal calling Tally - //Tally's return result won't be used in decision if the tokens will be burned or refunded (they are always refunded), but - //this function needs to be called to delete the votes related to the given proposal, since the deleteVote function is + // delete the votes related to the proposal calling Tally + // Tally's return result won't be used in decision if the tokens will be burned or refunded (they are always refunded), but + // this function needs to be called to delete the votes related to the given proposal, since the deleteVote function is // private and cannot be called directly from the overridden app module am.keeper.Tally(ctx, proposal) diff --git a/x/ccv/democracy/staking/module.go b/x/ccv/democracy/staking/module.go index aa27177f0a..3a99c9753a 100644 --- a/x/ccv/democracy/staking/module.go +++ b/x/ccv/democracy/staking/module.go @@ -36,11 +36,11 @@ type AppModule struct { // NewAppModule creates a new AppModule object using the native x/staking module // AppModule constructor. -func NewAppModule(cdc codec.Codec, keeper keeper.Keeper, ak types.AccountKeeper, bk types.BankKeeper) AppModule { - stakingAppMod := staking.NewAppModule(cdc, keeper, ak, bk) +func NewAppModule(cdc codec.Codec, stakingkeeper keeper.Keeper, ak types.AccountKeeper, bk types.BankKeeper) AppModule { + stakingAppMod := staking.NewAppModule(cdc, stakingkeeper, ak, bk) return AppModule{ AppModule: stakingAppMod, - keeper: keeper, + keeper: stakingkeeper, accKeeper: ak, bankKeeper: bk, } diff --git a/x/ccv/provider/client/cli/tx.go b/x/ccv/provider/client/cli/tx.go index edd230e15c..98c9eb6585 100644 --- a/x/ccv/provider/client/cli/tx.go +++ b/x/ccv/provider/client/cli/tx.go @@ -1,10 +1,10 @@ package cli import ( - "github.com/spf13/cobra" - "fmt" + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" diff --git a/x/ccv/provider/client/proposal_handler.go b/x/ccv/provider/client/proposal_handler.go index 8be7f0fb56..67bc21cb61 100644 --- a/x/ccv/provider/client/proposal_handler.go +++ b/x/ccv/provider/client/proposal_handler.go @@ -75,7 +75,7 @@ Where proposal.json contains: } content := types.NewConsumerAdditionProposal( - proposal.Title, proposal.Description, proposal.ChainId, proposal.InitialHeight, + proposal.Title, proposal.Description, proposal.ChainID, proposal.InitialHeight, proposal.GenesisHash, proposal.BinaryHash, proposal.SpawnTime, proposal.ConsumerRedistributionFraction, proposal.BlocksPerDistributionTransmission, proposal.HistoricalEntries, proposal.CcvTimeoutPeriod, proposal.TransferTimeoutPeriod, proposal.UnbondingPeriod) @@ -131,7 +131,7 @@ Where proposal.json contains: } content := types.NewConsumerRemovalProposal( - proposal.Title, proposal.Description, proposal.ChainId, proposal.StopTime) + proposal.Title, proposal.Description, proposal.ChainID, proposal.StopTime) from := clientCtx.GetFromAddress() @@ -211,7 +211,7 @@ Where proposal.json contains: type ConsumerAdditionProposalJSON struct { Title string `json:"title"` Description string `json:"description"` - ChainId string `json:"chain_id"` + ChainID string `json:"chain_id"` InitialHeight clienttypes.Height `json:"initial_height"` GenesisHash []byte `json:"genesis_hash"` BinaryHash []byte `json:"binary_hash"` @@ -233,7 +233,7 @@ type ConsumerAdditionProposalReq struct { Title string `json:"title"` Description string `json:"description"` - ChainId string `json:"chainId"` + ChainID string `json:"chainId"` InitialHeight clienttypes.Height `json:"initialHeight"` GenesisHash []byte `json:"genesisHash"` BinaryHash []byte `json:"binaryHash"` @@ -267,7 +267,7 @@ func ParseConsumerAdditionProposalJSON(proposalFile string) (ConsumerAdditionPro type ConsumerRemovalProposalJSON struct { Title string `json:"title"` Description string `json:"description"` - ChainId string `json:"chain_id"` + ChainID string `json:"chain_id"` StopTime time.Time `json:"stop_time"` Deposit string `json:"deposit"` } @@ -278,7 +278,7 @@ type ConsumerRemovalProposalReq struct { Title string `json:"title"` Description string `json:"description"` - ChainId string `json:"chainId"` + ChainID string `json:"chainId"` StopTime time.Time `json:"stopTime"` Deposit sdk.Coins `json:"deposit"` @@ -368,7 +368,7 @@ func postConsumerAdditionProposalHandlerFn(clientCtx client.Context) http.Handle } content := types.NewConsumerAdditionProposal( - req.Title, req.Description, req.ChainId, req.InitialHeight, + req.Title, req.Description, req.ChainID, req.InitialHeight, req.GenesisHash, req.BinaryHash, req.SpawnTime, req.ConsumerRedistributionFraction, req.BlocksPerDistributionTransmission, req.HistoricalEntries, req.CcvTimeoutPeriod, req.TransferTimeoutPeriod, req.UnbondingPeriod) @@ -399,7 +399,7 @@ func postConsumerRemovalProposalHandlerFn(clientCtx client.Context) http.Handler } content := types.NewConsumerRemovalProposal( - req.Title, req.Description, req.ChainId, req.StopTime, + req.Title, req.Description, req.ChainID, req.StopTime, ) msg, err := govtypes.NewMsgSubmitProposal(content, req.Deposit, req.Proposer) diff --git a/x/ccv/provider/handler_test.go b/x/ccv/provider/handler_test.go index 8579d41d6d..092febd125 100644 --- a/x/ccv/provider/handler_test.go +++ b/x/ccv/provider/handler_test.go @@ -28,13 +28,12 @@ func TestInvalidMsg(t *testing.T) { } func TestAssignConsensusKeyForConsumerChain(t *testing.T) { + providerCryptoID := testcrypto.NewCryptoIdentityFromIntSeed(0) + providerConsAddr := providerCryptoID.ProviderConsAddress() - providerCryptoId := testcrypto.NewCryptoIdentityFromIntSeed(0) - providerConsAddr := providerCryptoId.ProviderConsAddress() - - consumerCryptoId := testcrypto.NewCryptoIdentityFromIntSeed(1) - consumerConsAddr := consumerCryptoId.ConsumerConsAddress() - consumerKey := consumerCryptoId.ConsensusSDKPubKey() + consumerCryptoID := testcrypto.NewCryptoIdentityFromIntSeed(1) + consumerConsAddr := consumerCryptoID.ConsumerConsAddress() + consumerKey := consumerCryptoID.ConsensusSDKPubKey() testCases := []struct { name string @@ -46,13 +45,13 @@ func TestAssignConsensusKeyForConsumerChain(t *testing.T) { { name: "success", setup: func(ctx sdk.Context, - k keeper.Keeper, mocks testkeeper.MockedKeepers) { - + k keeper.Keeper, mocks testkeeper.MockedKeepers, + ) { gomock.InOrder( mocks.MockStakingKeeper.EXPECT().GetValidator( - ctx, providerCryptoId.SDKValOpAddress(), + ctx, providerCryptoID.SDKValOpAddress(), // Return a valid validator, found! - ).Return(providerCryptoId.SDKStakingValidator(), true).Times(1), + ).Return(providerCryptoID.SDKStakingValidator(), true).Times(1), mocks.MockStakingKeeper.EXPECT().GetValidatorByConsAddr(ctx, consumerConsAddr.ToSdkConsAddr(), ).Return(stakingtypes.Validator{}, false), @@ -64,11 +63,11 @@ func TestAssignConsensusKeyForConsumerChain(t *testing.T) { { name: "fail: missing validator", setup: func(ctx sdk.Context, - k keeper.Keeper, mocks testkeeper.MockedKeepers) { - + k keeper.Keeper, mocks testkeeper.MockedKeepers, + ) { gomock.InOrder( mocks.MockStakingKeeper.EXPECT().GetValidator( - ctx, providerCryptoId.SDKValOpAddress(), + ctx, providerCryptoID.SDKValOpAddress(), // return false: not found! ).Return(stakingtypes.Validator{}, false).Times(1), ) @@ -79,16 +78,16 @@ func TestAssignConsensusKeyForConsumerChain(t *testing.T) { { name: "fail: consumer key in use", setup: func(ctx sdk.Context, - k keeper.Keeper, mocks testkeeper.MockedKeepers) { - + k keeper.Keeper, mocks testkeeper.MockedKeepers, + ) { // Use the consumer key already k.SetValidatorByConsumerAddr(ctx, "chainid", consumerConsAddr, providerConsAddr) gomock.InOrder( mocks.MockStakingKeeper.EXPECT().GetValidator( - ctx, providerCryptoId.SDKValOpAddress(), + ctx, providerCryptoID.SDKValOpAddress(), // Return a valid validator, found! - ).Return(providerCryptoId.SDKStakingValidator(), true).Times(1), + ).Return(providerCryptoID.SDKStakingValidator(), true).Times(1), mocks.MockStakingKeeper.EXPECT().GetValidatorByConsAddr(ctx, consumerConsAddr.ToSdkConsAddr(), ).Return(stakingtypes.Validator{}, false), @@ -101,13 +100,12 @@ func TestAssignConsensusKeyForConsumerChain(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - k, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) tc.setup(ctx, k, mocks) msg, err := providertypes.NewMsgAssignConsumerKey(tc.chainID, - providerCryptoId.SDKValOpAddress(), consumerKey, + providerCryptoID.SDKValOpAddress(), consumerKey, ) require.NoError(t, err) diff --git a/x/ccv/provider/ibc_module.go b/x/ccv/provider/ibc_module.go index 5261ef7572..574876038d 100644 --- a/x/ccv/provider/ibc_module.go +++ b/x/ccv/provider/ibc_module.go @@ -19,17 +19,16 @@ import ( // // See: https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/methods.md#ccv-pcf-coinit1 // Spec Tag: [CCV-PCF-COINIT.1] -func (am AppModule) OnChanOpenInit( - ctx sdk.Context, - order channeltypes.Order, - connectionHops []string, - portID string, - channelID string, - channelCap *capabilitytypes.Capability, - counterparty channeltypes.Counterparty, +func (AppModule) OnChanOpenInit( + _ sdk.Context, + _ channeltypes.Order, + _ []string, + _ string, + _ string, + _ *capabilitytypes.Capability, + _ channeltypes.Counterparty, version string, ) (string, error) { - return version, sdkerrors.Wrap(ccv.ErrInvalidChannelFlow, "channel handshake must be initiated by consumer chain") } @@ -47,7 +46,6 @@ func (am AppModule) OnChanOpenTry( counterparty channeltypes.Counterparty, counterpartyVersion string, ) (metadata string, err error) { - // Validate parameters if err := validateCCVChannelParams( ctx, am.keeper, order, portID, @@ -100,7 +98,7 @@ func (am AppModule) OnChanOpenTry( // validateCCVChannelParams validates a ccv channel func validateCCVChannelParams( ctx sdk.Context, - keeper *keeper.Keeper, + providerkeeper *keeper.Keeper, order channeltypes.Order, portID string, ) error { @@ -109,7 +107,7 @@ func validateCCVChannelParams( } // the port ID must match the port ID the CCV module is bounded to - boundPort := keeper.GetPort(ctx) + boundPort := providerkeeper.GetPort(ctx) if boundPort != portID { return sdkerrors.Wrapf(porttypes.ErrInvalidPort, "invalid port: %s, expected %s", portID, boundPort) } @@ -120,12 +118,12 @@ func validateCCVChannelParams( // // See: https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/methods.md#ccv-pcf-coack1 // Spec tag: [CCV-PCF-COACK.1] -func (am AppModule) OnChanOpenAck( - ctx sdk.Context, - portID, - channelID string, - counterpartyChannelID string, - counterpartyVersion string, +func (AppModule) OnChanOpenAck( + _ sdk.Context, + _ string, + _ string, + _ string, + _ string, ) error { return sdkerrors.Wrap(ccv.ErrInvalidChannelFlow, "channel handshake must be initiated by consumer chain") } @@ -136,7 +134,7 @@ func (am AppModule) OnChanOpenAck( // Spec tag: [CCV-PCF-COCONFIRM.1] func (am AppModule) OnChanOpenConfirm( ctx sdk.Context, - portID, + _ string, channelID string, ) error { err := am.keeper.SetConsumerChain(ctx, channelID) @@ -147,20 +145,20 @@ func (am AppModule) OnChanOpenConfirm( } // OnChanCloseInit implements the IBCModule interface -func (am AppModule) OnChanCloseInit( - ctx sdk.Context, - portID, - channelID string, +func (AppModule) OnChanCloseInit( + _ sdk.Context, + _ string, + _ string, ) error { // Disallow user-initiated channel closing for provider channels return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "user cannot close channel") } // OnChanCloseConfirm implements the IBCModule interface -func (am AppModule) OnChanCloseConfirm( - ctx sdk.Context, - portID, - channelID string, +func (AppModule) OnChanCloseConfirm( + _ sdk.Context, + _ string, + _ string, ) error { return nil } @@ -259,7 +257,6 @@ func (am AppModule) OnTimeoutPacket( packet channeltypes.Packet, _ sdk.AccAddress, ) error { - if err := am.keeper.OnTimeoutPacket(ctx, packet); err != nil { return err } diff --git a/x/ccv/provider/ibc_module_test.go b/x/ccv/provider/ibc_module_test.go index 681cb62482..1cc1fa6a23 100644 --- a/x/ccv/provider/ibc_module_test.go +++ b/x/ccv/provider/ibc_module_test.go @@ -24,7 +24,6 @@ import ( // See: https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/methods.md#ccv-pcf-coinit1 // Spec Tag: [CCV-PCF-COINIT.1] func TestOnChanOpenInit(t *testing.T) { - providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx( t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() @@ -49,7 +48,6 @@ func TestOnChanOpenInit(t *testing.T) { // See: https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/methods.md#ccv-pcf-cotry1 // Spec tag: [CCV-PCF-COTRY.1] func TestOnChanOpenTry(t *testing.T) { - // Params for the ChanOpenTry method type params struct { ctx sdk.Context @@ -92,7 +90,7 @@ func TestOnChanOpenTry(t *testing.T) { }, { "unexpected client ID mapped to chain ID", func(params *params, keeper *providerkeeper.Keeper) { - keeper.SetConsumerClientId( + keeper.SetConsumerClientID( params.ctx, "consumerChainID", "invalidClientID", @@ -111,15 +109,15 @@ func TestOnChanOpenTry(t *testing.T) { }, } + // Run test cases for _, tc := range testCases { - // Setup providerKeeper, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx( t, testkeeper.NewInMemKeeperParams(t)) providerModule := provider.NewAppModule(&providerKeeper) providerKeeper.SetPort(ctx, ccv.ProviderPortID) - providerKeeper.SetConsumerClientId(ctx, "consumerChainID", "clientIDToConsumer") + providerKeeper.SetConsumerClientID(ctx, "consumerChainID", "clientIDToConsumer") // Instantiate valid params as default. Individual test cases mutate these as needed. params := params{ @@ -207,7 +205,6 @@ func TestOnChanOpenAck(t *testing.T) { // TODO: Validate spec requirement that duplicate channels attempting to become canonical CCV channel are closed. // See: https://github.com/cosmos/interchain-security/issues/327 func TestOnChanOpenConfirm(t *testing.T) { - testCases := []struct { name string mockExpectations func(sdk.Context, testkeeper.MockedKeepers) []*gomock.Call @@ -298,7 +295,6 @@ func TestOnChanOpenConfirm(t *testing.T) { } for _, tc := range testCases { - providerKeeper, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx( t, testkeeper.NewInMemKeeperParams(t)) @@ -313,7 +309,6 @@ func TestOnChanOpenConfirm(t *testing.T) { err := providerModule.OnChanOpenConfirm(ctx, "providerPortID", "channelID") if tc.expPass { - require.NoError(t, err) // Validate channel mappings channelID, found := providerKeeper.GetChainToChannel(ctx, "consumerChainID") @@ -327,7 +322,6 @@ func TestOnChanOpenConfirm(t *testing.T) { height, found := providerKeeper.GetInitChainHeight(ctx, "consumerChainID") require.True(t, found) require.Equal(t, ctx.BlockHeight(), int64(height)) - } else { require.Error(t, err) } diff --git a/x/ccv/provider/keeper/genesis.go b/x/ccv/provider/keeper/genesis.go index 02ac8c81d3..b4940864f9 100644 --- a/x/ccv/provider/keeper/genesis.go +++ b/x/ccv/provider/keeper/genesis.go @@ -24,7 +24,7 @@ func (k Keeper) InitGenesis(ctx sdk.Context, genState *types.GenesisState) { } } - k.SetValidatorSetUpdateId(ctx, genState.ValsetUpdateId) + k.SetValidatorSetUpdateID(ctx, genState.ValsetUpdateId) for _, v2h := range genState.ValsetUpdateIdToHeight { k.SetValsetUpdateBlockHeight(ctx, v2h.ValsetUpdateId, v2h.Height) } @@ -51,7 +51,7 @@ func (k Keeper) InitGenesis(ctx sdk.Context, genState *types.GenesisState) { // Set initial state for each consumer chain for _, cs := range genState.ConsumerStates { chainID := cs.ChainId - k.SetConsumerClientId(ctx, chainID, cs.ClientId) + k.SetConsumerClientID(ctx, chainID, cs.ClientId) if err := k.SetConsumerGenesis(ctx, chainID, cs.ConsumerGenesis); err != nil { // An error here would indicate something is very wrong, // the ConsumerGenesis validated in ConsumerState.Validate(). @@ -98,6 +98,7 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { // export states for each consumer chains var consumerStates []types.ConsumerState for _, chain := range registeredChains { + // get consumer chain genesis gen, found := k.GetConsumerGenesis(ctx, chain.ChainId) if !found { panic(fmt.Errorf("cannot find genesis for consumer chain %s with client %s", chain.ChainId, chain.ClientId)) @@ -112,9 +113,9 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { } // try to find channel id for the current consumer chain - channelId, found := k.GetChainToChannel(ctx, chain.ChainId) + channelID, found := k.GetChainToChannel(ctx, chain.ChainId) if found { - cs.ChannelId = channelId + cs.ChannelId = channelID cs.InitialHeight, found = k.GetInitChainHeight(ctx, chain.ChainId) if !found { panic(fmt.Errorf("cannot find init height for consumer chain %s", chain.ChainId)) @@ -124,7 +125,6 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { cs.PendingValsetChanges = k.GetPendingVSCPackets(ctx, chain.ChainId) consumerStates = append(consumerStates, cs) - } // ConsumerAddrsToPrune are added only for registered consumer chains @@ -136,7 +136,7 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { params := k.GetParams(ctx) return types.NewGenesisState( - k.GetValidatorSetUpdateId(ctx), + k.GetValidatorSetUpdateID(ctx), k.GetAllValsetUpdateBlockHeights(ctx), consumerStates, k.GetAllUnbondingOps(ctx), diff --git a/x/ccv/provider/keeper/genesis_test.go b/x/ccv/provider/keeper/genesis_test.go index d9f371bc2a..f88592503e 100644 --- a/x/ccv/provider/keeper/genesis_test.go +++ b/x/ccv/provider/keeper/genesis_test.go @@ -28,12 +28,12 @@ func TestInitAndExportGenesis(t *testing.T) { params := providertypes.DefaultParams() // create validator keys and addresses for key assignment - providerCryptoId := crypto.NewCryptoIdentityFromIntSeed(7896) - provAddr := providerCryptoId.ProviderConsAddress() + providerCryptoID := crypto.NewCryptoIdentityFromIntSeed(7896) + provAddr := providerCryptoID.ProviderConsAddress() - consumerCryptoId := crypto.NewCryptoIdentityFromIntSeed(7897) - consumerTmPubKey := consumerCryptoId.TMProtoCryptoPublicKey() - consumerConsAddr := consumerCryptoId.ConsumerConsAddress() + consumerCryptoID := crypto.NewCryptoIdentityFromIntSeed(7897) + consumerTmPubKey := consumerCryptoID.TMProtoCryptoPublicKey() + consumerConsAddr := consumerCryptoID.ConsumerConsAddress() // create genesis struct provGenesis := providertypes.NewGenesisState(vscID, @@ -135,7 +135,7 @@ func TestInitAndExportGenesis(t *testing.T) { chainID, found := pk.GetChannelToChain(ctx, provGenesis.ConsumerStates[0].ChannelId) require.True(t, found) require.Equal(t, cChainIDs[0], chainID) - require.Equal(t, vscID, pk.GetValidatorSetUpdateId(ctx)) + require.Equal(t, vscID, pk.GetValidatorSetUpdateID(ctx)) height, found := pk.GetValsetUpdateBlockHeight(ctx, vscID) require.True(t, found) require.Equal(t, initHeight, height) @@ -172,7 +172,7 @@ func assertConsumerChainStates(ctx sdk.Context, t *testing.T, pk keeper.Keeper, require.True(t, found) require.Equal(t, *consumertypes.DefaultGenesisState(), gen) - clientID, found := pk.GetConsumerClientId(ctx, chainID) + clientID, found := pk.GetConsumerClientID(ctx, chainID) require.True(t, found) require.Equal(t, cs.ClientId, clientID) diff --git a/x/ccv/provider/keeper/grpc_query.go b/x/ccv/provider/keeper/grpc_query.go index 1d159496cb..b7a6f05ee0 100644 --- a/x/ccv/provider/keeper/grpc_query.go +++ b/x/ccv/provider/keeper/grpc_query.go @@ -28,7 +28,7 @@ func (k Keeper) QueryConsumerGenesis(c context.Context, req *types.QueryConsumer gen, ok := k.GetConsumerGenesis(ctx, req.ChainId) if !ok { - return nil, sdkerrors.Wrap(types.ErrUnknownConsumerChainId, req.ChainId) + return nil, sdkerrors.Wrap(types.ErrUnknownConsumerChainID, req.ChainId) } return &types.QueryConsumerGenesisResponse{GenesisState: gen}, nil @@ -230,7 +230,6 @@ func (k Keeper) getSlashPacketData(ctx sdk.Context, consumerChainID string, ibcS packet := ccvtypes.SlashPacketData{} err := packet.Unmarshal(bz[1:]) - if err != nil { // If the data cannot be unmarshaled, it is considered not found return ccvtypes.SlashPacketData{}, false diff --git a/x/ccv/provider/keeper/hooks.go b/x/ccv/provider/keeper/hooks.go index 15f3dc5bbc..eec3eb8755 100644 --- a/x/ccv/provider/keeper/hooks.go +++ b/x/ccv/provider/keeper/hooks.go @@ -23,7 +23,7 @@ func (k *Keeper) Hooks() Hooks { } // This stores a record of each unbonding op from staking, allowing us to track which consumer chains have unbonded -func (h Hooks) AfterUnbondingInitiated(ctx sdk.Context, ID uint64) error { +func (h Hooks) AfterUnbondingInitiated(ctx sdk.Context, id uint64) error { var consumerChainIDS []string for _, chain := range h.k.GetAllConsumerChains(ctx) { @@ -34,23 +34,23 @@ func (h Hooks) AfterUnbondingInitiated(ctx sdk.Context, ID uint64) error { // Do not put the unbonding op on hold if there are no consumer chains return nil } - valsetUpdateID := h.k.GetValidatorSetUpdateId(ctx) + valsetUpdateID := h.k.GetValidatorSetUpdateID(ctx) unbondingOp := providertypes.UnbondingOp{ - Id: ID, + Id: id, UnbondingConsumerChains: consumerChainIDS, } // Add to indexes for _, consumerChainID := range consumerChainIDS { index, _ := h.k.GetUnbondingOpIndex(ctx, consumerChainID, valsetUpdateID) - index = append(index, ID) + index = append(index, id) h.k.SetUnbondingOpIndex(ctx, consumerChainID, valsetUpdateID, index) } h.k.SetUnbondingOp(ctx, unbondingOp) // Call back into staking to tell it to stop this op from unbonding when the unbonding period is complete - if err := h.k.stakingKeeper.PutUnbondingOnHold(ctx, ID); err != nil { + if err := h.k.stakingKeeper.PutUnbondingOnHold(ctx, id); err != nil { // If there was an error putting the unbonding on hold, panic to end execution for // the current tx and prevent committal of this invalid state. // @@ -101,7 +101,7 @@ func (h Hooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) { } } -func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, valConsAddr sdk.ConsAddress, valAddr sdk.ValAddress) { +func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, valConsAddr sdk.ConsAddress, _ sdk.ValAddress) { for _, validatorConsumerPubKey := range h.k.GetAllValidatorConsumerPubKeys(ctx, nil) { if validatorConsumerPubKey.ProviderAddr.ToSdkConsAddr().Equals(valConsAddr) { consumerAddrTmp, err := utils.TMCryptoPublicKeyToConsAddr(*validatorConsumerPubKey.ConsumerKey) @@ -116,19 +116,26 @@ func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, valConsAddr sdk.ConsAddres } } -func (h Hooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) { +func (Hooks) BeforeDelegationCreated(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) { } -func (h Hooks) BeforeDelegationSharesModified(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) { + +func (Hooks) BeforeDelegationSharesModified(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) { } -func (h Hooks) AfterDelegationModified(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) { + +func (Hooks) AfterDelegationModified(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) { } -func (h Hooks) BeforeValidatorSlashed(_ sdk.Context, _ sdk.ValAddress, _ sdk.Dec) { + +func (Hooks) BeforeValidatorSlashed(_ sdk.Context, _ sdk.ValAddress, _ sdk.Dec) { } -func (h Hooks) BeforeValidatorModified(_ sdk.Context, _ sdk.ValAddress) { + +func (Hooks) BeforeValidatorModified(_ sdk.Context, _ sdk.ValAddress) { } -func (h Hooks) AfterValidatorBonded(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) { + +func (Hooks) AfterValidatorBonded(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) { } -func (h Hooks) AfterValidatorBeginUnbonding(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) { + +func (Hooks) AfterValidatorBeginUnbonding(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) { } -func (h Hooks) BeforeDelegationRemoved(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) { + +func (Hooks) BeforeDelegationRemoved(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) { } diff --git a/x/ccv/provider/keeper/hooks_test.go b/x/ccv/provider/keeper/hooks_test.go index c0698cc1a9..ff01e295f9 100644 --- a/x/ccv/provider/keeper/hooks_test.go +++ b/x/ccv/provider/keeper/hooks_test.go @@ -11,7 +11,6 @@ import ( ) func TestValidatorConsensusKeyInUse(t *testing.T) { - newValidator := cryptotestutil.NewCryptoIdentityFromIntSeed(0) anotherValidator0 := cryptotestutil.NewCryptoIdentityFromIntSeed(1) anotherValidator1 := cryptotestutil.NewCryptoIdentityFromIntSeed(2) diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index 2fd44a05cf..1c75611bfa 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -81,7 +81,6 @@ func NewKeeper( // Validates that the provider keeper is initialized with non-zero and // non-nil values for all its fields. Otherwise this method will panic. func (k Keeper) mustValidateFields() { - // Ensures no fields are missed in this validation if reflect.ValueOf(k).NumField() != 13 { panic("number of fields in provider keeper is not 13") @@ -103,7 +102,7 @@ func (k Keeper) mustValidateFields() { } // Logger returns a module-specific logger. -func (k Keeper) Logger(ctx sdk.Context) log.Logger { +func (Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", "x/"+host.ModuleName+"-"+types.ModuleName) } @@ -116,8 +115,8 @@ func (k Keeper) IsBound(ctx sdk.Context, portID string) bool { // BindPort defines a wrapper function for the port Keeper's function in // order to expose it to module's InitGenesis function func (k Keeper) BindPort(ctx sdk.Context, portID string) error { - cap := k.portKeeper.BindPort(ctx, portID) - return k.ClaimCapability(ctx, cap, host.PortPath(portID)) + portCap := k.portKeeper.BindPort(ctx, portID) + return k.ClaimCapability(ctx, portCap, host.PortPath(portID)) } // GetPort returns the portID for the CCV module. Used in ExportGenesis @@ -272,7 +271,7 @@ func (k Keeper) DeleteConsumerGenesis(ctx sdk.Context, chainID string) { // VerifyConsumerChain verifies that the chain trying to connect on the channel handshake // is the expected consumer chain. -func (k Keeper) VerifyConsumerChain(ctx sdk.Context, channelID string, connectionHops []string) error { +func (k Keeper) VerifyConsumerChain(ctx sdk.Context, _ string, connectionHops []string) error { if len(connectionHops) != 1 { return sdkerrors.Wrap(channeltypes.ErrTooManyConnectionHops, "must have direct connection to provider chain") } @@ -281,12 +280,12 @@ func (k Keeper) VerifyConsumerChain(ctx sdk.Context, channelID string, connectio if err != nil { return err } - ccvClientId, found := k.GetConsumerClientId(ctx, tmClient.ChainId) + ccvClientID, found := k.GetConsumerClientID(ctx, tmClient.ChainId) if !found { return sdkerrors.Wrapf(ccv.ErrClientNotFound, "cannot find client for consumer chain %s", tmClient.ChainId) } - if ccvClientId != clientID { - return sdkerrors.Wrapf(ccv.ErrInvalidConsumerClient, "CCV channel must be built on top of CCV client. expected %s, got %s", ccvClientId, clientID) + if ccvClientID != clientID { + return sdkerrors.Wrapf(ccv.ErrInvalidConsumerClient, "CCV channel must be built on top of CCV client. expected %s, got %s", ccvClientID, clientID) } // Verify that there isn't already a CCV channel for the consumer chain @@ -442,7 +441,7 @@ func (k Keeper) RemoveConsumerFromUnbondingOp(ctx sdk.Context, id uint64, chainI k.SetUnbondingOp(ctx, unbondingOp) } } - return + return canComplete } func removeStringFromSlice(slice []string, x string) (newSlice []string, numRemoved int) { @@ -457,12 +456,12 @@ func removeStringFromSlice(slice []string, x string) (newSlice []string, numRemo // SetUnbondingOpIndex sets the IDs of unbonding operations that are waiting for // a VSCMaturedPacket with vscID from a consumer with chainID -func (k Keeper) SetUnbondingOpIndex(ctx sdk.Context, chainID string, vscID uint64, IDs []uint64) { +func (k Keeper) SetUnbondingOpIndex(ctx sdk.Context, chainID string, vscID uint64, ids []uint64) { store := ctx.KVStore(k.storeKey) vscUnbondingOps := types.VscUnbondingOps{ VscId: vscID, - UnbondingOpIds: IDs, + UnbondingOpIds: ids, } bz, err := vscUnbondingOps.Marshal() if err != nil { @@ -483,7 +482,7 @@ func (k Keeper) SetUnbondingOpIndex(ctx sdk.Context, chainID string, vscID uint6 // Thus, the returned array is in ascending order of vscIDs. func (k Keeper) GetAllUnbondingOpIndexes(ctx sdk.Context, chainID string) (indexes []types.VscUnbondingOps) { store := ctx.KVStore(k.storeKey) - iterator := sdk.KVStorePrefixIterator(store, types.ChainIdWithLenKey(types.UnbondingOpIndexBytePrefix, chainID)) + iterator := sdk.KVStorePrefixIterator(store, types.ChainIDWithLenKey(types.UnbondingOpIndexBytePrefix, chainID)) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { @@ -632,47 +631,47 @@ func (k Keeper) chanCloseInit(ctx sdk.Context, channelID string) error { return k.channelKeeper.ChanCloseInit(ctx, ccv.ProviderPortID, channelID, chanCap) } -func (k Keeper) IncrementValidatorSetUpdateId(ctx sdk.Context) { - validatorSetUpdateId := k.GetValidatorSetUpdateId(ctx) - k.SetValidatorSetUpdateId(ctx, validatorSetUpdateId+1) +func (k Keeper) IncrementValidatorSetUpdateID(ctx sdk.Context) { + validatorSetUpdateID := k.GetValidatorSetUpdateID(ctx) + k.SetValidatorSetUpdateID(ctx, validatorSetUpdateID+1) } -func (k Keeper) SetValidatorSetUpdateId(ctx sdk.Context, valUpdateID uint64) { +func (k Keeper) SetValidatorSetUpdateID(ctx sdk.Context, valUpdateID uint64) { store := ctx.KVStore(k.storeKey) // Convert back into bytes for storage bz := make([]byte, 8) binary.BigEndian.PutUint64(bz, valUpdateID) - store.Set(types.ValidatorSetUpdateIdKey(), bz) + store.Set(types.ValidatorSetUpdateIDKey(), bz) } -func (k Keeper) GetValidatorSetUpdateId(ctx sdk.Context) (validatorSetUpdateId uint64) { +func (k Keeper) GetValidatorSetUpdateID(ctx sdk.Context) (validatorSetUpdateID uint64) { store := ctx.KVStore(k.storeKey) - bz := store.Get(types.ValidatorSetUpdateIdKey()) + bz := store.Get(types.ValidatorSetUpdateIDKey()) if bz == nil { - validatorSetUpdateId = 0 + validatorSetUpdateID = 0 } else { // Unmarshal - validatorSetUpdateId = binary.BigEndian.Uint64(bz) + validatorSetUpdateID = binary.BigEndian.Uint64(bz) } - return validatorSetUpdateId + return validatorSetUpdateID } // SetValsetUpdateBlockHeight sets the block height for a given valset update id -func (k Keeper) SetValsetUpdateBlockHeight(ctx sdk.Context, valsetUpdateId, blockHeight uint64) { +func (k Keeper) SetValsetUpdateBlockHeight(ctx sdk.Context, valsetUpdateID, blockHeight uint64) { store := ctx.KVStore(k.storeKey) heightBytes := make([]byte, 8) binary.BigEndian.PutUint64(heightBytes, blockHeight) - store.Set(types.ValsetUpdateBlockHeightKey(valsetUpdateId), heightBytes) + store.Set(types.ValsetUpdateBlockHeightKey(valsetUpdateID), heightBytes) } // GetValsetUpdateBlockHeight gets the block height for a given valset update id -func (k Keeper) GetValsetUpdateBlockHeight(ctx sdk.Context, valsetUpdateId uint64) (uint64, bool) { +func (k Keeper) GetValsetUpdateBlockHeight(ctx sdk.Context, valsetUpdateID uint64) (uint64, bool) { store := ctx.KVStore(k.storeKey) - bz := store.Get(types.ValsetUpdateBlockHeightKey(valsetUpdateId)) + bz := store.Get(types.ValsetUpdateBlockHeightKey(valsetUpdateID)) if bz == nil { return 0, false } @@ -690,11 +689,11 @@ func (k Keeper) GetAllValsetUpdateBlockHeights(ctx sdk.Context) (valsetUpdateBlo defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - valsetUpdateId := binary.BigEndian.Uint64(iterator.Key()[1:]) + valsetUpdateID := binary.BigEndian.Uint64(iterator.Key()[1:]) height := binary.BigEndian.Uint64(iterator.Value()) valsetUpdateBlockHeights = append(valsetUpdateBlockHeights, types.ValsetUpdateIdToHeight{ - ValsetUpdateId: valsetUpdateId, + ValsetUpdateId: valsetUpdateID, Height: height, }) } @@ -703,9 +702,9 @@ func (k Keeper) GetAllValsetUpdateBlockHeights(ctx sdk.Context) (valsetUpdateBlo } // DeleteValsetUpdateBlockHeight deletes the block height value for a given vaset update id -func (k Keeper) DeleteValsetUpdateBlockHeight(ctx sdk.Context, valsetUpdateId uint64) { +func (k Keeper) DeleteValsetUpdateBlockHeight(ctx sdk.Context, valsetUpdateID uint64) { store := ctx.KVStore(k.storeKey) - store.Delete(types.ValsetUpdateBlockHeightKey(valsetUpdateId)) + store.Delete(types.ValsetUpdateBlockHeightKey(valsetUpdateID)) } // SetSlashAcks sets the slash acks under the given chain ID @@ -751,11 +750,11 @@ func (k Keeper) GetSlashAcks(ctx sdk.Context, chainID string) []string { func (k Keeper) ConsumeSlashAcks(ctx sdk.Context, chainID string) (acks []string) { acks = k.GetSlashAcks(ctx, chainID) if len(acks) < 1 { - return + return nil } store := ctx.KVStore(k.storeKey) store.Delete(types.SlashAcksKey(chainID)) - return + return acks } // DeleteSlashAcks deletes the slash acks for a given chain ID @@ -838,24 +837,24 @@ func (k Keeper) DeletePendingVSCPackets(ctx sdk.Context, chainID string) { store.Delete(types.PendingVSCsKey(chainID)) } -// SetConsumerClientId sets the client ID for the given chain ID -func (k Keeper) SetConsumerClientId(ctx sdk.Context, chainID, clientID string) { +// SetConsumerClientID sets the client ID for the given chain ID +func (k Keeper) SetConsumerClientID(ctx sdk.Context, chainID, clientID string) { store := ctx.KVStore(k.storeKey) store.Set(types.ChainToClientKey(chainID), []byte(clientID)) } -// GetConsumerClientId returns the client ID for the given chain ID. -func (k Keeper) GetConsumerClientId(ctx sdk.Context, chainID string) (string, bool) { +// GetConsumerClientID returns the client ID for the given chain ID. +func (k Keeper) GetConsumerClientID(ctx sdk.Context, chainID string) (string, bool) { store := ctx.KVStore(k.storeKey) - clientIdBytes := store.Get(types.ChainToClientKey(chainID)) - if clientIdBytes == nil { + clientIDBytes := store.Get(types.ChainToClientKey(chainID)) + if clientIDBytes == nil { return "", false } - return string(clientIdBytes), true + return string(clientIDBytes), true } // DeleteConsumerClientId removes from the store the clientID for the given chainID. -func (k Keeper) DeleteConsumerClientId(ctx sdk.Context, chainID string) { +func (k Keeper) DeleteConsumerClientID(ctx sdk.Context, chainID string) { store := ctx.KVStore(k.storeKey) store.Delete(types.ChainToClientKey(chainID)) } @@ -956,7 +955,7 @@ func (k Keeper) DeleteVscSendTimestamp(ctx sdk.Context, chainID string, vscID ui // Thus, the iteration is in ascending order of vscIDs, and as a result in send timestamp order. func (k Keeper) GetAllVscSendTimestamps(ctx sdk.Context, chainID string) (vscSendTimestamps []types.VscSendTimestamp) { store := ctx.KVStore(k.storeKey) - iterator := sdk.KVStorePrefixIterator(store, types.ChainIdWithLenKey(types.VscSendTimestampBytePrefix, chainID)) + iterator := sdk.KVStorePrefixIterator(store, types.ChainIDWithLenKey(types.VscSendTimestampBytePrefix, chainID)) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { @@ -985,7 +984,7 @@ func (k Keeper) GetAllVscSendTimestamps(ctx sdk.Context, chainID string) (vscSen // DeleteVscSendTimestampsForConsumer deletes all VSC send timestamps for a given consumer chain func (k Keeper) DeleteVscSendTimestampsForConsumer(ctx sdk.Context, consumerChainID string) { store := ctx.KVStore(k.storeKey) - iterator := sdk.KVStorePrefixIterator(store, types.ChainIdWithLenKey(types.VscSendTimestampBytePrefix, consumerChainID)) + iterator := sdk.KVStorePrefixIterator(store, types.ChainIDWithLenKey(types.VscSendTimestampBytePrefix, consumerChainID)) defer iterator.Close() keysToDel := [][]byte{} @@ -1002,7 +1001,7 @@ func (k Keeper) DeleteVscSendTimestampsForConsumer(ctx sdk.Context, consumerChai // GetFirstVscSendTimestamp gets the vsc send timestamp with the lowest vscID for the given chainID. func (k Keeper) GetFirstVscSendTimestamp(ctx sdk.Context, chainID string) (vscSendTimestamp types.VscSendTimestamp, found bool) { store := ctx.KVStore(k.storeKey) - iterator := sdk.KVStorePrefixIterator(store, types.ChainIdWithLenKey(types.VscSendTimestampBytePrefix, chainID)) + iterator := sdk.KVStorePrefixIterator(store, types.ChainIDWithLenKey(types.VscSendTimestampBytePrefix, chainID)) defer iterator.Close() if iterator.Valid() { diff --git a/x/ccv/provider/keeper/keeper_test.go b/x/ccv/provider/keeper/keeper_test.go index 0dfa301c43..1015863956 100644 --- a/x/ccv/provider/keeper/keeper_test.go +++ b/x/ccv/provider/keeper/keeper_test.go @@ -20,6 +20,8 @@ import ( "github.com/stretchr/testify/require" ) +const consumer = "consumer" + // TestValsetUpdateBlockHeight tests the getter, setter, and deletion methods for valset updates mapped to block height func TestValsetUpdateBlockHeight(t *testing.T) { providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) @@ -92,7 +94,7 @@ func TestSlashAcks(t *testing.T) { providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() - chainID := "consumer" + chainID := consumer acks := providerKeeper.GetSlashAcks(ctx, chainID) require.Nil(t, acks) @@ -149,7 +151,7 @@ func TestPendingVSCs(t *testing.T) { providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() - chainID := "consumer" + chainID := consumer pending := providerKeeper.GetPendingVSCPackets(ctx, chainID) require.Len(t, pending, 0) @@ -261,7 +263,6 @@ func TestGetAllUnbondingOpIndexes(t *testing.T) { } func TestMaturedUnbondingOps(t *testing.T) { - providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() @@ -399,7 +400,7 @@ func TestGetAllConsumerChains(t *testing.T) { expectedGetAllOrder := []types.Chain{} for i, chainID := range chainIDs { clientID := fmt.Sprintf("client-%d", len(chainIDs)-i) - pk.SetConsumerClientId(ctx, chainID, clientID) + pk.SetConsumerClientID(ctx, chainID, clientID) expectedGetAllOrder = append(expectedGetAllOrder, types.Chain{ChainId: chainID, ClientId: clientID}) } // sorting by chainID diff --git a/x/ccv/provider/keeper/key_assignment.go b/x/ccv/provider/keeper/key_assignment.go index 4374713c70..402e77717f 100644 --- a/x/ccv/provider/keeper/key_assignment.go +++ b/x/ccv/provider/keeper/key_assignment.go @@ -67,13 +67,13 @@ func (k Keeper) GetAllValidatorConsumerPubKeys(ctx sdk.Context, chainID *string) prefix = []byte{types.ConsumerValidatorsBytePrefix} } else { // iterate over the validators public keys assigned for chainID - prefix = types.ChainIdWithLenKey(types.ConsumerValidatorsBytePrefix, *chainID) + prefix = types.ChainIDWithLenKey(types.ConsumerValidatorsBytePrefix, *chainID) } iterator := sdk.KVStorePrefixIterator(store, prefix) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { // TODO: store chainID and provider cons address in value bytes, marshaled as protobuf type - chainID, providerAddrTmp, err := types.ParseChainIdAndConsAddrKey(types.ConsumerValidatorsBytePrefix, iterator.Key()) + chainID, providerAddrTmp, err := types.ParseChainIDAndConsAddrKey(types.ConsumerValidatorsBytePrefix, iterator.Key()) if err != nil { // An error here would indicate something is very wrong, // the store key is assumed to be correctly serialized in SetValidatorConsumerPubKey. @@ -160,13 +160,13 @@ func (k Keeper) GetAllValidatorsByConsumerAddr(ctx sdk.Context, chainID *string) prefix = []byte{types.ValidatorsByConsumerAddrBytePrefix} } else { // iterate over the mappings from consensus addresses on chainID - prefix = types.ChainIdWithLenKey(types.ValidatorsByConsumerAddrBytePrefix, *chainID) + prefix = types.ChainIDWithLenKey(types.ValidatorsByConsumerAddrBytePrefix, *chainID) } iterator := sdk.KVStorePrefixIterator(store, prefix) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { // TODO: store chainID and consumer cons address in value bytes, marshaled as protobuf type - chainID, consumerAddrTmp, err := types.ParseChainIdAndConsAddrKey(types.ValidatorsByConsumerAddrBytePrefix, iterator.Key()) + chainID, consumerAddrTmp, err := types.ParseChainIDAndConsAddrKey(types.ValidatorsByConsumerAddrBytePrefix, iterator.Key()) if err != nil { // An error here would indicate something is very wrong, // store keys are assumed to be correctly serialized in SetValidatorByConsumerAddr. @@ -253,12 +253,12 @@ func (k Keeper) SetKeyAssignmentReplacement( // Thus, the iteration is in ascending order of providerAddresses. func (k Keeper) GetAllKeyAssignmentReplacements(ctx sdk.Context, chainID string) (replacements []types.KeyAssignmentReplacement) { store := ctx.KVStore(k.storeKey) - iteratorPrefix := types.ChainIdWithLenKey(types.KeyAssignmentReplacementsBytePrefix, chainID) + iteratorPrefix := types.ChainIDWithLenKey(types.KeyAssignmentReplacementsBytePrefix, chainID) iterator := sdk.KVStorePrefixIterator(store, iteratorPrefix) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { // TODO: store chainID and provider cons address in value bytes, marshaled as protobuf type - _, providerAddrTmp, err := types.ParseChainIdAndConsAddrKey(types.KeyAssignmentReplacementsBytePrefix, iterator.Key()) + _, providerAddrTmp, err := types.ParseChainIDAndConsAddrKey(types.KeyAssignmentReplacementsBytePrefix, iterator.Key()) if err != nil { // An error here would indicate something is very wrong, // store keys are assumed to be correctly serialized in SetKeyAssignmentReplacement. @@ -331,7 +331,8 @@ func (k Keeper) GetConsumerAddrsToPrune( store := ctx.KVStore(k.storeKey) bz := store.Get(types.ConsumerAddrsToPruneKey(chainID, vscID)) if bz == nil { - return + var empty types.ConsumerAddressList + return empty } err := consumerAddrsToPrune.Unmarshal(bz) if err != nil { @@ -339,7 +340,7 @@ func (k Keeper) GetConsumerAddrsToPrune( // the list of consumer addresses is assumed to be correctly serialized in AppendConsumerAddrsToPrune. panic(fmt.Sprintf("failed to unmarshal consumer addresses to prune: %v", err)) } - return + return consumerAddrsToPrune } // GetAllConsumerAddrsToPrune gets all consumer addresses that can be pruned for a given chainID. @@ -349,11 +350,11 @@ func (k Keeper) GetConsumerAddrsToPrune( // Thus, the returned array is in ascending order of vscIDs. func (k Keeper) GetAllConsumerAddrsToPrune(ctx sdk.Context, chainID string) (consumerAddrsToPrune []types.ConsumerAddrsToPrune) { store := ctx.KVStore(k.storeKey) - iteratorPrefix := types.ChainIdWithLenKey(types.ConsumerAddrsToPruneBytePrefix, chainID) + iteratorPrefix := types.ChainIDWithLenKey(types.ConsumerAddrsToPruneBytePrefix, chainID) iterator := sdk.KVStorePrefixIterator(store, iteratorPrefix) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - _, vscID, err := types.ParseChainIdAndUintIdKey(types.ConsumerAddrsToPruneBytePrefix, iterator.Key()) + _, vscID, err := types.ParseChainIDAndUintIDKey(types.ConsumerAddrsToPruneBytePrefix, iterator.Key()) if err != nil { // An error here would indicate something is very wrong, // store keys are assumed to be correctly serialized in AppendConsumerAddrsToPrune. @@ -391,7 +392,6 @@ func (k Keeper) AssignConsumerKey( validator stakingtypes.Validator, consumerKey tmprotocrypto.PublicKey, ) error { - consAddrTmp, err := utils.TMCryptoPublicKeyToConsAddr(consumerKey) if err != nil { return err @@ -426,7 +426,7 @@ func (k Keeper) AssignConsumerKey( // check whether the consumer chain is already registered, // i.e., a client to the consumer was already created - if _, consumerRegistered := k.GetConsumerClientId(ctx, chainID); consumerRegistered { + if _, consumerRegistered := k.GetConsumerClientID(ctx, chainID); consumerRegistered { // get the previous key assigned for this validator on this consumer chain oldConsumerKey, found := k.GetValidatorConsumerPubKey(ctx, chainID, providerAddr) if found { @@ -441,7 +441,7 @@ func (k Keeper) AssignConsumerKey( k.AppendConsumerAddrsToPrune( ctx, chainID, - k.GetValidatorSetUpdateId(ctx), + k.GetValidatorSetUpdateID(ctx), oldConsumerAddr, ) } else { diff --git a/x/ccv/provider/keeper/key_assignment_test.go b/x/ccv/provider/keeper/key_assignment_test.go index 4192166abe..f65f769e94 100644 --- a/x/ccv/provider/keeper/key_assignment_test.go +++ b/x/ccv/provider/keeper/key_assignment_test.go @@ -2,6 +2,7 @@ package keeper_test import ( "bytes" + "math/rand" "sort" "testing" "time" @@ -14,8 +15,6 @@ import ( abci "github.com/tendermint/tendermint/abci/types" tmprotocrypto "github.com/tendermint/tendermint/proto/tendermint/crypto" - "math/rand" - providerkeeper "github.com/cosmos/interchain-security/x/ccv/provider/keeper" "github.com/cosmos/interchain-security/x/ccv/provider/types" "github.com/cosmos/interchain-security/x/ccv/utils" @@ -23,7 +22,7 @@ import ( ) func TestValidatorConsumerPubKeyCRUD(t *testing.T) { - chainID := "consumer" + chainID := consumer providerAddr := types.NewProviderConsAddress([]byte("providerAddr")) consumerKey := cryptotestutil.NewCryptoIdentityFromIntSeed(1).TMProtoCryptoPublicKey() @@ -57,7 +56,7 @@ func TestGetAllValidatorConsumerPubKey(t *testing.T) { providerAddr := cryptotestutil.NewCryptoIdentityFromIntSeed(numAssignments + i).ProviderConsAddress() testAssignments = append(testAssignments, types.ValidatorConsumerPubKey{ - ChainId: chainIDs[rand.Intn(len(chainIDs))], + ChainId: chainIDs[rand.Intn(len(chainIDs))], //nolint:gosec // not used for security purposes ProviderAddr: &providerAddr, ConsumerKey: &consumerKey, }, @@ -100,7 +99,7 @@ func TestGetAllValidatorConsumerPubKey(t *testing.T) { } func TestValidatorByConsumerAddrCRUD(t *testing.T) { - chainID := "consumer" + chainID := consumer providerAddr := types.NewProviderConsAddress([]byte("providerAddr")) consumerAddr := types.NewConsumerConsAddress([]byte("consumerAddr")) @@ -134,7 +133,7 @@ func TestGetAllValidatorsByConsumerAddr(t *testing.T) { providerAddr := cryptotestutil.NewCryptoIdentityFromIntSeed(numAssignments + i).ProviderConsAddress() testAssignments = append(testAssignments, types.ValidatorByConsumerAddr{ - ChainId: chainIDs[rand.Intn(len(chainIDs))], + ChainId: chainIDs[rand.Intn(len(chainIDs))], //nolint:gosec // not used for security purposes ConsumerAddr: &consumerAddr, ProviderAddr: &providerAddr, }, @@ -177,7 +176,7 @@ func TestGetAllValidatorsByConsumerAddr(t *testing.T) { } func TestKeyAssignmentReplacementCRUD(t *testing.T) { - chainID := "consumer" + chainID := consumer providerAddr := types.NewProviderConsAddress([]byte("providerAddr")) expCPubKey := cryptotestutil.NewCryptoIdentityFromIntSeed(1).TMProtoCryptoPublicKey() var expPower int64 = 100 @@ -213,7 +212,7 @@ func TestGetAllKeyAssignmentReplacements(t *testing.T) { types.KeyAssignmentReplacement{ ProviderAddr: &providerAddr, PrevCKey: &consumerKey, - Power: rand.Int63(), + Power: rand.Int63(), //nolint:gosec // not used for security purposes }, ) } @@ -234,7 +233,7 @@ func TestGetAllKeyAssignmentReplacements(t *testing.T) { } func TestConsumerAddrsToPruneCRUD(t *testing.T) { - chainID := "consumer" + chainID := consumer consumerAddr := types.NewConsumerConsAddress([]byte("consumerAddr1")) vscID := uint64(1) @@ -272,8 +271,8 @@ func TestGetAllConsumerAddrsToPrune(t *testing.T) { } testAssignments = append(testAssignments, types.ConsumerAddrsToPrune{ - ChainId: chainIDs[rand.Intn(len(chainIDs))], - VscId: rand.Uint64(), + ChainId: chainIDs[rand.Intn(len(chainIDs))], //nolint:gosec // not used for security purposes + VscId: rand.Uint64(), //nolint:gosec // not used for security purposes ConsumerAddrs: &consumerAddresses, }, ) @@ -356,13 +355,12 @@ func checkCorrectPruningProperty(ctx sdk.Context, k providerkeeper.Keeper, chain } func TestAssignConsensusKeyForConsumerChain(t *testing.T) { - chainID := "chainID" - providerIdentities := []*cryptotestutil.CryptoIdentity{ + providerIdentities := []*cryptotestutil.Identity{ cryptotestutil.NewCryptoIdentityFromIntSeed(0), cryptotestutil.NewCryptoIdentityFromIntSeed(1), } - consumerIdentities := []*cryptotestutil.CryptoIdentity{ + consumerIdentities := []*cryptotestutil.Identity{ cryptotestutil.NewCryptoIdentityFromIntSeed(2), cryptotestutil.NewCryptoIdentityFromIntSeed(3), } @@ -396,7 +394,7 @@ func TestAssignConsensusKeyForConsumerChain(t *testing.T) { ) }, doActions: func(ctx sdk.Context, k providerkeeper.Keeper) { - k.SetConsumerClientId(ctx, chainID, "") + k.SetConsumerClientID(ctx, chainID, "") err := k.AssignConsumerKey(ctx, chainID, providerIdentities[0].SDKStakingValidator(), consumerIdentities[0].TMProtoCryptoPublicKey(), @@ -427,7 +425,7 @@ func TestAssignConsensusKeyForConsumerChain(t *testing.T) { ) }, doActions: func(ctx sdk.Context, k providerkeeper.Keeper) { - k.SetConsumerClientId(ctx, chainID, "") + k.SetConsumerClientID(ctx, chainID, "") err := k.AssignConsumerKey(ctx, chainID, providerIdentities[0].SDKStakingValidator(), consumerIdentities[0].TMProtoCryptoPublicKey(), @@ -460,7 +458,7 @@ func TestAssignConsensusKeyForConsumerChain(t *testing.T) { ) }, doActions: func(ctx sdk.Context, k providerkeeper.Keeper) { - k.SetConsumerClientId(ctx, chainID, "") + k.SetConsumerClientID(ctx, chainID, "") err := k.AssignConsumerKey(ctx, chainID, providerIdentities[0].SDKStakingValidator(), consumerIdentities[0].TMProtoCryptoPublicKey(), @@ -487,7 +485,7 @@ func TestAssignConsensusKeyForConsumerChain(t *testing.T) { ) }, doActions: func(ctx sdk.Context, k providerkeeper.Keeper) { - k.SetConsumerClientId(ctx, chainID, "") + k.SetConsumerClientID(ctx, chainID, "") err := k.AssignConsumerKey(ctx, chainID, providerIdentities[1].SDKStakingValidator(), providerIdentities[0].TMProtoCryptoPublicKey(), @@ -595,7 +593,6 @@ func TestAssignConsensusKeyForConsumerChain(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - k, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) tc.mockSetup(ctx, k, mocks) @@ -609,12 +606,12 @@ func TestAssignConsensusKeyForConsumerChain(t *testing.T) { // Represents the validator set of a chain type ValSet struct { - identities []*cryptotestutil.CryptoIdentity + identities []*cryptotestutil.Identity // indexed by same index as identities power []int64 } -func CreateValSet(identities []*cryptotestutil.CryptoIdentity) ValSet { +func CreateValSet(identities []*cryptotestutil.Identity) ValSet { return ValSet{ identities: identities, power: make([]int64, len(identities)), @@ -633,7 +630,6 @@ func (vs *ValSet) apply(updates []abci.ValidatorUpdate) { vs.power[i] = u.Power } } - } } @@ -647,62 +643,61 @@ type Assignment struct { // of simulated scenarios where random key assignments and validator // set updates are generated. func TestSimulatedAssignmentsAndUpdateApplication(t *testing.T) { - - CHAINID := "chainID" + chainID := "chainID" // The number of full test executions to run - NUM_EXECUTIONS := 100 + numExecutions := 100 // Each test execution mimics the adding of a consumer chain and the // assignments and power updates of several blocks - NUM_BLOCKS_PER_EXECUTION := 40 + blocksPerExecution := 40 // The number of validators to be simulated - NUM_VALIDATORS := 4 + numValidators := 4 // The number of keys that can be used. Keeping this number small is // good because it increases the chance that different assignments will // use the same keys, which is something we want to test. - NUM_ASSIGNABLE_KEYS := 12 + numAssignableKeys := 12 // The maximum number of key assignment actions to simulate in each // simulated block, and before the consumer chain is registered. - NUM_ASSIGNMENTS_PER_BLOCK_MAX := 8 + numAssignmentsPerBlock := 8 // Create some identities for the simulated provider validators to use - providerIDS := []*cryptotestutil.CryptoIdentity{} + providerIDS := []*cryptotestutil.Identity{} // Create some identities which the provider validators can assign to the consumer chain - assignableIDS := []*cryptotestutil.CryptoIdentity{} - for i := 0; i < NUM_VALIDATORS; i++ { + assignableIDS := []*cryptotestutil.Identity{} + for i := 0; i < numValidators; i++ { providerIDS = append(providerIDS, cryptotestutil.NewCryptoIdentityFromIntSeed(i)) } // Notice that the assignable identities include the provider identities - for i := 0; i < NUM_VALIDATORS+NUM_ASSIGNABLE_KEYS; i++ { + for i := 0; i < numValidators+numAssignableKeys; i++ { assignableIDS = append(assignableIDS, cryptotestutil.NewCryptoIdentityFromIntSeed(i)) } // Helper: simulates creation of staking module EndBlock updates. getStakingUpdates := func() (ret []abci.ValidatorUpdate) { // Get a random set of validators to update. It is important to test subsets of all validators. - validators := rand.Perm(len(providerIDS))[0:rand.Intn(len(providerIDS)+1)] + validators := rand.Perm(len(providerIDS))[0:rand.Intn(len(providerIDS)+1)] //nolint:gosec // not used for security purposes for _, i := range validators { // Power 0, 1, or 2 represents // deletion, update (from 0 or 2), update (from 0 or 1) - power := rand.Intn(3) + power := rand.Intn(3) //nolint:gosec // not used for security purposes ret = append(ret, abci.ValidatorUpdate{ PubKey: providerIDS[i].TMProtoCryptoPublicKey(), Power: int64(power), }) } - return + return ret } // Helper: simulates creation of assignment tx's to be done. getAssignments := func() (ret []Assignment) { - for i, numAssignments := 0, rand.Intn(NUM_ASSIGNMENTS_PER_BLOCK_MAX); i < numAssignments; i++ { - randomIxP := rand.Intn(len(providerIDS)) - randomIxC := rand.Intn(len(assignableIDS)) + for i, numAssignments := 0, rand.Intn(numAssignmentsPerBlock); i < numAssignments; i++ { //nolint:gosec // not used for security purposes + randomIxP := rand.Intn(len(providerIDS)) //nolint:gosec // not used for security purposes + randomIxC := rand.Intn(len(assignableIDS)) //nolint:gosec // not used for security purposes ret = append(ret, Assignment{ val: providerIDS[randomIxP].SDKStakingValidator(), ck: assignableIDS[randomIxC].TMProtoCryptoPublicKey(), }) } - return + return ret } // Run a randomly simulated execution and test that desired properties hold @@ -711,7 +706,6 @@ func TestSimulatedAssignmentsAndUpdateApplication(t *testing.T) { // and key assignments tx's. For each simulated 'block', the validator set replication // properties and the pruning property are checked. runRandomExecution := func() { - k, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) // Create validator sets for the provider and consumer. These are used to check the validator set @@ -726,13 +720,13 @@ func TestSimulatedAssignmentsAndUpdateApplication(t *testing.T) { historicSlashQueries := map[string]map[uint64]string{} // Sanity check that the validator set update is initialised to 0, for clarity. - require.Equal(t, k.GetValidatorSetUpdateId(ctx), uint64(0)) + require.Equal(t, k.GetValidatorSetUpdateID(ctx), uint64(0)) // Mock calls to GetLastValidatorPower to return directly from the providerValset mocks.MockStakingKeeper.EXPECT().GetLastValidatorPower( gomock.Any(), gomock.Any(), - ).DoAndReturn(func(_ interface{}, valAddr sdk.ValAddress) int64 { + ).DoAndReturn(func(_ any, valAddr sdk.ValAddress) int64 { // When the mocked method is called, locate the appropriate validator // in the provider valset and return its power. for i, id := range providerIDS { @@ -750,7 +744,7 @@ func TestSimulatedAssignmentsAndUpdateApplication(t *testing.T) { mocks.MockStakingKeeper.EXPECT().GetValidatorByConsAddr( gomock.Any(), gomock.Any(), - ).DoAndReturn(func(_ interface{}, consP sdk.ConsAddress) (stakingtypes.Validator, bool) { + ).DoAndReturn(func(_ any, consP sdk.ConsAddress) (stakingtypes.Validator, bool) { for _, id := range providerIDS { if id.SDKValConsAddress().Equals(consP) { return id.SDKStakingValidator(), true @@ -763,17 +757,17 @@ func TestSimulatedAssignmentsAndUpdateApplication(t *testing.T) { // and increment the provider vscid. applyUpdatesAndIncrementVSCID := func(updates []abci.ValidatorUpdate) { providerValset.apply(updates) - updates = k.MustApplyKeyAssignmentToValUpdates(ctx, CHAINID, updates) + updates = k.MustApplyKeyAssignmentToValUpdates(ctx, chainID, updates) consumerValset.apply(updates) // Simulate the VSCID update in EndBlock - k.IncrementValidatorSetUpdateId(ctx) + k.IncrementValidatorSetUpdateID(ctx) } // Helper: apply some key assignment transactions to the system applyAssignments := func(assignments []Assignment) { for _, a := range assignments { // ignore err return, it can be possible for an error to occur - _ = k.AssignConsumerKey(ctx, CHAINID, a.val, a.ck) + _ = k.AssignConsumerKey(ctx, chainID, a.val, a.ck) } } @@ -785,7 +779,7 @@ func TestSimulatedAssignmentsAndUpdateApplication(t *testing.T) { applyUpdatesAndIncrementVSCID(getStakingUpdates()) // Register the consumer chain - k.SetConsumerClientId(ctx, CHAINID, "") + k.SetConsumerClientID(ctx, chainID, "") // Analogous to the last vscid received from the consumer in a maturity // Used to check the correct pruning property @@ -794,8 +788,7 @@ func TestSimulatedAssignmentsAndUpdateApplication(t *testing.T) { // Simulate a number of 'blocks' // Each block consists of a number of random key assignment tx's // and a random set of validator power updates - for block := 0; block < NUM_BLOCKS_PER_EXECUTION; block++ { - + for block := 0; block < blocksPerExecution; block++ { // Generate and apply assignments and power updates applyAssignments(getAssignments()) applyUpdatesAndIncrementVSCID(getStakingUpdates()) @@ -804,8 +797,8 @@ func TestSimulatedAssignmentsAndUpdateApplication(t *testing.T) { // delivery of maturity packets from the consumer chain. prunedVscid := greatestPrunedVSCID + // +1 and -1 because id was incremented (-1), (+1) to make upper bound inclusive - rand.Intn(int(k.GetValidatorSetUpdateId(ctx))+1-1-greatestPrunedVSCID) - k.PruneKeyAssignments(ctx, CHAINID, uint64(prunedVscid)) + rand.Intn(int(k.GetValidatorSetUpdateID(ctx))+1-1-greatestPrunedVSCID) //nolint:gosec // not used for security + k.PruneKeyAssignments(ctx, chainID, uint64(prunedVscid)) greatestPrunedVSCID = prunedVscid /* @@ -825,7 +818,7 @@ func TestSimulatedAssignmentsAndUpdateApplication(t *testing.T) { // For each active validator on the provider chain if 0 < providerValset.power[i] { // Get the assigned key - ck, found := k.GetValidatorConsumerPubKey(ctx, CHAINID, idP.ProviderConsAddress()) + ck, found := k.GetValidatorConsumerPubKey(ctx, chainID, idP.ProviderConsAddress()) if !found { // Use default if unassigned ck = idP.TMProtoCryptoPublicKey() @@ -847,7 +840,7 @@ func TestSimulatedAssignmentsAndUpdateApplication(t *testing.T) { consC := consumerValset.identities[i].ConsumerConsAddress() if 0 < consumerValset.power[i] { // Get the provider who assigned the key - consP := k.GetProviderAddrFromConsumerAddr(ctx, CHAINID, consC) + consP := k.GetProviderAddrFromConsumerAddr(ctx, chainID, consC) // Find the corresponding provider validator (must always be found) for j, idP := range providerValset.identities { if idP.SDKValConsAddress().Equals(consP.ToSdkConsAddr()) { @@ -863,7 +856,7 @@ func TestSimulatedAssignmentsAndUpdateApplication(t *testing.T) { Check that all keys have been or will eventually be pruned. */ - require.True(t, checkCorrectPruningProperty(ctx, k, CHAINID)) + require.True(t, checkCorrectPruningProperty(ctx, k, chainID)) /* Property: Correct Consumer Initiated Slash Lookup @@ -881,13 +874,13 @@ func TestSimulatedAssignmentsAndUpdateApplication(t *testing.T) { consC := consumerValset.identities[i].ConsumerConsAddress() if 0 < consumerValset.power[i] { // Get the provider who assigned the key - consP := k.GetProviderAddrFromConsumerAddr(ctx, CHAINID, consC) + consP := k.GetProviderAddrFromConsumerAddr(ctx, chainID, consC) if _, found := historicSlashQueries[consC.String()]; !found { historicSlashQueries[consC.String()] = map[uint64]string{} } - vscid := k.GetValidatorSetUpdateId(ctx) - 1 // -1 since it was incremented before + vscid := k.GetValidatorSetUpdateID(ctx) - 1 // -1 since it was incremented before // Record the slash query result obtained at this block historicSlashQueries[consC.String()][vscid] = consP.String() } @@ -907,12 +900,12 @@ func TestSimulatedAssignmentsAndUpdateApplication(t *testing.T) { // No conflicts. require.True(t, len(seen) < 2) } - } ctrl.Finish() } - for i := 0; i < NUM_EXECUTIONS; i++ { + // Run the random execution a number of times + for i := 0; i < numExecutions; i++ { runRandomExecution() } } diff --git a/x/ccv/provider/keeper/params_test.go b/x/ccv/provider/keeper/params_test.go index d67c85d586..f0c749bcf6 100644 --- a/x/ccv/provider/keeper/params_test.go +++ b/x/ccv/provider/keeper/params_test.go @@ -14,7 +14,6 @@ import ( // TestParams tests the getting/setting of provider ccv module params. func TestParams(t *testing.T) { - // Construct an in-mem keeper with registered key table keeperParams := testkeeper.NewInMemKeeperParams(t) providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, keeperParams) diff --git a/x/ccv/provider/keeper/proposal.go b/x/ccv/provider/keeper/proposal.go index 16829710d6..23b94d9ef4 100644 --- a/x/ccv/provider/keeper/proposal.go +++ b/x/ccv/provider/keeper/proposal.go @@ -28,7 +28,6 @@ import ( // See: https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/methods.md#ccv-pcf-hcaprop1 // Spec tag: [CCV-PCF-HCAPROP.1] func (k Keeper) HandleConsumerAdditionProposal(ctx sdk.Context, p *types.ConsumerAdditionProposal) error { - // verify the consumer addition proposal execution // in cached context and discard the cached writes if _, _, err := k.CreateConsumerClientInCachedCtx(ctx, *p); err != nil { @@ -52,10 +51,9 @@ func (k Keeper) HandleConsumerAdditionProposal(ctx sdk.Context, p *types.Consume // See: https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/methods.md#ccv-pcf-crclient1 // Spec tag: [CCV-PCF-CRCLIENT.1] func (k Keeper) CreateConsumerClient(ctx sdk.Context, prop *types.ConsumerAdditionProposal) error { - chainID := prop.ChainId // check that a client for this chain does not exist - if _, found := k.GetConsumerClientId(ctx, chainID); found { + if _, found := k.GetConsumerClientID(ctx, chainID); found { return sdkerrors.Wrap(ccv.ErrDuplicateConsumerChain, fmt.Sprintf("cannot create client for existent consumer chain: %s", chainID)) } @@ -95,7 +93,7 @@ func (k Keeper) CreateConsumerClient(ctx sdk.Context, prop *types.ConsumerAdditi if err != nil { return err } - k.SetConsumerClientId(ctx, chainID, clientID) + k.SetConsumerClientID(ctx, chainID, clientID) // add the init timeout timestamp for this consumer chain ts := ctx.BlockTime().Add(k.GetParams(ctx).InitTimeoutPeriod) @@ -154,13 +152,13 @@ func (k Keeper) HandleConsumerRemovalProposal(ctx sdk.Context, p *types.Consumer // Spec tag: [CCV-PCF-STCC.1] func (k Keeper) StopConsumerChain(ctx sdk.Context, chainID string, closeChan bool) (err error) { // check that a client for chainID exists - if _, found := k.GetConsumerClientId(ctx, chainID); !found { + if _, found := k.GetConsumerClientID(ctx, chainID); !found { return sdkerrors.Wrap(ccv.ErrConsumerChainNotFound, fmt.Sprintf("cannot stop non-existent consumer chain: %s", chainID)) } // clean up states - k.DeleteConsumerClientId(ctx, chainID) + k.DeleteConsumerClientID(ctx, chainID) k.DeleteConsumerGenesis(ctx, chainID) k.DeleteInitTimeoutTimestamp(ctx, chainID) // Note: this call panics if the key assignment state is invalid @@ -343,7 +341,8 @@ func (k Keeper) SetPendingConsumerAdditionProp(ctx sdk.Context, prop *types.Cons // // Note: this method is only used in testing func (k Keeper) GetPendingConsumerAdditionProp(ctx sdk.Context, spawnTime time.Time, - chainID string) (prop types.ConsumerAdditionProposal, found bool) { + chainID string, +) (prop types.ConsumerAdditionProposal, found bool) { store := ctx.KVStore(k.storeKey) bz := store.Get(types.PendingCAPKey(spawnTime, chainID)) if bz == nil { @@ -532,7 +531,6 @@ func (k Keeper) BeginBlockCCR(ctx sdk.Context) { // // Note: this method is split out from BeginBlockCCR to be easily unit tested. func (k Keeper) GetConsumerRemovalPropsToExecute(ctx sdk.Context) []types.ConsumerRemovalProposal { - // store the (to be) executed consumer removal proposals in order propsToExecute := []types.ConsumerRemovalProposal{} @@ -591,7 +589,7 @@ func (k Keeper) GetAllPendingConsumerRemovalProps(ctx sdk.Context) (props []type func (k Keeper) CreateConsumerClientInCachedCtx(ctx sdk.Context, p types.ConsumerAdditionProposal) (cc sdk.Context, writeCache func(), err error) { cc, writeCache = ctx.CacheContext() err = k.CreateConsumerClient(cc, &p) - return + return cc, writeCache, err } // StopConsumerChainInCachedCtx stop a consumer chain @@ -599,7 +597,7 @@ func (k Keeper) CreateConsumerClientInCachedCtx(ctx sdk.Context, p types.Consume func (k Keeper) StopConsumerChainInCachedCtx(ctx sdk.Context, p types.ConsumerRemovalProposal) (cc sdk.Context, writeCache func(), err error) { cc, writeCache = ctx.CacheContext() err = k.StopConsumerChain(cc, p.ChainId, true) - return + return cc, writeCache, err } // HandleEquivocationProposal handles an equivocation proposal. diff --git a/x/ccv/provider/keeper/proposal_test.go b/x/ccv/provider/keeper/proposal_test.go index ed8f821bef..8c426d4dcb 100644 --- a/x/ccv/provider/keeper/proposal_test.go +++ b/x/ccv/provider/keeper/proposal_test.go @@ -33,7 +33,6 @@ import ( // See: https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/methods.md#ccv-pcf-hcaprop1 // Spec tag: [CCV-PCF-HCAPROP.1] func TestHandleConsumerAdditionProposal(t *testing.T) { - type testCase struct { description string malleate func(ctx sdk.Context, k providerkeeper.Keeper, chainID string) @@ -73,7 +72,7 @@ func TestHandleConsumerAdditionProposal(t *testing.T) { { description: "expect to not append invalid proposal using an already existing chain id", malleate: func(ctx sdk.Context, k providerkeeper.Keeper, chainID string) { - k.SetConsumerClientId(ctx, chainID, "anyClientId") + k.SetConsumerClientID(ctx, chainID, "anyClientId") }, prop: providertypes.NewConsumerAdditionProposal( @@ -136,7 +135,6 @@ func TestHandleConsumerAdditionProposal(t *testing.T) { // See: https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/methods.md#ccv-pcf-crclient1 // Spec tag: [CCV-PCF-CRCLIENT.1] func TestCreateConsumerClient(t *testing.T) { - type testCase struct { description string // Any state-mutating setup on keeper and expected mock calls, specific to this test case @@ -148,7 +146,6 @@ func TestCreateConsumerClient(t *testing.T) { { description: "No state mutation, new client should be created", setup: func(providerKeeper *providerkeeper.Keeper, ctx sdk.Context, mocks *testkeeper.MockedKeepers) { - // Valid client creation is asserted with mock expectations here gomock.InOrder( testkeeper.GetMocksForCreateConsumerClient(ctx, mocks, "chainID", clienttypes.NewHeight(4, 5))..., @@ -159,15 +156,13 @@ func TestCreateConsumerClient(t *testing.T) { { description: "client for this chain already exists, new one is not created", setup: func(providerKeeper *providerkeeper.Keeper, ctx sdk.Context, mocks *testkeeper.MockedKeepers) { - - providerKeeper.SetConsumerClientId(ctx, "chainID", "clientID") + providerKeeper.SetConsumerClientID(ctx, "chainID", "clientID") // Expect none of the client creation related calls to happen mocks.MockStakingKeeper.EXPECT().UnbondingTime(gomock.Any()).Times(0) mocks.MockClientKeeper.EXPECT().CreateClient(gomock.Any(), gomock.Any(), gomock.Any()).Times(0) mocks.MockClientKeeper.EXPECT().GetSelfConsensusState(gomock.Any(), gomock.Any()).Times(0) mocks.MockStakingKeeper.EXPECT().IterateLastValidatorPowers(gomock.Any(), gomock.Any()).Times(0) - }, expClientCreated: false, }, @@ -201,12 +196,12 @@ func TestCreateConsumerClient(t *testing.T) { // // Note: Separated from TestCreateConsumerClient to also be called from TestCreateConsumerChainProposal. func testCreatedConsumerClient(t *testing.T, - ctx sdk.Context, providerKeeper providerkeeper.Keeper, expectedChainID string, expectedClientID string) { - + ctx sdk.Context, providerKeeper providerkeeper.Keeper, expectedChainID, expectedClientID string, +) { // ClientID should be stored. - clientId, found := providerKeeper.GetConsumerClientId(ctx, expectedChainID) + clientID, found := providerKeeper.GetConsumerClientID(ctx, expectedChainID) require.True(t, found, "consumer client not found") - require.Equal(t, expectedClientID, clientId) + require.Equal(t, expectedClientID, clientID) // Only assert that consumer genesis was set, // more granular tests on consumer genesis should be defined in TestMakeConsumerGenesis @@ -217,7 +212,6 @@ func testCreatedConsumerClient(t *testing.T, // TestPendingConsumerAdditionPropDeletion tests the getting/setting // and deletion keeper methods for pending consumer addition props func TestPendingConsumerAdditionPropDeletion(t *testing.T) { - testCases := []struct { providertypes.ConsumerAdditionProposal ExpDeleted bool @@ -253,14 +247,13 @@ func TestPendingConsumerAdditionPropDeletion(t *testing.T) { } require.Empty(t, res, "consumer addition proposal was not deleted %s %s", tc.ChainId, tc.SpawnTime.String()) require.Equal(t, propsToExecute[numDeleted].ChainId, tc.ChainId) - numDeleted += 1 + numDeleted++ } } // TestGetConsumerAdditionPropsToExecute tests that pending consumer addition proposals // that are ready to execute are accessed in order by timestamp via the iterator func TestGetConsumerAdditionPropsToExecute(t *testing.T) { - now := time.Now().UTC() sampleProp1 := providertypes.ConsumerAdditionProposal{ChainId: "chain-2", SpawnTime: now} sampleProp2 := providertypes.ConsumerAdditionProposal{ChainId: "chain-1", SpawnTime: now.Add(time.Hour)} @@ -380,7 +373,6 @@ func TestGetAllConsumerAdditionProps(t *testing.T) { // See: https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/methods.md#ccv-pcf-hcrprop1 // Spec tag: [CCV-PCF-HCRPROP.1] func TestHandleConsumerRemovalProposal(t *testing.T) { - type testCase struct { description string setupMocks func(ctx sdk.Context, k providerkeeper.Keeper, chainID string) @@ -395,7 +387,7 @@ func TestHandleConsumerRemovalProposal(t *testing.T) { // chainID of the consumer chain // tests need to check that the CCV channel is not closed prematurely - chainId string + chainID string } // Snapshot times asserted in tests @@ -407,7 +399,7 @@ func TestHandleConsumerRemovalProposal(t *testing.T) { { description: "valid proposal", setupMocks: func(ctx sdk.Context, k providerkeeper.Keeper, chainID string) { - k.SetConsumerClientId(ctx, chainID, "ClientID") + k.SetConsumerClientID(ctx, chainID, "ClientID") }, prop: providertypes.NewConsumerRemovalProposal( "title", @@ -417,12 +409,12 @@ func TestHandleConsumerRemovalProposal(t *testing.T) { ).(*providertypes.ConsumerRemovalProposal), blockTime: hourAfterNow, // After stop time. expAppendProp: true, - chainId: "chainID", + chainID: "chainID", }, { description: "valid proposal - stop_time in the past", setupMocks: func(ctx sdk.Context, k providerkeeper.Keeper, chainID string) { - k.SetConsumerClientId(ctx, chainID, "ClientID") + k.SetConsumerClientID(ctx, chainID, "ClientID") }, prop: providertypes.NewConsumerRemovalProposal( "title", @@ -432,12 +424,12 @@ func TestHandleConsumerRemovalProposal(t *testing.T) { ).(*providertypes.ConsumerRemovalProposal), blockTime: hourAfterNow, // After stop time. expAppendProp: true, - chainId: "chainID", + chainID: "chainID", }, { description: "valid proposal - before stop_time in the future", setupMocks: func(ctx sdk.Context, k providerkeeper.Keeper, chainID string) { - k.SetConsumerClientId(ctx, chainID, "ClientID") + k.SetConsumerClientID(ctx, chainID, "ClientID") }, prop: providertypes.NewConsumerRemovalProposal( "title", @@ -447,7 +439,7 @@ func TestHandleConsumerRemovalProposal(t *testing.T) { ).(*providertypes.ConsumerRemovalProposal), blockTime: now, expAppendProp: true, - chainId: "chainID", + chainID: "chainID", }, { description: "rejected valid proposal - consumer chain does not exist", @@ -460,12 +452,12 @@ func TestHandleConsumerRemovalProposal(t *testing.T) { ).(*providertypes.ConsumerRemovalProposal), blockTime: hourAfterNow, // After stop time. expAppendProp: false, - chainId: "chainID-2", + chainID: "chainID-2", }, } + // Run test cases for _, tc := range tests { - // Common setup keeperParams := testkeeper.NewInMemKeeperParams(t) providerKeeper, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx(t, keeperParams) @@ -483,6 +475,7 @@ func TestHandleConsumerRemovalProposal(t *testing.T) { err := providerKeeper.HandleConsumerRemovalProposal(ctx, tc.prop) + // Assert expected result if tc.expAppendProp { require.NoError(t, err) @@ -491,7 +484,7 @@ func TestHandleConsumerRemovalProposal(t *testing.T) { require.True(t, found) // confirm that the channel was not closed - _, found = providerKeeper.GetChainToChannel(ctx, tc.chainId) + _, found = providerKeeper.GetChainToChannel(ctx, tc.chainID) require.True(t, found) } else { require.Error(t, err) @@ -500,7 +493,6 @@ func TestHandleConsumerRemovalProposal(t *testing.T) { found := providerKeeper.PendingConsumerRemovalPropExists(ctx, tc.prop.ChainId, tc.prop.StopTime) require.False(t, found) } - // Assert mock calls from setup function ctrl.Finish() } @@ -530,7 +522,6 @@ func TestStopConsumerChain(t *testing.T) { { description: "valid stop of consumer chain, throttle related queues are cleaned", setup: func(ctx sdk.Context, providerKeeper *providerkeeper.Keeper, mocks testkeeper.MockedKeepers) { - testkeeper.SetupForStoppingConsumerChain(t, ctx, providerKeeper, mocks) providerKeeper.QueueGlobalSlashEntry(ctx, providertypes.NewGlobalSlashEntry( @@ -556,8 +547,8 @@ func TestStopConsumerChain(t *testing.T) { }, } + // Run test cases for _, tc := range tests { - // Common setup keeperParams := testkeeper.NewInMemKeeperParams(t) providerKeeper, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx(t, keeperParams) @@ -582,9 +573,9 @@ func TestStopConsumerChain(t *testing.T) { // testProviderStateIsCleaned executes test assertions for the proposer's state being cleaned after a stopped consumer chain. func testProviderStateIsCleaned(t *testing.T, ctx sdk.Context, providerKeeper providerkeeper.Keeper, - expectedChainID string, expectedChannelID string) { - - _, found := providerKeeper.GetConsumerClientId(ctx, expectedChainID) + expectedChainID, expectedChannelID string, +) { + _, found := providerKeeper.GetConsumerClientID(ctx, expectedChainID) require.False(t, found) _, found = providerKeeper.GetChainToChannel(ctx, expectedChainID) require.False(t, found) @@ -618,7 +609,6 @@ func testProviderStateIsCleaned(t *testing.T, ctx sdk.Context, providerKeeper pr // TestPendingConsumerRemovalPropDeletion tests the getting/setting // and deletion methods for pending consumer removal props func TestPendingConsumerRemovalPropDeletion(t *testing.T) { - testCases := []struct { providertypes.ConsumerRemovalProposal ExpDeleted bool @@ -653,7 +643,7 @@ func TestPendingConsumerRemovalPropDeletion(t *testing.T) { } require.Empty(t, res, "consumer removal prop was not deleted %s %s", tc.ChainId, tc.StopTime.String()) require.Equal(t, propsToExecute[numDeleted].ChainId, tc.ChainId) - numDeleted += 1 + numDeleted++ } } @@ -771,7 +761,6 @@ func TestGetAllConsumerRemovalProps(t *testing.T) { // An expected genesis state is hardcoded in json, unmarshaled, and compared // against an actual consumer genesis state constructed by a provider keeper. func TestMakeConsumerGenesis(t *testing.T) { - keeperParams := testkeeper.NewInMemKeeperParams(t) providerKeeper, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx(t, keeperParams) moduleParams := providertypes.Params{ @@ -874,7 +863,6 @@ func TestMakeConsumerGenesis(t *testing.T) { // See: https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/methods.md#ccv-pcf-bblock-init1 // Spec tag:[CCV-PCF-BBLOCK-INIT.1] func TestBeginBlockInit(t *testing.T) { - now := time.Now().UTC() keeperParams := testkeeper.NewInMemKeeperParams(t) @@ -993,8 +981,8 @@ func TestBeginBlockCCR(t *testing.T) { expectations = append(expectations, testkeeper.GetMocksForSetConsumerChain(ctx, &mocks, prop.ChainId)...) } // Only first two consumer chains should be stopped - expectations = append(expectations, testkeeper.GetMocksForStopConsumerChain(ctx, &mocks)...) - expectations = append(expectations, testkeeper.GetMocksForStopConsumerChain(ctx, &mocks)...) + expectations = append(expectations, testkeeper.GetMocksForStopConsumerChain(&mocks)...) + expectations = append(expectations, testkeeper.GetMocksForStopConsumerChain(&mocks)...) gomock.InOrder(expectations...) @@ -1042,7 +1030,6 @@ func TestBeginBlockCCR(t *testing.T) { } func TestHandleEquivocationProposal(t *testing.T) { - equivocations := []*evidencetypes.Equivocation{ { Time: time.Now(), @@ -1071,8 +1058,8 @@ func TestHandleEquivocationProposal(t *testing.T) { {name: "slash logs not set", setSlashLogs: false, expectEquivsHandled: false, expectErr: true}, {name: "slash logs set", setSlashLogs: true, expectEquivsHandled: true, expectErr: false}, } + // Run test cases for _, tc := range testCases { - keeperParams := testkeeper.NewInMemKeeperParams(t) keeper, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx(t, keeperParams) diff --git a/x/ccv/provider/keeper/relay.go b/x/ccv/provider/keeper/relay.go index 8a68967157..1cd82e4b65 100644 --- a/x/ccv/provider/keeper/relay.go +++ b/x/ccv/provider/keeper/relay.go @@ -21,7 +21,6 @@ func (k Keeper) OnRecvVSCMaturedPacket( packet channeltypes.Packet, data ccv.VSCMaturedPacketData, ) exported.Acknowledgement { - // check that the channel is established, panic if not chainID, found := k.GetChannelToChain(ctx, packet.DestinationChannel) if !found { @@ -56,7 +55,6 @@ func (k Keeper) OnRecvVSCMaturedPacket( // trail slash packet data for that consumer, it will be handled in this method, // bypassing HandleThrottleQueues. func (k Keeper) HandleLeadingVSCMaturedPackets(ctx sdk.Context) { - for _, chain := range k.GetAllConsumerChains(ctx) { leadingVscMatured, ibcSeqNums := k.GetLeadingVSCMaturedData(ctx, chain.ChainId) for _, data := range leadingVscMatured { @@ -128,7 +126,7 @@ func (k Keeper) OnAcknowledgementPacket(ctx sdk.Context, packet channeltypes.Pac // stop consumer chain and release unbonding return k.StopConsumerChain(ctx, chainID, false) } - return sdkerrors.Wrapf(providertypes.ErrUnknownConsumerChannelId, "recv ErrorAcknowledgement on unknown channel %s", packet.SourceChannel) + return sdkerrors.Wrapf(providertypes.ErrUnknownConsumerChannelID, "recv ErrorAcknowledgement on unknown channel %s", packet.SourceChannel) } return nil } @@ -192,7 +190,6 @@ func (k Keeper) SendVSCPacketsToChain(ctx sdk.Context, chainID, channelID string data.GetBytes(), k.GetCCVTimeoutPeriod(ctx), ) - if err != nil { if clienttypes.ErrClientNotActive.Is(err) { // IBC client is expired! @@ -215,7 +212,7 @@ func (k Keeper) SendVSCPacketsToChain(ctx sdk.Context, chainID, channelID string // QueueVSCPackets queues latest validator updates for every registered consumer chain func (k Keeper) QueueVSCPackets(ctx sdk.Context) { - valUpdateID := k.GetValidatorSetUpdateId(ctx) // curent valset update ID + valUpdateID := k.GetValidatorSetUpdateID(ctx) // current valset update ID // Get the validator updates from the staking module. // Note: GetValidatorUpdates panics if the updates provided by the x/staking module // of cosmos-sdk is invalid. @@ -242,7 +239,7 @@ func (k Keeper) QueueVSCPackets(ctx sdk.Context) { } } - k.IncrementValidatorSetUpdateId(ctx) + k.IncrementValidatorSetUpdateID(ctx) } // EndBlockCIS contains the EndBlock logic needed for @@ -250,7 +247,7 @@ func (k Keeper) QueueVSCPackets(ctx sdk.Context) { func (k Keeper) EndBlockCIS(ctx sdk.Context) { // set the ValsetUpdateBlockHeight blockHeight := uint64(ctx.BlockHeight()) + 1 - valUpdateID := k.GetValidatorSetUpdateId(ctx) + valUpdateID := k.GetValidatorSetUpdateID(ctx) k.SetValsetUpdateBlockHeight(ctx, valUpdateID, blockHeight) k.Logger(ctx).Debug("vscID was mapped to block height", "vscID", valUpdateID, "height", blockHeight) @@ -287,7 +284,6 @@ func (k Keeper) EndBlockCIS(ctx sdk.Context) { // OnRecvSlashPacket delivers a received slash packet, validates it and // then queues the slash packet as pending if valid. func (k Keeper) OnRecvSlashPacket(ctx sdk.Context, packet channeltypes.Packet, data ccv.SlashPacketData) exported.Acknowledgement { - // check that the channel is established, panic if not chainID, found := k.GetChannelToChain(ctx, packet.DestinationChannel) if !found { @@ -361,8 +357,8 @@ func (k Keeper) OnRecvSlashPacket(ctx sdk.Context, packet channeltypes.Packet, d // handled or persisted in store. An error is returned if the packet is invalid, // and an error ack should be relayed to the sender. func (k Keeper) ValidateSlashPacket(ctx sdk.Context, chainID string, - packet channeltypes.Packet, data ccv.SlashPacketData) error { - + _ channeltypes.Packet, data ccv.SlashPacketData, +) error { _, found := k.getMappedInfractionHeight(ctx, chainID, data.ValsetUpdateId) // return error if we cannot find infraction height matching the validator update id if !found { @@ -380,7 +376,6 @@ func (k Keeper) ValidateSlashPacket(ctx sdk.Context, chainID string, // HandleSlashPacket potentially jails a misbehaving validator for a downtime infraction. // This method should NEVER be called with a double-sign infraction. func (k Keeper) HandleSlashPacket(ctx sdk.Context, chainID string, data ccv.SlashPacketData) { - consumerConsAddr := providertypes.NewConsumerConsAddress(data.Validator.Address) // Obtain provider chain consensus address using the consumer chain consensus address providerConsAddr := k.GetProviderAddrFromConsumerAddr(ctx, chainID, consumerConsAddr) @@ -507,11 +502,10 @@ func (k Keeper) EndBlockCCR(ctx sdk.Context) { // getMappedInfractionHeight gets the infraction height mapped from val set ID for the given chain ID func (k Keeper) getMappedInfractionHeight(ctx sdk.Context, - chainID string, valsetUpdateID uint64) (height uint64, found bool) { - + chainID string, valsetUpdateID uint64, +) (height uint64, found bool) { if valsetUpdateID == 0 { return k.GetInitChainHeight(ctx, chainID) - } else { - return k.GetValsetUpdateBlockHeight(ctx, valsetUpdateID) } + return k.GetValsetUpdateBlockHeight(ctx, valsetUpdateID) } diff --git a/x/ccv/provider/keeper/relay_test.go b/x/ccv/provider/keeper/relay_test.go index 229975ca19..c862c40fb2 100644 --- a/x/ccv/provider/keeper/relay_test.go +++ b/x/ccv/provider/keeper/relay_test.go @@ -11,14 +11,12 @@ import ( channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" exported "github.com/cosmos/ibc-go/v4/modules/core/exported" ibcsimapp "github.com/cosmos/interchain-security/legacy_ibc_testing/simapp" - "github.com/cosmos/interchain-security/testutil/crypto" cryptotestutil "github.com/cosmos/interchain-security/testutil/crypto" testkeeper "github.com/cosmos/interchain-security/testutil/keeper" "github.com/cosmos/interchain-security/x/ccv/provider/keeper" providertypes "github.com/cosmos/interchain-security/x/ccv/provider/types" ccv "github.com/cosmos/interchain-security/x/ccv/types" "github.com/golang/mock/gomock" - abci "github.com/tendermint/tendermint/abci/types" tmtypes "github.com/tendermint/tendermint/abci/types" "github.com/stretchr/testify/require" @@ -32,27 +30,26 @@ func TestQueueVSCPackets(t *testing.T) { testCases := []struct { name string packets []ccv.ValidatorSetChangePacketData - expectNextValsetUpdateId uint64 + expectNextValsetUpdateID uint64 expectedQueueSize int }{ { - name: "no updates to send", packets: []ccv.ValidatorSetChangePacketData{}, - expectNextValsetUpdateId: 1, + expectNextValsetUpdateID: 1, expectedQueueSize: 0, }, { name: "have updates to send", packets: []ccv.ValidatorSetChangePacketData{ { - ValidatorUpdates: []abci.ValidatorUpdate{ + ValidatorUpdates: []tmtypes.ValidatorUpdate{ {PubKey: tmPubKey, Power: 1}, }, ValsetUpdateId: 1, }, }, - expectNextValsetUpdateId: 1, + expectNextValsetUpdateID: 1, expectedQueueSize: 1, }, } @@ -68,7 +65,7 @@ func TestQueueVSCPackets(t *testing.T) { mocks := testkeeper.NewMockedKeepers(ctrl) mockStakingKeeper := mocks.MockStakingKeeper - mockUpdates := []abci.ValidatorUpdate{} + mockUpdates := []tmtypes.ValidatorUpdate{} if len(tc.packets) != 0 { mockUpdates = tc.packets[0].ValidatorUpdates } @@ -87,8 +84,8 @@ func TestQueueVSCPackets(t *testing.T) { // next valset update ID -> default value in tests is 0 // each call to QueueValidatorUpdates will increment the ValidatorUpdateID - valUpdateID := pk.GetValidatorSetUpdateId(ctx) - require.Equal(t, tc.expectNextValsetUpdateId, valUpdateID, "valUpdateID (%v != %v) mismatch in case: '%s'", tc.expectNextValsetUpdateId, valUpdateID, tc.name) + valUpdateID := pk.GetValidatorSetUpdateID(ctx) + require.Equal(t, tc.expectNextValsetUpdateID, valUpdateID, "valUpdateID (%v != %v) mismatch in case: '%s'", tc.expectNextValsetUpdateID, valUpdateID, tc.name) } } @@ -98,7 +95,6 @@ func TestQueueVSCPackets(t *testing.T) { // // Note: Handling logic itself is not testing in here, just queueing behavior. func TestOnRecvVSCMaturedPacket(t *testing.T) { - providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() providerKeeper.SetParams(ctx, providertypes.DefaultParams()) @@ -142,7 +138,6 @@ func TestOnRecvVSCMaturedPacket(t *testing.T) { } func TestHandleLeadingVSCMaturedPackets(t *testing.T) { - providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() providerKeeper.SetParams(ctx, providertypes.DefaultParams()) @@ -152,9 +147,9 @@ func TestHandleLeadingVSCMaturedPackets(t *testing.T) { // Set channel to chain, and chain to client mappings // (faking multiple established consumer channels) providerKeeper.SetChannelToChain(ctx, "channel-1", "chain-1") - providerKeeper.SetConsumerClientId(ctx, "chain-1", "client-1") + providerKeeper.SetConsumerClientID(ctx, "chain-1", "client-1") providerKeeper.SetChannelToChain(ctx, "channel-2", "chain-2") - providerKeeper.SetConsumerClientId(ctx, "chain-2", "client-2") + providerKeeper.SetConsumerClientID(ctx, "chain-2", "client-2") // Queue some leading vsc matured packet data for chain-1 err := providerKeeper.QueueThrottledVSCMaturedPacketData(ctx, "chain-1", 1, vscData[0]) @@ -268,7 +263,6 @@ func TestOnRecvDoubleSignSlashPacket(t *testing.T) { // TestOnRecvSlashPacket tests the OnRecvSlashPacket method specifically for downtime slash packets, // and how the method interacts with the parent and per-chain slash packet queues. func TestOnRecvDowntimeSlashPacket(t *testing.T) { - providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() providerKeeper.SetParams(ctx, providertypes.DefaultParams()) @@ -317,8 +311,8 @@ func TestOnRecvDowntimeSlashPacket(t *testing.T) { } func executeOnRecvVSCMaturedPacket(t *testing.T, providerKeeper *keeper.Keeper, ctx sdk.Context, - channelID string, ibcSeqNum uint64) exported.Acknowledgement { - + channelID string, ibcSeqNum uint64, +) exported.Acknowledgement { // Instantiate vsc matured packet data and bytes data := testkeeper.GetNewVSCMaturedPacketData() dataBz, err := data.Marshal() @@ -332,8 +326,8 @@ func executeOnRecvVSCMaturedPacket(t *testing.T, providerKeeper *keeper.Keeper, } func executeOnRecvSlashPacket(t *testing.T, providerKeeper *keeper.Keeper, ctx sdk.Context, - channelID string, ibcSeqNum uint64, packetData ccv.SlashPacketData) exported.Acknowledgement { - + channelID string, ibcSeqNum uint64, packetData ccv.SlashPacketData, +) exported.Acknowledgement { // Instantiate slash packet data and bytes dataBz, err := packetData.Marshal() require.NoError(t, err) @@ -347,7 +341,6 @@ func executeOnRecvSlashPacket(t *testing.T, providerKeeper *keeper.Keeper, ctx s // TestValidateSlashPacket tests ValidateSlashPacket. func TestValidateSlashPacket(t *testing.T) { - validVscID := uint64(98) testCases := []struct { @@ -355,27 +348,41 @@ func TestValidateSlashPacket(t *testing.T) { packetData ccv.SlashPacketData expectErr bool }{ - {"no block height found for given vscID", + { + "no block height found for given vscID", ccv.SlashPacketData{ValsetUpdateId: 61}, - true}, - {"non-set infraction type", + true, + }, + { + "non-set infraction type", ccv.SlashPacketData{ValsetUpdateId: validVscID}, - true}, - {"invalid infraction type", + true, + }, + { + "invalid infraction type", ccv.SlashPacketData{ValsetUpdateId: validVscID, Infraction: stakingtypes.MaxMonikerLength}, - true}, - {"valid double sign packet with non-zero vscID", + true, + }, + { + "valid double sign packet with non-zero vscID", ccv.SlashPacketData{ValsetUpdateId: validVscID, Infraction: stakingtypes.DoubleSign}, - false}, - {"valid downtime packet with non-zero vscID", + false, + }, + { + "valid downtime packet with non-zero vscID", ccv.SlashPacketData{ValsetUpdateId: validVscID, Infraction: stakingtypes.Downtime}, - false}, - {"valid double sign packet with zero vscID", + false, + }, + { + "valid double sign packet with zero vscID", ccv.SlashPacketData{ValsetUpdateId: 0, Infraction: stakingtypes.DoubleSign}, - false}, - {"valid downtime packet with zero vscID", + false, + }, + { + "valid downtime packet with zero vscID", ccv.SlashPacketData{ValsetUpdateId: 0, Infraction: stakingtypes.Downtime}, - false}, + false, + }, } for _, tc := range testCases { @@ -407,11 +414,10 @@ func TestValidateSlashPacket(t *testing.T) { // TestHandleSlashPacket tests the handling of slash packets. // Note that only downtime slash packets are processed by HandleSlashPacket. func TestHandleSlashPacket(t *testing.T) { - - chainId := "consumer-id" + chainID := "consumer-id" validVscID := uint64(234) - providerConsAddr := crypto.NewCryptoIdentityFromIntSeed(7842334).ProviderConsAddress() - consumerConsAddr := crypto.NewCryptoIdentityFromIntSeed(784987634).ConsumerConsAddress() + providerConsAddr := cryptotestutil.NewCryptoIdentityFromIntSeed(7842334).ProviderConsAddress() + consumerConsAddr := cryptotestutil.NewCryptoIdentityFromIntSeed(784987634).ConsumerConsAddress() testCases := []struct { name string @@ -475,7 +481,6 @@ func TestHandleSlashPacket(t *testing.T) { expectedPacketData ccv.SlashPacketData, ) []*gomock.Call { return []*gomock.Call{ - mocks.MockStakingKeeper.EXPECT().GetValidatorByConsAddr( ctx, providerConsAddr.ToSdkConsAddr()).Return( stakingtypes.Validator{}, true, @@ -524,8 +529,8 @@ func TestHandleSlashPacket(t *testing.T) { // Note: double-sign slash packet handling should not occur, see OnRecvSlashPacket. } + // Run test cases: each test case is a different packet data. for _, tc := range testCases { - providerKeeper, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx( t, testkeeper.NewInMemKeeperParams(t)) @@ -533,22 +538,22 @@ func TestHandleSlashPacket(t *testing.T) { gomock.InOrder(tc.expectedCalls(ctx, mocks, tc.packetData)...) // Setup init chain height and a single valid valset update ID to block height mapping. - providerKeeper.SetInitChainHeight(ctx, chainId, 5) + providerKeeper.SetInitChainHeight(ctx, chainID, 5) providerKeeper.SetValsetUpdateBlockHeight(ctx, validVscID, 99) // Setup consumer address to provider address mapping. require.NotEmpty(t, tc.packetData.Validator.Address) - providerKeeper.SetValidatorByConsumerAddr(ctx, chainId, consumerConsAddr, providerConsAddr) + providerKeeper.SetValidatorByConsumerAddr(ctx, chainID, consumerConsAddr, providerConsAddr) // Execute method and assert expected mock calls. - providerKeeper.HandleSlashPacket(ctx, chainId, tc.packetData) + providerKeeper.HandleSlashPacket(ctx, chainID, tc.packetData) - require.Equal(t, tc.expectedSlashAcksLen, len(providerKeeper.GetSlashAcks(ctx, chainId))) + require.Equal(t, tc.expectedSlashAcksLen, len(providerKeeper.GetSlashAcks(ctx, chainID))) if tc.expectedSlashAcksLen == 1 { // must match the consumer address - require.Equal(t, consumerConsAddr.String(), providerKeeper.GetSlashAcks(ctx, chainId)[0]) - require.NotEqual(t, providerConsAddr.String(), providerKeeper.GetSlashAcks(ctx, chainId)[0]) + require.Equal(t, consumerConsAddr.String(), providerKeeper.GetSlashAcks(ctx, chainID)[0]) + require.NotEqual(t, providerConsAddr.String(), providerKeeper.GetSlashAcks(ctx, chainID)[0]) require.NotEqual(t, providerConsAddr.String(), consumerConsAddr.String()) } @@ -563,48 +568,48 @@ func TestHandleVSCMaturedPacket(t *testing.T) { defer ctrl.Finish() // Init vscID - pk.SetValidatorSetUpdateId(ctx, 1) + pk.SetValidatorSetUpdateID(ctx, 1) // Start first unbonding without any consumers registered - var unbondingOpId uint64 = 1 - err := pk.Hooks().AfterUnbondingInitiated(ctx, unbondingOpId) + var unbondingOpID uint64 = 1 + err := pk.Hooks().AfterUnbondingInitiated(ctx, unbondingOpID) require.NoError(t, err) // Check that no unbonding op was stored - _, found := pk.GetUnbondingOp(ctx, unbondingOpId) + _, found := pk.GetUnbondingOp(ctx, unbondingOpID) require.False(t, found) // Increment vscID - pk.IncrementValidatorSetUpdateId(ctx) - require.Equal(t, uint64(2), pk.GetValidatorSetUpdateId(ctx)) + pk.IncrementValidatorSetUpdateID(ctx) + require.Equal(t, uint64(2), pk.GetValidatorSetUpdateID(ctx)) // Registered first consumer - pk.SetConsumerClientId(ctx, "chain-1", "client-1") + pk.SetConsumerClientID(ctx, "chain-1", "client-1") // Start second unbonding - unbondingOpId = 2 + unbondingOpID = 2 gomock.InOrder( - mocks.MockStakingKeeper.EXPECT().PutUnbondingOnHold(ctx, unbondingOpId).Return(nil), + mocks.MockStakingKeeper.EXPECT().PutUnbondingOnHold(ctx, unbondingOpID).Return(nil), ) - err = pk.Hooks().AfterUnbondingInitiated(ctx, unbondingOpId) + err = pk.Hooks().AfterUnbondingInitiated(ctx, unbondingOpID) require.NoError(t, err) // Check that an unbonding op was stored expectedChains := []string{"chain-1"} - unbondingOp, found := pk.GetUnbondingOp(ctx, unbondingOpId) + unbondingOp, found := pk.GetUnbondingOp(ctx, unbondingOpID) require.True(t, found) - require.Equal(t, unbondingOpId, unbondingOp.Id) + require.Equal(t, unbondingOpID, unbondingOp.Id) require.Equal(t, expectedChains, unbondingOp.UnbondingConsumerChains) // Check that the unbonding op index was stored - expectedUnbondingOpIds := []uint64{unbondingOpId} - ids, found := pk.GetUnbondingOpIndex(ctx, "chain-1", pk.GetValidatorSetUpdateId(ctx)) + expectedUnbondingOpIds := []uint64{unbondingOpID} + ids, found := pk.GetUnbondingOpIndex(ctx, "chain-1", pk.GetValidatorSetUpdateID(ctx)) require.True(t, found) require.Equal(t, expectedUnbondingOpIds, ids) // Increment vscID - pk.IncrementValidatorSetUpdateId(ctx) - require.Equal(t, uint64(3), pk.GetValidatorSetUpdateId(ctx)) + pk.IncrementValidatorSetUpdateID(ctx) + require.Equal(t, uint64(3), pk.GetValidatorSetUpdateID(ctx)) // Registered second consumer - pk.SetConsumerClientId(ctx, "chain-2", "client-2") + pk.SetConsumerClientID(ctx, "chain-2", "client-2") // Start third and fourth unbonding unbondingOpIds := []uint64{3, 4} @@ -625,7 +630,7 @@ func TestHandleVSCMaturedPacket(t *testing.T) { } // Check that the unbonding op index was stored for _, chainID := range expectedChains { - ids, found := pk.GetUnbondingOpIndex(ctx, chainID, pk.GetValidatorSetUpdateId(ctx)) + ids, found := pk.GetUnbondingOpIndex(ctx, chainID, pk.GetValidatorSetUpdateID(ctx)) require.True(t, found) require.Equal(t, unbondingOpIds, ids) } diff --git a/x/ccv/provider/keeper/throttle.go b/x/ccv/provider/keeper/throttle.go index 6ff5bcd1fb..02fc9c61bd 100644 --- a/x/ccv/provider/keeper/throttle.go +++ b/x/ccv/provider/keeper/throttle.go @@ -16,7 +16,6 @@ import ( // handles all or some portion of throttled (slash and/or VSC matured) packet data received from // consumer chains. The slash meter is decremented appropriately in this method. func (k Keeper) HandleThrottleQueues(ctx sdktypes.Context) { - meter := k.GetSlashMeter(ctx) // Return if meter is negative in value if meter.IsNegative() { @@ -54,7 +53,6 @@ func (k Keeper) HandleThrottleQueues(ctx sdktypes.Context) { if len(handledEntries) > 0 { k.Logger(ctx).Info("handled global slash entries", "count", len(handledEntries), "meter", meter.Int64()) } - } // Obtains the effective validator power relevant to a validator consensus address. @@ -69,10 +67,9 @@ func (k Keeper) GetEffectiveValPower(ctx sdktypes.Context, // If validator is not found, or found but jailed, it's power is 0. This path is explicitly defined since the // staking keeper's LastValidatorPower values are not updated till the staking keeper's endblocker. return sdktypes.ZeroInt() - } else { - // Otherwise, return the staking keeper's LastValidatorPower value. - return sdktypes.NewInt(k.stakingKeeper.GetLastValidatorPower(ctx, val.GetOperator())) } + // Otherwise, return the staking keeper's LastValidatorPower value. + return sdktypes.NewInt(k.stakingKeeper.GetLastValidatorPower(ctx, val.GetOperator())) } // HandlePacketDataForChain handles only the first queued slash packet relevant to the passed consumer chainID, @@ -107,7 +104,6 @@ func (k Keeper) InitializeSlashMeter(ctx sdktypes.Context) { // CheckForSlashMeterReplenishment checks if the slash meter should be replenished, and if so, replenishes it. // Note: initial slash meter replenish time candidate is set in InitGenesis. func (k Keeper) CheckForSlashMeterReplenishment(ctx sdktypes.Context) { - // Replenish slash meter if current time is equal to or after the current replenish candidate time. if !ctx.BlockTime().UTC().Before(k.GetSlashMeterReplenishTimeCandidate(ctx)) { k.ReplenishSlashMeter(ctx) @@ -121,7 +117,6 @@ func (k Keeper) CheckForSlashMeterReplenishment(ctx sdktypes.Context) { // If slash meter is full, or more than full considering updated allowance/total power, allowance := k.GetSlashMeterAllowance(ctx) if k.GetSlashMeter(ctx).GTE(allowance) { - // Update/set replenish time candidate to one replenish period from now. // This time candidate will be updated in every future block until the slash meter becomes NOT full. k.SetSlashMeterReplenishTimeCandidate(ctx) @@ -133,7 +128,6 @@ func (k Keeper) CheckForSlashMeterReplenishment(ctx sdktypes.Context) { } func (k Keeper) ReplenishSlashMeter(ctx sdktypes.Context) { - meter := k.GetSlashMeter(ctx) oldMeter := meter allowance := k.GetSlashMeterAllowance(ctx) @@ -163,7 +157,6 @@ func (k Keeper) ReplenishSlashMeter(ctx sdktypes.Context) { // The slash meter must be less than or equal to the allowance for this block, before any slash // packet handling logic can be executed. func (k Keeper) GetSlashMeterAllowance(ctx sdktypes.Context) sdktypes.Int { - strFrac := k.GetSlashMeterReplenishFraction(ctx) // MustNewDecFromStr should not panic, since the (string representation) of the slash meter replenish fraction // is validated in ValidateGenesis and anytime the param is mutated. @@ -206,7 +199,6 @@ func (k Keeper) QueueGlobalSlashEntry(ctx sdktypes.Context, entry providertypes. // DeleteGlobalSlashEntriesForConsumer deletes all pending slash packet entries in the global queue, // only relevant to a single consumer. func (k Keeper) DeleteGlobalSlashEntriesForConsumer(ctx sdktypes.Context, consumerChainID string) { - allEntries := k.GetAllGlobalSlashEntries(ctx) entriesToDel := []providertypes.GlobalSlashEntry{} @@ -224,7 +216,6 @@ func (k Keeper) DeleteGlobalSlashEntriesForConsumer(ctx sdktypes.Context, consum // GlobalSlashEntryBytePrefix | uint64 recv time | ibc seq num | consumer chain id // Thus, the returned array is ordered by recv time, then ibc seq num. func (k Keeper) GetAllGlobalSlashEntries(ctx sdktypes.Context) []providertypes.GlobalSlashEntry { - store := ctx.KVStore(k.storeKey) iterator := sdktypes.KVStorePrefixIterator(store, []byte{providertypes.GlobalSlashEntryBytePrefix}) defer iterator.Close() @@ -277,7 +268,6 @@ func (k Keeper) GetThrottledPacketDataSize(ctx sdktypes.Context, consumerChainID // SetThrottledPacketDataSize sets the size of the throttled packet data queue for the given consumer chain func (k Keeper) SetThrottledPacketDataSize(ctx sdktypes.Context, consumerChainID string, size uint64) { - // Sanity check to ensure that the chain-specific throttled packet data queue does not grow too // large for a single consumer chain. This check ensures that binaries would panic deterministically // if the queue does grow too large. MaxThrottledPackets should be set accordingly (quite large). @@ -306,7 +296,8 @@ func (k Keeper) IncrementThrottledPacketDataSize(ctx sdktypes.Context, consumerC // // Note: This queue is shared between pending slash packet data and pending vsc matured packet data. func (k Keeper) QueueThrottledSlashPacketData( - ctx sdktypes.Context, consumerChainID string, ibcSeqNum uint64, data ccvtypes.SlashPacketData) error { + ctx sdktypes.Context, consumerChainID string, ibcSeqNum uint64, data ccvtypes.SlashPacketData, +) error { return k.QueueThrottledPacketData(ctx, consumerChainID, ibcSeqNum, data) } @@ -314,7 +305,8 @@ func (k Keeper) QueueThrottledSlashPacketData( // // Note: This queue is shared between pending slash packet data and pending vsc matured packet data. func (k Keeper) QueueThrottledVSCMaturedPacketData( - ctx sdktypes.Context, consumerChainID string, ibcSeqNum uint64, data ccvtypes.VSCMaturedPacketData) error { + ctx sdktypes.Context, consumerChainID string, ibcSeqNum uint64, data ccvtypes.VSCMaturedPacketData, +) error { return k.QueueThrottledPacketData(ctx, consumerChainID, ibcSeqNum, data) } @@ -325,8 +317,8 @@ func (k Keeper) QueueThrottledVSCMaturedPacketData( // OnRecvSlashPacket and OnRecvVSCMaturedPacket, meaning we can return an ibc err ack to the // counter party chain on error, instead of panicking this chain. func (k Keeper) QueueThrottledPacketData( - ctx sdktypes.Context, consumerChainID string, ibcSeqNum uint64, packetData interface{}) error { - + ctx sdktypes.Context, consumerChainID string, ibcSeqNum uint64, packetData any, +) error { store := ctx.KVStore(k.storeKey) var bz []byte @@ -359,10 +351,10 @@ func (k Keeper) QueueThrottledPacketData( // for a chain-specific throttled packet data queue. Ie the vsc matured packet data instances // that do not have any slash packet data instances preceding them in the queue for consumerChainID. func (k Keeper) GetLeadingVSCMaturedData(ctx sdktypes.Context, consumerChainID string) ( - vscMaturedData []ccvtypes.VSCMaturedPacketData, ibcSeqNums []uint64) { - + vscMaturedData []ccvtypes.VSCMaturedPacketData, ibcSeqNums []uint64, +) { store := ctx.KVStore(k.storeKey) - iteratorPrefix := providertypes.ChainIdWithLenKey(providertypes.ThrottledPacketDataBytePrefix, consumerChainID) + iteratorPrefix := providertypes.ChainIDWithLenKey(providertypes.ThrottledPacketDataBytePrefix, consumerChainID) iterator := sdktypes.KVStorePrefixIterator(store, iteratorPrefix) defer iterator.Close() @@ -370,8 +362,9 @@ func (k Keeper) GetLeadingVSCMaturedData(ctx sdktypes.Context, consumerChainID s // and return vsc matured packet data instances until we encounter a slash packet data instance. vscMaturedData = []ccvtypes.VSCMaturedPacketData{} ibcSeqNums = []uint64{} + // The iterator is ordered by IBC sequence number. for ; iterator.Valid(); iterator.Next() { - + // The key is the IBC sequence number, and the value is the packet data. bz := iterator.Value() if bz[0] == slashPacketData { break @@ -412,7 +405,7 @@ func (k Keeper) GetSlashAndTrailingData(ctx sdktypes.Context, consumerChainID st ibcSeqNums []uint64, ) { store := ctx.KVStore(k.storeKey) - iteratorPrefix := providertypes.ChainIdWithLenKey(providertypes.ThrottledPacketDataBytePrefix, consumerChainID) + iteratorPrefix := providertypes.ChainIDWithLenKey(providertypes.ThrottledPacketDataBytePrefix, consumerChainID) iterator := sdktypes.KVStorePrefixIterator(store, iteratorPrefix) defer iterator.Close() @@ -421,21 +414,21 @@ func (k Keeper) GetSlashAndTrailingData(ctx sdktypes.Context, consumerChainID st vscMaturedData = []ccvtypes.VSCMaturedPacketData{} ibcSeqNums = []uint64{} + // Iterate over the throttled packet data queue for ; iterator.Valid(); iterator.Next() { - + // The key is the IBC sequence number, and the value is the packet data. bz := iterator.Value() - if bz[0] == slashPacketData { + if bz[0] == slashPacketData { //nolint:gocritic // this if-else chain isn't worth a refactor to switch statement if slashFound { // Break for-loop, we've already found first slash packet data instance. break - } else { - if err := slashData.Unmarshal(bz[1:]); err != nil { - // An error here would indicate something is very wrong, - // slash packet data is assumed to be correctly serialized in QueueThrottledPacketData. - panic(fmt.Sprintf("failed to unmarshal slash packet data: %v", err)) - } - slashFound = true } + if err := slashData.Unmarshal(bz[1:]); err != nil { + // An error here would indicate something is very wrong, + // slash packet data is assumed to be correctly serialized in QueueThrottledPacketData. + panic(fmt.Sprintf("failed to unmarshal slash packet data: %v", err)) + } + slashFound = true } else if bz[0] == vscMaturedPacketData { vscMData := ccvtypes.VSCMaturedPacketData{} if err := vscMData.Unmarshal(bz[1:]); err != nil { @@ -463,15 +456,15 @@ func (k Keeper) GetSlashAndTrailingData(ctx sdktypes.Context, consumerChainID st // Since this method executes on query, no panics are explicitly included. func (k Keeper) GetAllThrottledPacketData(ctx sdktypes.Context, consumerChainID string) ( slashData []ccvtypes.SlashPacketData, vscMaturedData []ccvtypes.VSCMaturedPacketData, - rawOrderedData []interface{}, ibcSeqNums []uint64) { - + rawOrderedData []any, ibcSeqNums []uint64, +) { slashData = []ccvtypes.SlashPacketData{} vscMaturedData = []ccvtypes.VSCMaturedPacketData{} - rawOrderedData = []interface{}{} + rawOrderedData = []any{} ibcSeqNums = []uint64{} store := ctx.KVStore(k.storeKey) - iteratorPrefix := providertypes.ChainIdWithLenKey(providertypes.ThrottledPacketDataBytePrefix, consumerChainID) + iteratorPrefix := providertypes.ChainIDWithLenKey(providertypes.ThrottledPacketDataBytePrefix, consumerChainID) iterator := sdktypes.KVStorePrefixIterator(store, iteratorPrefix) defer iterator.Close() @@ -511,9 +504,8 @@ func (k Keeper) GetAllThrottledPacketData(ctx sdktypes.Context, consumerChainID // DeleteAllPacketDataForConsumer deletes all queued packet data for the given consumer chain. func (k Keeper) DeleteThrottledPacketDataForConsumer(ctx sdktypes.Context, consumerChainID string) { - store := ctx.KVStore(k.storeKey) - iteratorPrefix := providertypes.ChainIdWithLenKey(providertypes.ThrottledPacketDataBytePrefix, consumerChainID) + iteratorPrefix := providertypes.ChainIDWithLenKey(providertypes.ThrottledPacketDataBytePrefix, consumerChainID) iterator := sdktypes.KVStorePrefixIterator(store, iteratorPrefix) defer iterator.Close() @@ -568,7 +560,6 @@ func (k Keeper) GetSlashMeter(ctx sdktypes.Context) sdktypes.Int { // // Note: the value of this int should always be in the range of tendermint's [-MaxTotalVotingPower, MaxTotalVotingPower] func (k Keeper) SetSlashMeter(ctx sdktypes.Context, value sdktypes.Int) { - // TODO: remove these invariant panics once https://github.com/cosmos/interchain-security/issues/534 is solved. // The following panics are included since they are invariants for slash meter value. @@ -604,13 +595,13 @@ func (k Keeper) GetSlashMeterReplenishTimeCandidate(ctx sdktypes.Context) time.T // there is no deletion method exposed, so nil bytes would indicate something is very wrong. panic("slash meter replenish time candidate not set") } - time, err := sdktypes.ParseTimeBytes(bz) + chaintime, err := sdktypes.ParseTimeBytes(bz) if err != nil { // We should have obtained value bytes that were serialized in SetSlashMeterReplenishTimeCandidate, // so an error here would indicate something is very wrong. panic(fmt.Sprintf("failed to parse slash meter replenish time candidate: %s", err)) } - return time.UTC() + return chaintime.UTC() } // SetSlashMeterReplenishTimeCandidate sets the next time the slash meter may be replenished diff --git a/x/ccv/provider/keeper/throttle_test.go b/x/ccv/provider/keeper/throttle_test.go index 7d5056c5e9..d2265dce24 100644 --- a/x/ccv/provider/keeper/throttle_test.go +++ b/x/ccv/provider/keeper/throttle_test.go @@ -21,25 +21,24 @@ import ( // TestHandlePacketDataForChain tests the HandlePacketDataForChain function. Note: Only one consumer is tested here, // but multiple consumers are tested in TestPendingPacketData. func TestHandlePacketDataForChain(t *testing.T) { - testCases := []struct { name string chainID string // Pending packet data that will be queued in the order specified by the slice - dataToQueue []interface{} + dataToQueue []any // Indexes of packet data from dataToQueue that are expected to be handled and deleted from store expectedHandledIndexes []int }{ { "no packets", "my-cool-chain", - []interface{}{}, + []any{}, []int{}, }, { "one slash packet should be handled", "chain-37", - []interface{}{ + []any{ testkeeper.GetNewSlashPacketData(), }, []int{0}, @@ -47,7 +46,7 @@ func TestHandlePacketDataForChain(t *testing.T) { { "one slash packet followed by one vsc matured packet should all be handled", "chain-222", - []interface{}{ + []any{ testkeeper.GetNewSlashPacketData(), testkeeper.GetNewVSCMaturedPacketData(), }, @@ -56,7 +55,7 @@ func TestHandlePacketDataForChain(t *testing.T) { { "one slash packet followed by multiple vsc matured packets should all be handled", "chain-2223", - []interface{}{ + []any{ testkeeper.GetNewSlashPacketData(), testkeeper.GetNewVSCMaturedPacketData(), testkeeper.GetNewVSCMaturedPacketData(), @@ -69,7 +68,7 @@ func TestHandlePacketDataForChain(t *testing.T) { { "multiple slash packets followed by multiple vsc matured packets should only handle first slash packet", "chain-9", - []interface{}{ + []any{ testkeeper.GetNewSlashPacketData(), testkeeper.GetNewSlashPacketData(), testkeeper.GetNewVSCMaturedPacketData(), @@ -80,7 +79,7 @@ func TestHandlePacketDataForChain(t *testing.T) { { "vsc matured packets sandwiched between slash packets should handle everything but the last slash packet", "chain-000", - []interface{}{ + []any{ testkeeper.GetNewSlashPacketData(), testkeeper.GetNewVSCMaturedPacketData(), testkeeper.GetNewVSCMaturedPacketData(), @@ -98,7 +97,7 @@ func TestHandlePacketDataForChain(t *testing.T) { { "alternating slash and vsc matured packets should handle only the first slash, and trailing vsc matured packets", "chain-00000", - []interface{}{ + []any{ testkeeper.GetNewSlashPacketData(), testkeeper.GetNewVSCMaturedPacketData(), testkeeper.GetNewVSCMaturedPacketData(), @@ -127,7 +126,7 @@ func TestHandlePacketDataForChain(t *testing.T) { } // Define our handler callbacks to simply store the data instances that are handled - handledData := []interface{}{} + handledData := []any{} slashHandleCounter := func(ctx sdktypes.Context, chainID string, data ccvtypes.SlashPacketData) { handledData = append(handledData, data) } @@ -157,7 +156,7 @@ func TestHandlePacketDataForChain(t *testing.T) { } // Assert that the unhandled queued data instances are as expected (i.e no unexpected deletions) - expectedDataThatsLeft := []interface{}{} + expectedDataThatsLeft := []any{} for idx, data := range tc.dataToQueue { if !slices.Contains(tc.expectedHandledIndexes, idx) { expectedDataThatsLeft = append(expectedDataThatsLeft, data) @@ -203,8 +202,8 @@ func TestSlashMeterReplenishment(t *testing.T) { expectedAllowance: sdktypes.NewInt(500000000000000), }, } + // Run test cases for _, tc := range testCases { - providerKeeper, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx( t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() @@ -361,7 +360,6 @@ func TestConsecutiveReplenishments(t *testing.T) { // TestSlashMeterAllowanceChanges tests the behavior of a full slash meter // when total voting power becomes higher and lower. func TestTotalVotingPowerChanges(t *testing.T) { - providerKeeper, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() @@ -452,7 +450,6 @@ func TestTotalVotingPowerChanges(t *testing.T) { // and also the fact that the replenishment allowance becomes lower as total // voting power becomes lower from slashing. func TestNegativeSlashMeter(t *testing.T) { - testCases := []struct { slashedPower sdktypes.Int totalPower sdktypes.Int @@ -604,8 +601,8 @@ func TestGetSlashMeterAllowance(t *testing.T) { expectedAllowance: sdktypes.NewInt(3400000), }, } + // Run test cases for _, tc := range testCases { - providerKeeper, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx( t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() @@ -629,7 +626,6 @@ func TestGetSlashMeterAllowance(t *testing.T) { // TestGlobalSlashEntries tests the queue and iteration functions for global slash entries, // with assertion of FIFO ordering func TestGlobalSlashEntries(t *testing.T) { - providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() @@ -723,7 +719,6 @@ func TestGlobalSlashEntries(t *testing.T) { // Tests DeleteGlobalSlashEntriesForConsumer. func TestDeleteGlobalSlashEntriesForConsumer(t *testing.T) { - providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx( t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() @@ -756,7 +751,6 @@ func TestDeleteGlobalSlashEntriesForConsumer(t *testing.T) { // TestGlobalSlashEntryDeletion tests the deletion function for // global slash entries with assertion of FIFO ordering. func TestGlobalSlashEntryDeletion(t *testing.T) { - providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() @@ -828,7 +822,6 @@ func TestGlobalSlashEntryDeletion(t *testing.T) { // TestThrottledPacketData tests chain-specific throttled packet data queuing, // iteration and deletion functionality. func TestThrottledPacketData(t *testing.T) { - providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() providerKeeper.SetParams(ctx, providertypes.DefaultParams()) @@ -918,7 +911,6 @@ func TestThrottledPacketData(t *testing.T) { } func TestGetLeadingVSCMaturedData(t *testing.T) { - // Instantiate some sample data slashData := getTenSampleSlashPacketData() vscMaturedData := getTenSampleVSCMaturedPacketData() @@ -997,8 +989,8 @@ func TestGetLeadingVSCMaturedData(t *testing.T) { }, } + // Run test cases for _, tc := range testCases { - providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() providerKeeper.SetParams(ctx, providertypes.DefaultParams()) @@ -1026,7 +1018,6 @@ func TestGetLeadingVSCMaturedData(t *testing.T) { } func TestGetSlashAndTrailingData(t *testing.T) { - // Instantiate some data to test against someSlashData := getTenSampleSlashPacketData() someVSCMaturedData := getTenSampleVSCMaturedPacketData() @@ -1103,8 +1094,8 @@ func TestGetSlashAndTrailingData(t *testing.T) { }, } + // Run test cases for _, tc := range testCases { - providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() providerKeeper.SetParams(ctx, providertypes.DefaultParams()) @@ -1133,7 +1124,6 @@ func TestGetSlashAndTrailingData(t *testing.T) { // TestDeleteThrottledPacketDataForConsumer tests the DeleteThrottledPacketDataForConsumer method. func TestDeleteThrottledPacketDataForConsumer(t *testing.T) { - providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() providerKeeper.SetParams(ctx, providertypes.DefaultParams()) @@ -1178,7 +1168,6 @@ func TestDeleteThrottledPacketDataForConsumer(t *testing.T) { // TestPanicIfTooMuchThrottledPacketData tests that the provider panics // when the number of throttled (queued) packets exceeds the max allowed by params. func TestPanicIfTooMuchThrottledPacketData(t *testing.T) { - testCases := []struct { max int64 }{ @@ -1190,8 +1179,8 @@ func TestPanicIfTooMuchThrottledPacketData(t *testing.T) { {max: 100}, } + // Test that the provider panics when the number of throttled packets exceeds the max allowed by params for _, tc := range testCases { - providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() @@ -1211,8 +1200,8 @@ func TestPanicIfTooMuchThrottledPacketData(t *testing.T) { // Queue packet data instances until we reach the max (some slash packets, some VSC matured packets) reachedMax := false for i := 0; i < int(tc.max); i++ { - randBool := rand.Intn(2) == 0 - var data interface{} + randBool := rand.Intn(2) == 0 //nolint:gosec // not used for security purposes + var data any if randBool { data = testkeeper.GetNewSlashPacketData() } else { @@ -1235,7 +1224,6 @@ func TestPanicIfTooMuchThrottledPacketData(t *testing.T) { // TestThrottledPacketDataSize tests the getter, setter and incrementer for throttled packet data size. func TestThrottledPacketDataSize(t *testing.T) { - providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() @@ -1257,7 +1245,6 @@ func TestThrottledPacketDataSize(t *testing.T) { // TestSlashMeter tests the getter and setter for the slash gas meter func TestSlashMeter(t *testing.T) { - testCases := []struct { meterValue sdktypes.Int shouldPanic bool @@ -1295,7 +1282,6 @@ func TestSlashMeter(t *testing.T) { // TestSlashMeterReplenishTimeCandidate tests the getter and setter for the slash meter replenish time candidate func TestSlashMeterReplenishTimeCandidate(t *testing.T) { - testCases := []struct { blockTime time.Time replenishPeriod time.Duration @@ -1332,14 +1318,13 @@ func TestSlashMeterReplenishTimeCandidate(t *testing.T) { // Struct used for TestPendingPacketData and helpers type throttledPacketDataInstance struct { IbcSeqNum uint64 - Data interface{} + Data any } // getAllThrottledPacketDataInstances returns all throttled packet data instances in order // from the chain-specific packet data queue. -func getAllThrottledPacketDataInstances(ctx sdktypes.Context, k *keeper.Keeper, consumerChainId string) (instances []throttledPacketDataInstance) { - - _, _, allData, ibcSeqNums := k.GetAllThrottledPacketData(ctx, consumerChainId) +func getAllThrottledPacketDataInstances(ctx sdktypes.Context, k *keeper.Keeper, consumerChainID string) (instances []throttledPacketDataInstance) { + _, _, allData, ibcSeqNums := k.GetAllThrottledPacketData(ctx, consumerChainID) instances = []throttledPacketDataInstance{} for idx, data := range allData { instances = append(instances, throttledPacketDataInstance{ @@ -1361,9 +1346,10 @@ func getOrderedInstances(instances []throttledPacketDataInstance, orderbyIdx []i // Asserts that the throttled packet data retrieved for this consumer chain matches what's expected func assertPendingPacketDataOrdering(t *testing.T, k *keeper.Keeper, ctx sdktypes.Context, - consumerChainId string, expectedInstances []throttledPacketDataInstance) { + consumerChainID string, expectedInstances []throttledPacketDataInstance, +) { // Get all packet data for this chain - obtainedInstances := getAllThrottledPacketDataInstances(ctx, k, consumerChainId) + obtainedInstances := getAllThrottledPacketDataInstances(ctx, k, consumerChainID) // No extra data should be present require.Equal(t, len(expectedInstances), len(obtainedInstances)) // Assert order and correct serialization/deserialization for each data instance diff --git a/x/ccv/provider/module.go b/x/ccv/provider/module.go index cba9af2ae7..2d0fd9725a 100644 --- a/x/ccv/provider/module.go +++ b/x/ccv/provider/module.go @@ -53,7 +53,7 @@ func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { } // ValidateGenesis performs genesis state validation for the ibc provider module. -func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error { +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error { var data providertypes.GenesisState if err := cdc.UnmarshalJSON(bz, &data); err != nil { return fmt.Errorf("failed to unmarshal %s genesis state: %w", providertypes.ModuleName, err) @@ -63,12 +63,12 @@ func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncod } // RegisterRESTRoutes implements AppModuleBasic interface -func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router) { +func (AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) { } // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the ibc-provider module. -func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { - err := providertypes.RegisterQueryHandlerClient(context.Background(), mux, providertypes.NewQueryClient(clientCtx)) +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, gatewayMux *runtime.ServeMux) { + err := providertypes.RegisterQueryHandlerClient(context.Background(), gatewayMux, providertypes.NewQueryClient(clientCtx)) if err != nil { // same behavior as in cosmos-sdk panic(err) @@ -99,12 +99,12 @@ func NewAppModule(k *keeper.Keeper) AppModule { } // RegisterInvariants implements the AppModule interface -func (AppModule) RegisterInvariants(ir sdk.InvariantRegistry) { +func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry) { // TODO } // Route implements the AppModule interface -func (am AppModule) Route() sdk.Route { +func (AppModule) Route() sdk.Route { return sdk.Route{} } @@ -114,7 +114,7 @@ func (AppModule) QuerierRoute() string { } // LegacyQuerierHandler implements the AppModule interface -func (am AppModule) LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier { +func (AppModule) LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier { return nil } @@ -147,7 +147,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw func (AppModule) ConsensusVersion() uint64 { return 1 } // BeginBlock implements the AppModule interface -func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { +func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { // Create clients to consumer chains that are due to be spawned via pending consumer addition proposals am.keeper.BeginBlockInit(ctx) // Stop and remove state for any consumer chains that are due to be stopped via pending consumer removal proposals @@ -155,7 +155,7 @@ func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { } // EndBlock implements the AppModule interface -func (am AppModule) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.ValidatorUpdate { +func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { // EndBlock logic needed for the Consumer Initiated Slashing sub-protocol. // Important: EndBlockCIS must be called before EndBlockVSU am.keeper.EndBlockCIS(ctx) @@ -170,7 +170,7 @@ func (am AppModule) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.V // AppModuleSimulation functions // GenerateGenesisState creates a randomized GenState of the transfer module. -func (AppModule) GenerateGenesisState(simState *module.SimulationState) { +func (AppModule) GenerateGenesisState(_ *module.SimulationState) { } // ProposalContents doesn't return any content functions for governance proposals. @@ -179,15 +179,15 @@ func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedP } // RandomizedParams creates randomized provider param changes for the simulator. -func (AppModule) RandomizedParams(r *rand.Rand) []simtypes.ParamChange { +func (AppModule) RandomizedParams(_ *rand.Rand) []simtypes.ParamChange { return nil } // RegisterStoreDecoder registers a decoder for provider module's types -func (am AppModule) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry) { +func (AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) { } // WeightedOperations returns the all the provider module operations with their respective weights. -func (am AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { +func (AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { return nil } diff --git a/x/ccv/provider/module_test.go b/x/ccv/provider/module_test.go index 1830309f9a..02797f1411 100644 --- a/x/ccv/provider/module_test.go +++ b/x/ccv/provider/module_test.go @@ -22,7 +22,6 @@ import ( // // Note: Genesis validation for the provider is tested in TestValidateGenesisState func TestInitGenesis(t *testing.T) { - type testCase struct { name string // Whether port capability is already bound to the CCV provider module @@ -97,7 +96,7 @@ func TestInitGenesis(t *testing.T) { appModule := provider.NewAppModule(&providerKeeper) genState := types.NewGenesisState( - providerKeeper.GetValidatorSetUpdateId(ctx), + providerKeeper.GetValidatorSetUpdateID(ctx), nil, tc.consumerStates, nil, @@ -161,7 +160,7 @@ func TestInitGenesis(t *testing.T) { numStatesCounted := 0 for _, state := range tc.consumerStates { - numStatesCounted += 1 + numStatesCounted++ channelID, found := providerKeeper.GetChainToChannel(ctx, state.ChainId) require.True(t, found) require.Equal(t, state.ChannelId, channelID) diff --git a/x/ccv/provider/proposal_handler_test.go b/x/ccv/provider/proposal_handler_test.go index 570598034c..e100006776 100644 --- a/x/ccv/provider/proposal_handler_test.go +++ b/x/ccv/provider/proposal_handler_test.go @@ -84,8 +84,8 @@ func TestProviderProposalHandler(t *testing.T) { }, } + // Run test cases for _, tc := range testCases { - // Setup keeperParams := testkeeper.NewInMemKeeperParams(t) providerKeeper, ctx, _, mocks := testkeeper.GetProviderKeeperAndCtx(t, keeperParams) diff --git a/x/ccv/provider/types/codec.go b/x/ccv/provider/types/codec.go index 97772e7f00..8daf8ab9be 100644 --- a/x/ccv/provider/types/codec.go +++ b/x/ccv/provider/types/codec.go @@ -10,7 +10,7 @@ import ( // RegisterLegacyAminoCodec registers the necessary x/ibc transfer interfaces and concrete types // on the provided LegacyAmino codec. These types are used for Amino JSON serialization. -func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { +func RegisterLegacyAminoCodec(_ *codec.LegacyAmino) { } // RegisterInterfaces registers the provider proposal structs to the interface registry diff --git a/x/ccv/provider/types/errors.go b/x/ccv/provider/types/errors.go index 21af516878..40a27e7859 100644 --- a/x/ccv/provider/types/errors.go +++ b/x/ccv/provider/types/errors.go @@ -8,8 +8,8 @@ import ( var ( ErrInvalidConsumerAdditionProposal = sdkerrors.Register(ModuleName, 1, "invalid consumer addition proposal") ErrInvalidConsumerRemovalProp = sdkerrors.Register(ModuleName, 2, "invalid consumer removal proposal") - ErrUnknownConsumerChainId = sdkerrors.Register(ModuleName, 3, "no consumer chain with this chain id") - ErrUnknownConsumerChannelId = sdkerrors.Register(ModuleName, 4, "no consumer chain with this channel id") + ErrUnknownConsumerChainID = sdkerrors.Register(ModuleName, 3, "no consumer chain with this chain id") + ErrUnknownConsumerChannelID = sdkerrors.Register(ModuleName, 4, "no consumer chain with this channel id") ErrInvalidConsumerConsensusPubKey = sdkerrors.Register(ModuleName, 5, "empty consumer consensus public key") ErrBlankConsumerChainID = sdkerrors.Register(ModuleName, 6, "consumer chain id must not be blank") ErrConsumerKeyNotFound = sdkerrors.Register(ModuleName, 7, "consumer key not found") diff --git a/x/ccv/provider/types/genesis.go b/x/ccv/provider/types/genesis.go index 0098076818..c05c035782 100644 --- a/x/ccv/provider/types/genesis.go +++ b/x/ccv/provider/types/genesis.go @@ -11,7 +11,7 @@ import ( func NewGenesisState( vscID uint64, - vscIdToHeights []ValsetUpdateIdToHeight, + vscIDToHeights []ValsetUpdateIdToHeight, consumerStates []ConsumerState, unbondingOps []UnbondingOp, matureUbdOps *ccv.MaturedUnbondingOps, @@ -24,7 +24,7 @@ func NewGenesisState( ) *GenesisState { return &GenesisState{ ValsetUpdateId: vscID, - ValsetUpdateIdToHeight: vscIdToHeights, + ValsetUpdateIdToHeight: vscIDToHeights, ConsumerStates: consumerStates, UnbondingOps: unbondingOps, MatureUnbondingOps: matureUbdOps, @@ -85,14 +85,12 @@ func (gs GenesisState) Validate() error { return err } - if err := KeyAssignmentValidateBasic(gs.ValidatorConsumerPubkeys, + err := KeyAssignmentValidateBasic(gs.ValidatorConsumerPubkeys, gs.ValidatorsByConsumerAddr, gs.ConsumerAddrsToPrune, - ); err != nil { - return err - } + ) - return nil + return err } func (gs GenesisState) ValidateUnbondingOp(ubdOp UnbondingOp) error { diff --git a/x/ccv/provider/types/genesis_test.go b/x/ccv/provider/types/genesis_test.go index e64eb4d4a2..7bacf1e3e4 100644 --- a/x/ccv/provider/types/genesis_test.go +++ b/x/ccv/provider/types/genesis_test.go @@ -18,7 +18,6 @@ import ( // Tests validation of consumer states and params within a provider genesis state func TestValidateGenesisState(t *testing.T) { - testCases := []struct { name string genState *types.GenesisState @@ -412,8 +411,10 @@ func TestValidateGenesisState(t *testing.T) { types.NewGenesisState( types.DefaultValsetUpdateID, nil, - []types.ConsumerState{{ChainId: "chainid", ChannelId: "channel-0", ClientId: "client-id", - ConsumerGenesis: consumertypes.GenesisState{}}}, + []types.ConsumerState{{ + ChainId: "chainid", ChannelId: "channel-0", ClientId: "client-id", + ConsumerGenesis: consumertypes.GenesisState{}, + }}, nil, nil, nil, @@ -430,9 +431,11 @@ func TestValidateGenesisState(t *testing.T) { types.NewGenesisState( types.DefaultValsetUpdateID, nil, - []types.ConsumerState{{ChainId: "chainid", ChannelId: "channel-0", ClientId: "client-id", + []types.ConsumerState{{ + ChainId: "chainid", ChannelId: "channel-0", ClientId: "client-id", ConsumerGenesis: getInitialConsumerGenesis(t, "chainid"), - SlashDowntimeAck: []string{"cosmosvaloper1qlmk6r5w5taqrky4ycur4zq6jqxmuzr688htpp"}}}, + SlashDowntimeAck: []string{"cosmosvaloper1qlmk6r5w5taqrky4ycur4zq6jqxmuzr688htpp"}, + }}, nil, nil, nil, @@ -449,9 +452,11 @@ func TestValidateGenesisState(t *testing.T) { types.NewGenesisState( types.DefaultValsetUpdateID, nil, - []types.ConsumerState{{ChainId: "chainid", ChannelId: "channel-0", ClientId: "client-id", + []types.ConsumerState{{ + ChainId: "chainid", ChannelId: "channel-0", ClientId: "client-id", ConsumerGenesis: getInitialConsumerGenesis(t, "chainid"), - PendingValsetChanges: []ccv.ValidatorSetChangePacketData{{}}}}, + PendingValsetChanges: []ccv.ValidatorSetChangePacketData{{}}, + }}, nil, nil, nil, @@ -468,12 +473,15 @@ func TestValidateGenesisState(t *testing.T) { types.NewGenesisState( types.DefaultValsetUpdateID, nil, - []types.ConsumerState{{ChainId: "chainid", ChannelId: "channel-0", ClientId: "client-id", + []types.ConsumerState{{ + ChainId: "chainid", ChannelId: "channel-0", ClientId: "client-id", ConsumerGenesis: getInitialConsumerGenesis(t, "chainid"), PendingValsetChanges: []ccv.ValidatorSetChangePacketData{{ SlashAcks: []string{"cosmosvaloper1qlmk6r5w5taqrky4ycur4zq6jqxmuzr688htpp"}, ValsetUpdateId: 1, - ValidatorUpdates: []abci.ValidatorUpdate{{}}}}}}, + ValidatorUpdates: []abci.ValidatorUpdate{{}}, + }}, + }}, nil, nil, nil, @@ -620,8 +628,10 @@ func TestValidateGenesisState(t *testing.T) { types.NewGenesisState( types.DefaultValsetUpdateID, nil, - []types.ConsumerState{{ChainId: "chainid", ChannelId: "channel-0", ClientId: "client-id", - UnbondingOpsIndex: []types.VscUnbondingOps{{VscId: 1}}}}, + []types.ConsumerState{{ + ChainId: "chainid", ChannelId: "channel-0", ClientId: "client-id", + UnbondingOpsIndex: []types.VscUnbondingOps{{VscId: 1}}, + }}, nil, nil, nil, @@ -671,7 +681,7 @@ func getInitialConsumerGenesis(t *testing.T, chainID string) consumertypes.Genes true, true, ) - consensusState := ibctmtypes.NewConsensusState(time.Now(), commitmenttypes.NewMerkleRoot([]byte("apphash")), valHash[:]) + consensusState := ibctmtypes.NewConsensusState(time.Now(), commitmenttypes.NewMerkleRoot([]byte("apphash")), valHash) params := consumertypes.DefaultParams() params.Enabled = true diff --git a/x/ccv/provider/types/keys.go b/x/ccv/provider/types/keys.go index 07773a91f3..d55d8379de 100644 --- a/x/ccv/provider/types/keys.go +++ b/x/ccv/provider/types/keys.go @@ -42,7 +42,7 @@ const ( MaturedUnbondingOpsByteKey // ValidatorSetUpdateIdByteKey is the byte key that stores the current validator set update id - ValidatorSetUpdateIdByteKey + ValidatorSetUpdateIDByteKey // SlashMeterByteKey is the byte key for storing the slash meter SlashMeterByteKey @@ -125,7 +125,7 @@ const ( ConsumerAddrsToPruneBytePrefix // SlashLogBytePrefix is the byte prefix that will store the mapping from provider address to boolean - // denoting whether the provider address has commited any double signign infractions + // denoting whether the provider address has committed any double signign infractions SlashLogBytePrefix ) @@ -140,8 +140,8 @@ func MaturedUnbondingOpsKey() []byte { } // ValidatorSetUpdateIdKey is the key that stores the current validator set update id -func ValidatorSetUpdateIdKey() []byte { - return []byte{ValidatorSetUpdateIdByteKey} +func ValidatorSetUpdateIDKey() []byte { + return []byte{ValidatorSetUpdateIDByteKey} } // SlashMeterKey returns the key storing the slash meter @@ -206,13 +206,13 @@ func PendingCRPKey(timestamp time.Time, chainID string) []byte { // Note: chainId is hashed to a fixed length sequence of bytes here to prevent // injection attack between chainIDs. func UnbondingOpIndexKey(chainID string, vscID uint64) []byte { - return ChainIdAndUintIdKey(UnbondingOpIndexBytePrefix, chainID, vscID) + return ChainIDAndUintIDKey(UnbondingOpIndexBytePrefix, chainID, vscID) } // ParseUnbondingOpIndexKey parses an unbonding op index key for VSC ID // Removes the prefix + chainID from index key and returns only the key part. func ParseUnbondingOpIndexKey(key []byte) (string, uint64, error) { - return ParseChainIdAndUintIdKey(UnbondingOpIndexBytePrefix, key) + return ParseChainIDAndUintIDKey(UnbondingOpIndexBytePrefix, key) } // UnbondingOpKey returns the key that stores a record of all the ids of consumer chains that @@ -224,9 +224,9 @@ func UnbondingOpKey(id uint64) []byte { } // ValsetUpdateBlockHeightKey returns the key that storing the mapping from valset update ID to block height -func ValsetUpdateBlockHeightKey(valsetUpdateId uint64) []byte { +func ValsetUpdateBlockHeightKey(valsetUpdateID uint64) []byte { vuidBytes := make([]byte, 8) - binary.BigEndian.PutUint64(vuidBytes, valsetUpdateId) + binary.BigEndian.PutUint64(vuidBytes, valsetUpdateID) return append([]byte{ValsetUpdateBlockHeightBytePrefix}, vuidBytes...) } @@ -255,37 +255,37 @@ func PendingVSCsKey(chainID string) []byte { // VscSendingTimestampKey returns the key under which the // sending timestamp of the VSCPacket with vsc ID is stored func VscSendingTimestampKey(chainID string, vscID uint64) []byte { - return ChainIdAndUintIdKey(VscSendTimestampBytePrefix, chainID, vscID) + return ChainIDAndUintIDKey(VscSendTimestampBytePrefix, chainID, vscID) } // ParseVscTimeoutTimestampKey returns chain ID and vsc ID // for a VscSendingTimestampKey or an error if unparsable func ParseVscSendingTimestampKey(bz []byte) (string, uint64, error) { - return ParseChainIdAndUintIdKey(VscSendTimestampBytePrefix, bz) + return ParseChainIDAndUintIDKey(VscSendTimestampBytePrefix, bz) } // ConsumerValidatorsKey returns the key under which the // validator assigned keys for every consumer chain are stored func ConsumerValidatorsKey(chainID string, addr ProviderConsAddress) []byte { - return ChainIdAndConsAddrKey(ConsumerValidatorsBytePrefix, chainID, addr.ToSdkConsAddr()) + return ChainIDAndConsAddrKey(ConsumerValidatorsBytePrefix, chainID, addr.ToSdkConsAddr()) } // ValidatorsByConsumerAddrKey returns the key under which the mapping from validator addresses // on consumer chains to validator addresses on the provider chain is stored func ValidatorsByConsumerAddrKey(chainID string, addr ConsumerConsAddress) []byte { - return ChainIdAndConsAddrKey(ValidatorsByConsumerAddrBytePrefix, chainID, addr.ToSdkConsAddr()) + return ChainIDAndConsAddrKey(ValidatorsByConsumerAddrBytePrefix, chainID, addr.ToSdkConsAddr()) } // KeyAssignmentReplacementsKey returns the key under which the // key assignments that need to be replaced in the current block are stored func KeyAssignmentReplacementsKey(chainID string, addr ProviderConsAddress) []byte { - return ChainIdAndConsAddrKey(KeyAssignmentReplacementsBytePrefix, chainID, addr.ToSdkConsAddr()) + return ChainIDAndConsAddrKey(KeyAssignmentReplacementsBytePrefix, chainID, addr.ToSdkConsAddr()) } // ConsumerAddrsToPruneKey returns the key under which the // mapping from VSC ids to consumer validators addresses is stored func ConsumerAddrsToPruneKey(chainID string, vscID uint64) []byte { - return ChainIdAndUintIdKey(ConsumerAddrsToPruneBytePrefix, chainID, vscID) + return ChainIDAndUintIDKey(ConsumerAddrsToPruneBytePrefix, chainID, vscID) } // ThrottledPacketDataSizeKey returns the key storing the size of the throttled packet data queue for a given chain ID @@ -295,21 +295,21 @@ func ThrottledPacketDataSizeKey(consumerChainID string) []byte { // ThrottledPacketDataKey returns the key storing the throttled packet data queue for a given chain ID and ibc seq num func ThrottledPacketDataKey(consumerChainID string, ibcSeqNum uint64) []byte { - return ChainIdAndUintIdKey(ThrottledPacketDataBytePrefix, consumerChainID, ibcSeqNum) + return ChainIDAndUintIDKey(ThrottledPacketDataBytePrefix, consumerChainID, ibcSeqNum) } // MustParseThrottledPacketDataKey parses a throttled packet data key or panics upon failure func MustParseThrottledPacketDataKey(key []byte) (string, uint64) { - chainId, ibcSeqNum, err := ParseThrottledPacketDataKey(key) + chainID, ibcSeqNum, err := ParseThrottledPacketDataKey(key) if err != nil { panic(fmt.Sprintf("failed to parse throttled packet data key: %s", err.Error())) } - return chainId, ibcSeqNum + return chainID, ibcSeqNum } // ParseThrottledPacketDataKey parses a throttled packet data key -func ParseThrottledPacketDataKey(key []byte) (chainId string, ibcSeqNum uint64, err error) { - return ParseChainIdAndUintIdKey(ThrottledPacketDataBytePrefix, key) +func ParseThrottledPacketDataKey(key []byte) (chainID string, ibcSeqNum uint64, err error) { + return ParseChainIDAndUintIDKey(ThrottledPacketDataBytePrefix, key) } // GlobalSlashEntryKey returns the key for storing a global slash queue entry. @@ -330,8 +330,8 @@ func GlobalSlashEntryKey(entry GlobalSlashEntry) []byte { // MustParseGlobalSlashEntryKey returns the received time and chainID for a global slash queue entry key, // or panics if the key is invalid. func MustParseGlobalSlashEntryKey(bz []byte) ( - recvTime time.Time, consumerChainID string, ibcSeqNum uint64) { - + recvTime time.Time, consumerChainID string, ibcSeqNum uint64, +) { // Prefix is in first byte expectedPrefix := []byte{GlobalSlashEntryBytePrefix} if prefix := bz[:1]; !bytes.Equal(prefix, expectedPrefix) { @@ -353,8 +353,8 @@ func MustParseGlobalSlashEntryKey(bz []byte) ( // ChainIdAndTsKey returns the key with the following format: // bytePrefix | len(chainID) | chainID | timestamp -func ChainIdAndTsKey(prefix byte, chainID string, timestamp time.Time) []byte { - partialKey := ChainIdWithLenKey(prefix, chainID) +func ChainIDAndTSKey(prefix byte, chainID string, timestamp time.Time) []byte { + partialKey := ChainIDWithLenKey(prefix, chainID) timeBz := sdk.FormatTimeBytes(timestamp) return ccvutils.AppendMany( // Append the partialKey @@ -364,30 +364,30 @@ func ChainIdAndTsKey(prefix byte, chainID string, timestamp time.Time) []byte { ) } -// ChainIdWithLenKey returns the key with the following format: +// ChainIDWithLenKey returns the key with the following format: // bytePrefix | len(chainID) | chainID -func ChainIdWithLenKey(prefix byte, chainID string) []byte { - chainIdL := len(chainID) +func ChainIDWithLenKey(prefix byte, chainID string) []byte { + chainIDL := len(chainID) return ccvutils.AppendMany( // Append the prefix []byte{prefix}, // Append the chainID length - sdk.Uint64ToBigEndian(uint64(chainIdL)), + sdk.Uint64ToBigEndian(uint64(chainIDL)), // Append the chainID []byte(chainID), ) } -// ParseChainIdAndTsKey returns the chain ID and time for a ChainIdAndTs key -func ParseChainIdAndTsKey(prefix byte, bz []byte) (string, time.Time, error) { +// ParseChainIDAndTSKey returns the chain ID and time for a ChainIDAndTS key +func ParseChainIDAndTSKey(prefix byte, bz []byte) (string, time.Time, error) { expectedPrefix := []byte{prefix} prefixL := len(expectedPrefix) if prefix := bz[:prefixL]; !bytes.Equal(prefix, expectedPrefix) { return "", time.Time{}, fmt.Errorf("invalid prefix; expected: %X, got: %X", expectedPrefix, prefix) } - chainIdL := sdk.BigEndianToUint64(bz[prefixL : prefixL+8]) - chainID := string(bz[prefixL+8 : prefixL+8+int(chainIdL)]) - timestamp, err := sdk.ParseTimeBytes(bz[prefixL+8+int(chainIdL):]) + chainIDL := sdk.BigEndianToUint64(bz[prefixL : prefixL+8]) + chainID := string(bz[prefixL+8 : prefixL+8+int(chainIDL)]) + timestamp, err := sdk.ParseTimeBytes(bz[prefixL+8+int(chainIDL):]) if err != nil { return "", time.Time{}, err } @@ -396,33 +396,33 @@ func ParseChainIdAndTsKey(prefix byte, bz []byte) (string, time.Time, error) { // ChainIdAndUintIdKey returns the key with the following format: // bytePrefix | len(chainID) | chainID | uint64(ID) -func ChainIdAndUintIdKey(prefix byte, chainID string, uintId uint64) []byte { - partialKey := ChainIdWithLenKey(prefix, chainID) +func ChainIDAndUintIDKey(prefix byte, chainID string, uintID uint64) []byte { + partialKey := ChainIDWithLenKey(prefix, chainID) return ccvutils.AppendMany( // Append the partialKey partialKey, // Append the uint id bytes - sdk.Uint64ToBigEndian(uintId), + sdk.Uint64ToBigEndian(uintID), ) } // ParseChainIdAndUintIdKey returns the chain ID and uint ID for a ChainIdAndUintId key -func ParseChainIdAndUintIdKey(prefix byte, bz []byte) (string, uint64, error) { +func ParseChainIDAndUintIDKey(prefix byte, bz []byte) (string, uint64, error) { expectedPrefix := []byte{prefix} prefixL := len(expectedPrefix) if prefix := bz[:prefixL]; !bytes.Equal(prefix, expectedPrefix) { return "", 0, fmt.Errorf("invalid prefix; expected: %X, got: %X", expectedPrefix, prefix) } - chainIdL := sdk.BigEndianToUint64(bz[prefixL : prefixL+8]) - chainID := string(bz[prefixL+8 : prefixL+8+int(chainIdL)]) - uintID := sdk.BigEndianToUint64(bz[prefixL+8+int(chainIdL):]) + chainIDL := sdk.BigEndianToUint64(bz[prefixL : prefixL+8]) + chainID := string(bz[prefixL+8 : prefixL+8+int(chainIDL)]) + uintID := sdk.BigEndianToUint64(bz[prefixL+8+int(chainIDL):]) return chainID, uintID, nil } // ChainIdAndConsAddrKey returns the key with the following format: // bytePrefix | len(chainID) | chainID | ConsAddress -func ChainIdAndConsAddrKey(prefix byte, chainID string, addr sdk.ConsAddress) []byte { - partialKey := ChainIdWithLenKey(prefix, chainID) +func ChainIDAndConsAddrKey(prefix byte, chainID string, addr sdk.ConsAddress) []byte { + partialKey := ChainIDWithLenKey(prefix, chainID) return ccvutils.AppendMany( // Append the partialKey partialKey, @@ -432,15 +432,15 @@ func ChainIdAndConsAddrKey(prefix byte, chainID string, addr sdk.ConsAddress) [] } // ParseChainIdAndConsAddrKey returns the chain ID and ConsAddress for a ChainIdAndConsAddrKey key -func ParseChainIdAndConsAddrKey(prefix byte, bz []byte) (string, sdk.ConsAddress, error) { +func ParseChainIDAndConsAddrKey(prefix byte, bz []byte) (string, sdk.ConsAddress, error) { expectedPrefix := []byte{prefix} prefixL := len(expectedPrefix) if prefix := bz[:prefixL]; !bytes.Equal(prefix, expectedPrefix) { return "", nil, fmt.Errorf("invalid prefix; expected: %X, got: %X", expectedPrefix, prefix) } - chainIdL := sdk.BigEndianToUint64(bz[prefixL : prefixL+8]) - chainID := string(bz[prefixL+8 : prefixL+8+int(chainIdL)]) - addr := bz[prefixL+8+int(chainIdL):] + chainIDL := sdk.BigEndianToUint64(bz[prefixL : prefixL+8]) + chainID := string(bz[prefixL+8 : prefixL+8+int(chainIDL)]) + addr := bz[prefixL+8+int(chainIDL):] return chainID, addr, nil } diff --git a/x/ccv/provider/types/keys_test.go b/x/ccv/provider/types/keys_test.go index 1ebc7213fe..b1113461b2 100644 --- a/x/ccv/provider/types/keys_test.go +++ b/x/ccv/provider/types/keys_test.go @@ -14,7 +14,6 @@ import ( // Tests that all singular keys, or prefixes to fully resolves keys are a single byte long, // preventing injection attacks into restricted parts of a full store. func TestSameLength(t *testing.T) { - keys := getSingleByteKeys() for _, keyByteArray := range keys { @@ -24,7 +23,6 @@ func TestSameLength(t *testing.T) { // Tests that all singular keys, or prefixes to fully resolves keys are non duplicate byte values. func TestNoDuplicates(t *testing.T) { - keys := getSingleByteKeys() for i, keyByteArray := range keys { @@ -36,13 +34,12 @@ func TestNoDuplicates(t *testing.T) { // Returns all singular keys, or prefixes to fully resolved keys, // any of which should be a single, unique byte. func getSingleByteKeys() [][]byte { - keys := make([][]byte, 32) i := 0 keys[i], i = providertypes.PortKey(), i+1 keys[i], i = providertypes.MaturedUnbondingOpsKey(), i+1 - keys[i], i = providertypes.ValidatorSetUpdateIdKey(), i+1 + keys[i], i = providertypes.ValidatorSetUpdateIDKey(), i+1 keys[i], i = providertypes.SlashMeterKey(), i+1 keys[i], i = providertypes.SlashMeterReplenishTimeCandidateKey(), i+1 keys[i], i = []byte{providertypes.ChainToChannelBytePrefix}, i+1 @@ -85,12 +82,12 @@ func TestChainIdAndTsKeyAndParse(t *testing.T) { } for _, test := range tests { - key := providertypes.ChainIdAndTsKey(test.prefix, test.chainID, test.timestamp) + key := providertypes.ChainIDAndTSKey(test.prefix, test.chainID, test.timestamp) require.NotEmpty(t, key) // Expected bytes = prefix + chainID length + chainID + time bytes expectedLen := 1 + 8 + len(test.chainID) + len(sdk.FormatTimeBytes(time.Time{})) require.Equal(t, expectedLen, len(key)) - parsedID, parsedTime, err := providertypes.ParseChainIdAndTsKey(test.prefix, key) + parsedID, parsedTime, err := providertypes.ParseChainIDAndTSKey(test.prefix, key) require.Equal(t, test.chainID, parsedID) require.Equal(t, test.timestamp.UTC(), parsedTime.UTC()) require.NoError(t, err) @@ -110,12 +107,12 @@ func TestChainIdAndUintIdAndParse(t *testing.T) { } for _, test := range tests { - key := providertypes.ChainIdAndUintIdKey(test.prefix, test.chainID, test.uintID) + key := providertypes.ChainIDAndUintIDKey(test.prefix, test.chainID, test.uintID) require.NotEmpty(t, key) // Expected bytes = prefix + chainID length + chainID + vscId bytes expectedLen := 1 + 8 + len(test.chainID) + 8 require.Equal(t, expectedLen, len(key)) - parsedChainID, parsedUintID, err := providertypes.ParseChainIdAndUintIdKey(test.prefix, key) + parsedChainID, parsedUintID, err := providertypes.ParseChainIDAndUintIDKey(test.prefix, key) require.Equal(t, test.chainID, parsedChainID) require.Equal(t, test.uintID, parsedUintID) require.NoError(t, err) @@ -196,12 +193,12 @@ func TestChainIdAndConsAddrAndParse(t *testing.T) { } for _, test := range tests { - key := providertypes.ChainIdAndConsAddrKey(test.prefix, test.chainID, test.addr) + key := providertypes.ChainIDAndConsAddrKey(test.prefix, test.chainID, test.addr) require.NotEmpty(t, key) // Expected bytes = prefix + chainID length + chainID + consAddr bytes expectedLen := 1 + 8 + len(test.chainID) + len(test.addr) require.Equal(t, expectedLen, len(key)) - parsedID, parsedConsAddr, err := providertypes.ParseChainIdAndConsAddrKey(test.prefix, key) + parsedID, parsedConsAddr, err := providertypes.ParseChainIDAndConsAddrKey(test.prefix, key) require.Equal(t, test.chainID, parsedID) require.Equal(t, test.addr, parsedConsAddr) require.NoError(t, err) @@ -210,7 +207,6 @@ func TestChainIdAndConsAddrAndParse(t *testing.T) { // Test key packing functions with the format func TestKeysWithPrefixAndId(t *testing.T) { - funcs := []func(string) []byte{ providertypes.ChainToChannelKey, providertypes.ChannelToChainKey, @@ -251,7 +247,6 @@ func TestKeysWithPrefixAndId(t *testing.T) { } func TestKeysWithUint64Payload(t *testing.T) { - funcs := []func(uint64) []byte{ providertypes.UnbondingOpKey, providertypes.ValsetUpdateBlockHeightKey, diff --git a/x/ccv/provider/types/msg.go b/x/ccv/provider/types/msg.go index 55c0bd40b5..ff0a6fce57 100644 --- a/x/ccv/provider/types/msg.go +++ b/x/ccv/provider/types/msg.go @@ -21,7 +21,8 @@ var ( // NewMsgAssignConsumerKey creates a new MsgAssignConsumerKey instance. // Delegator address and validator address are the same. func NewMsgAssignConsumerKey(chainID string, providerValidatorAddress sdk.ValAddress, - consumerConsensusPubKey cryptotypes.PubKey) (*MsgAssignConsumerKey, error) { + consumerConsensusPubKey cryptotypes.PubKey, +) (*MsgAssignConsumerKey, error) { var keyAsAny *codectypes.Any if consumerConsensusPubKey != nil { var err error @@ -37,10 +38,10 @@ func NewMsgAssignConsumerKey(chainID string, providerValidatorAddress sdk.ValAdd } // Route implements the sdk.Msg interface. -func (msg MsgAssignConsumerKey) Route() string { return RouterKey } +func (MsgAssignConsumerKey) Route() string { return RouterKey } // Type implements the sdk.Msg interface. -func (msg MsgAssignConsumerKey) Type() string { +func (MsgAssignConsumerKey) Type() string { return TypeMsgAssignConsumerKey } diff --git a/x/ccv/provider/types/params.go b/x/ccv/provider/types/params.go index eb7e47ba1d..0a37084bc3 100644 --- a/x/ccv/provider/types/params.go +++ b/x/ccv/provider/types/params.go @@ -81,7 +81,7 @@ func NewParams( // DefaultParams is the default params for the provider module func DefaultParams() Params { - // create default client state with chainID, trusting period, unbonding period, and inital height zeroed out. + // create default client state with chainID, trusting period, unbonding period, and initial height zeroed out. // these fields will be populated during proposal handler. return NewParams( ibctmtypes.NewClientState( @@ -152,7 +152,7 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { } } -func validateTemplateClient(i interface{}) error { +func validateTemplateClient(i any) error { cs, ok := i.(ibctmtypes.ClientState) if !ok { return fmt.Errorf("invalid parameter type: %T, expected: %T", i, ibctmtypes.ClientState{}) @@ -173,8 +173,6 @@ func validateTemplateClient(i interface{}) error { copiedClient.UnbondingPeriod = consumertypes.DefaultConsumerUnbondingPeriod copiedClient.LatestHeight = clienttypes.NewHeight(0, 1) - if err := copiedClient.Validate(); err != nil { - return err - } - return nil + err = copiedClient.Validate() + return err } diff --git a/x/ccv/provider/types/proposal.go b/x/ccv/provider/types/proposal.go index f5c702a322..3b02e42790 100644 --- a/x/ccv/provider/types/proposal.go +++ b/x/ccv/provider/types/proposal.go @@ -66,10 +66,10 @@ func (cccp *ConsumerAdditionProposal) GetTitle() string { return cccp.Title } func (cccp *ConsumerAdditionProposal) GetDescription() string { return cccp.Description } // ProposalRoute returns the routing key of a consumer addition proposal. -func (cccp *ConsumerAdditionProposal) ProposalRoute() string { return RouterKey } +func (*ConsumerAdditionProposal) ProposalRoute() string { return RouterKey } // ProposalType returns the type of a consumer addition proposal. -func (cccp *ConsumerAdditionProposal) ProposalType() string { +func (*ConsumerAdditionProposal) ProposalType() string { return ProposalTypeConsumerAddition } @@ -167,10 +167,10 @@ func NewConsumerRemovalProposal(title, description, chainID string, stopTime tim } // ProposalRoute returns the routing key of a consumer removal proposal. -func (sccp *ConsumerRemovalProposal) ProposalRoute() string { return RouterKey } +func (*ConsumerRemovalProposal) ProposalRoute() string { return RouterKey } // ProposalType returns the type of a consumer removal proposal. -func (sccp *ConsumerRemovalProposal) ProposalType() string { return ProposalTypeConsumerRemoval } +func (*ConsumerRemovalProposal) ProposalType() string { return ProposalTypeConsumerRemoval } // ValidateBasic runs basic stateless validity checks func (sccp *ConsumerRemovalProposal) ValidateBasic() error { @@ -198,10 +198,10 @@ func NewEquivocationProposal(title, description string, equivocations []*evidenc } // ProposalRoute returns the routing key of an equivocation proposal. -func (sp *EquivocationProposal) ProposalRoute() string { return RouterKey } +func (*EquivocationProposal) ProposalRoute() string { return RouterKey } // ProposalType returns the type of a equivocation proposal. -func (sp *EquivocationProposal) ProposalType() string { +func (*EquivocationProposal) ProposalType() string { return ProposalTypeEquivocation } diff --git a/x/ccv/provider/types/proposal_test.go b/x/ccv/provider/types/proposal_test.go index a1ff43fa9b..6d6bf3ea08 100644 --- a/x/ccv/provider/types/proposal_test.go +++ b/x/ccv/provider/types/proposal_test.go @@ -7,7 +7,7 @@ import ( evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" - "github.com/golang/protobuf/proto" //nolint - see: https://github.com/cosmos/interchain-security/issues/236 + "github.com/golang/protobuf/proto" //nolint:staticcheck // see: https://github.com/cosmos/interchain-security/issues/236 "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/codec" @@ -193,7 +193,6 @@ func TestConsumerAdditionProposalValidateBasic(t *testing.T) { } for _, tc := range testCases { - err := tc.proposal.ValidateBasic() if tc.expPass { require.NoError(t, err, "valid case: %s should not return error. got %w", tc.name, err) diff --git a/x/ccv/provider/types/throttle.go b/x/ccv/provider/types/throttle.go index 9ddd7bbc7c..70a3bb49e2 100644 --- a/x/ccv/provider/types/throttle.go +++ b/x/ccv/provider/types/throttle.go @@ -6,7 +6,8 @@ import ( // NewGlobalSlashEntry creates a new GlobalSlashEntry. func NewGlobalSlashEntry(recvTime time.Time, consumerChainID string, - ibcSeqNum uint64, providerValConsAddr ProviderConsAddress) GlobalSlashEntry { + ibcSeqNum uint64, providerValConsAddr ProviderConsAddress, +) GlobalSlashEntry { return GlobalSlashEntry{ RecvTime: recvTime.UTC(), // UTC prevents serialization inconsistencies ConsumerChainID: consumerChainID, diff --git a/x/ccv/types/ccv.go b/x/ccv/types/ccv.go index a87c4bd64f..316a769714 100644 --- a/x/ccv/types/ccv.go +++ b/x/ccv/types/ccv.go @@ -8,11 +8,11 @@ import ( abci "github.com/tendermint/tendermint/abci/types" ) -func NewValidatorSetChangePacketData(valUpdates []abci.ValidatorUpdate, valUpdateID uint64, SlashAcks []string) ValidatorSetChangePacketData { +func NewValidatorSetChangePacketData(valUpdates []abci.ValidatorUpdate, valUpdateID uint64, slashAcks []string) ValidatorSetChangePacketData { return ValidatorSetChangePacketData{ ValidatorUpdates: valUpdates, ValsetUpdateId: valUpdateID, - SlashAcks: SlashAcks, + SlashAcks: slashAcks, } } @@ -51,10 +51,10 @@ func (mat VSCMaturedPacketData) GetBytes() []byte { return bytes } -func NewSlashPacketData(validator abci.Validator, valUpdateId uint64, infractionType stakingtypes.InfractionType) *SlashPacketData { +func NewSlashPacketData(validator abci.Validator, valUpdateID uint64, infractionType stakingtypes.InfractionType) *SlashPacketData { return &SlashPacketData{ Validator: validator, - ValsetUpdateId: valUpdateId, + ValsetUpdateId: valUpdateID, Infraction: infractionType, } } @@ -96,7 +96,7 @@ func (cp ConsumerPacketData) ValidateBasic() (err error) { err = fmt.Errorf("invalid consumer packet type: %q", cp.Type) } - return + return err } func (cp ConsumerPacketData) GetBytes() []byte { diff --git a/x/ccv/types/codec.go b/x/ccv/types/codec.go index d2815ae9b7..31ff819205 100644 --- a/x/ccv/types/codec.go +++ b/x/ccv/types/codec.go @@ -7,12 +7,12 @@ import ( // RegisterLegacyAminoCodec registers the necessary x/ibc transfer interfaces and concrete types // on the provided LegacyAmino codec. These types are used for Amino JSON serialization. -func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { +func RegisterLegacyAminoCodec(_ *codec.LegacyAmino) { } // RegisterInterfaces register the ibc transfer module interfaces to protobuf // Any. -func RegisterInterfaces(registry codectypes.InterfaceRegistry) { +func RegisterInterfaces(_ codectypes.InterfaceRegistry) { } var ( diff --git a/x/ccv/types/errors.go b/x/ccv/types/errors.go index 7b67a02d60..8c39388cda 100644 --- a/x/ccv/types/errors.go +++ b/x/ccv/types/errors.go @@ -15,7 +15,7 @@ var ( ErrInvalidStatus = sdkerrors.Register(ModuleName, 8, "invalid channel status") ErrInvalidGenesis = sdkerrors.Register(ModuleName, 9, "invalid genesis state") ErrDuplicateChannel = sdkerrors.Register(ModuleName, 10, "CCV channel already exists") - ErrInvalidVSCMaturedId = sdkerrors.Register(ModuleName, 11, "invalid vscId for VSC packet") + ErrInvalidVSCMaturedID = sdkerrors.Register(ModuleName, 11, "invalid vscId for VSC packet") ErrInvalidVSCMaturedTime = sdkerrors.Register(ModuleName, 12, "invalid maturity time for VSC packet") ErrInvalidConsumerState = sdkerrors.Register(ModuleName, 13, "provider chain has invalid state for consumer chain") ErrInvalidConsumerClient = sdkerrors.Register(ModuleName, 14, "ccv channel is not built on correct client") diff --git a/x/ccv/types/shared_params.go b/x/ccv/types/shared_params.go index 95ef5e850f..e6b650beea 100644 --- a/x/ccv/types/shared_params.go +++ b/x/ccv/types/shared_params.go @@ -13,11 +13,9 @@ const ( DefaultCCVTimeoutPeriod = 4 * 7 * 24 * time.Hour ) -var ( - KeyCCVTimeoutPeriod = []byte("CcvTimeoutPeriod") -) +var KeyCCVTimeoutPeriod = []byte("CcvTimeoutPeriod") -func ValidateDuration(i interface{}) error { +func ValidateDuration(i any) error { period, ok := i.(time.Duration) if !ok { return fmt.Errorf("invalid parameter type: %T", i) @@ -28,21 +26,21 @@ func ValidateDuration(i interface{}) error { return nil } -func ValidateBool(i interface{}) error { +func ValidateBool(i any) error { if _, ok := i.(bool); !ok { return fmt.Errorf("invalid parameter type: %T", i) } return nil } -func ValidateInt64(i interface{}) error { +func ValidateInt64(i any) error { if _, ok := i.(int64); !ok { return fmt.Errorf("invalid parameter type: %T", i) } return nil } -func ValidatePositiveInt64(i interface{}) error { +func ValidatePositiveInt64(i any) error { if err := ValidateInt64(i); err != nil { return err } @@ -52,14 +50,14 @@ func ValidatePositiveInt64(i interface{}) error { return nil } -func ValidateString(i interface{}) error { +func ValidateString(i any) error { if _, ok := i.(string); !ok { return fmt.Errorf("invalid parameter type: %T", i) } return nil } -func ValidateChannelIdentifier(i interface{}) error { +func ValidateChannelIdentifier(i any) error { value, ok := i.(string) if !ok { return fmt.Errorf("invalid parameter type: %T", i) @@ -67,7 +65,7 @@ func ValidateChannelIdentifier(i interface{}) error { return ibchost.ChannelIdentifierValidator(value) } -func ValidateBech32(i interface{}) error { +func ValidateBech32(i any) error { value, ok := i.(string) if !ok { return fmt.Errorf("invalid parameter type: %T", i) @@ -76,7 +74,7 @@ func ValidateBech32(i interface{}) error { return err } -func ValidateStringFraction(i interface{}) error { +func ValidateStringFraction(i any) error { str, ok := i.(string) if !ok { return fmt.Errorf("invalid parameter type: %T", i) diff --git a/x/ccv/utils/utils.go b/x/ccv/utils/utils.go index 96019f4310..0d21a95682 100644 --- a/x/ccv/utils/utils.go +++ b/x/ccv/utils/utils.go @@ -101,7 +101,7 @@ func AppendMany(byteses ...[]byte) (out []byte) { return out } -func PanicIfZeroOrNil(x interface{}, nameForPanicMsg string) { +func PanicIfZeroOrNil(x any, nameForPanicMsg string) { if x == nil || reflect.ValueOf(x).IsZero() { panic("zero or nil value for " + nameForPanicMsg) }