From 6a65f9c62cf0c6b434349238c77f7308bfcda7b7 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Mon, 20 May 2024 02:59:51 +0800 Subject: [PATCH 1/3] chore: update go (#4157) --- Dockerfile | 2 +- changelog.md | 1 + go.mod | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 916a40b451..9617fa193b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ ## prep the base image. # -FROM golang:1.21.5 as base +FROM golang as base RUN apt update && \ apt-get install -y \ diff --git a/changelog.md b/changelog.md index b527cfcaea..cf8cca8401 100644 --- a/changelog.md +++ b/changelog.md @@ -21,6 +21,7 @@ ### Changes +- [#4157](https://github.com/ignite/cli/pull/4157) Upgrade golang to 1.22 - [#4094](https://github.com/ignite/cli/pull/4094) Scaffolding a multi-index map using `ignite s map foo bar baz --index foobar,foobaz` is no longer supported. Use one index instead of use `collections.IndexedMap`. - [#4058](https://github.com/ignite/cli/pull/4058) Simplify scaffolded modules by including `ValidateBasic()` logic in message handler. - [#4058](https://github.com/ignite/cli/pull/4058) Use `address.Codec` instead of `AccAddressFromBech32`. diff --git a/go.mod b/go.mod index f61028efdc..18832c9935 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ module github.com/ignite/cli/v29 -go 1.21.1 +go 1.22 -toolchain go1.21.3 +toolchain go1.22.2 replace ( github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 From 6f8df69083317286f3525df9fae649608502d70e Mon Sep 17 00:00:00 2001 From: Danilo Pantani Date: Sun, 19 May 2024 22:00:17 +0200 Subject: [PATCH 2/3] feat(internal/tools): improve config doc (#4155) --- docs/docs/08-references/03-config.md | 89 +++++++++++++++++ ignite/config/chain/base/config.go | 98 +++++++++---------- ignite/config/chain/v0/config.go | 10 +- ignite/config/chain/v1/config.go | 2 +- ignite/config/chain/v1/validator.go | 86 ++++++++-------- .../internal/tools/gen-config-doc/cmd/root.go | 2 +- ignite/internal/tools/gen-config-doc/go.mod | 3 +- ignite/internal/tools/gen-config-doc/go.sum | 6 +- .../templates/doc/files/{{Name}}.plush | 10 ++ ignite/pkg/clidoc/struct.go | 35 ++++--- ignite/pkg/clidoc/struct_test.go | 10 +- scripts/gen-config-doc | 7 +- 12 files changed, 232 insertions(+), 126 deletions(-) create mode 100644 docs/docs/08-references/03-config.md mode change 100644 => 100755 scripts/gen-config-doc diff --git a/docs/docs/08-references/03-config.md b/docs/docs/08-references/03-config.md new file mode 100644 index 0000000000..d436e979b2 --- /dev/null +++ b/docs/docs/08-references/03-config.md @@ -0,0 +1,89 @@ +--- +sidebar_position: 4 +description: Configuration file example. +title: Configuration file example +--- + +## Configuration file example + +```yaml title="config.yml" +validation: (string) # Specifies the type of validation the blockchain uses (e.g., sovereign). +version: (uint) # Defines the configuration version number. +build: # Contains build configuration options. + main: (string) # Path to the main build file. + binary: (string) # Path to the binary file. + ldflags: (string list) # List of custom linker flags for building the binary. + proto: # Contains proto build configuration options. + path: (string) # Relative path where the application's proto files are located. + third_party_paths: (string list) # Relative paths to third-party proto files used by the application. +accounts: (list) # Lists the options for setting up Cosmos Accounts. + name: (string) # Local name associated with the Account's key pair. + coins: (string list) # List of token balances for the account. + mnemonic: (string) # Mnemonic phrase for the account. + address: (string) # Address of the account. + cointype: (string) # Coin type number for HD derivation (default is 118). + account_number: (string) # Account number for HD derivation (must be ≤ 2147483647). + address_index: (string) # Address index number for HD derivation (must be ≤ 2147483647). +faucet: # Configuration for the faucet. + name: (string) # Name of the faucet account. + coins: (string list) # Types and amounts of coins the faucet distributes. + coins_max: (string list) # Maximum amounts of coins that can be transferred to a single user. + rate_limit_window: (string) # Timeframe after which the limit will be refreshed. + host: (string) # Host address of the faucet server. + port: (uint) # Port number for the faucet server. +client: # Configures client code generation. + typescript: # Relative path where the application's Typescript files are located. + path: (string) # Relative path where the application's Typescript files are located. + composables: # Configures Vue 3 composables code generation. + path: (string) # Relative path where the application's composable files are located. + hooks: # Configures React hooks code generation. + path: (string) # Relative path where the application's hooks files are located. + openapi: # Configures OpenAPI spec generation for the API. + path: (string) # Relative path where the application's OpenAPI files are located. +genesis: (key/value) # Custom genesis block modifications. Follow the nesting of the genesis file here to access all the parameters. +minimal: (bool) # Indicates if the blockchain is minimal with the required Cosmos SDK modules. +validators: (list) # Contains information related to the list of validators and settings. + name: (string) # Name of the validator. + bonded: (string) # Amount staked by the validator. + app: (key/value) # Overwrites the appd's config/app.toml configurations. + config: (key/value) # Overwrites the appd's config/config.toml configurations. + client: (key/value) # Overwrites the appd's config/client.toml configurations. + home: (string) # Overwrites the default home directory used for the application. + gentx: # Overwrites the appd's config/gentx.toml configurations. + amount: (string) # Amount for the current Gentx. + moniker: (string) # Optional moniker for the validator. + home: (string) # Directory for configuration and data. + keyring-backend: (string) # Backend for the keyring. + chain-id: (string) # Network chain ID. + commission-max-change-rate: (string) # Maximum commission change rate percentage per day. + commission-max-rate: (string) # Maximum commission rate percentage (e.g., 0.01 = 1%). + commission-rate: (string) # Initial commission rate percentage (e.g., 0.01 = 1%). + details: (string) # Optional details about the validator. + security-contact: (string) # Optional security contact email for the validator. + website: (string) # Optional website for the validator. + account-number: (int) # Account number of the signing account (offline mode only). + broadcast-mode: (string) # Transaction broadcasting mode (sync|async|block) (default is 'sync'). + dry-run: (bool) # Simulates the transaction without actually performing it, ignoring the --gas flag. + fee-account: (string) # Account that pays the transaction fees instead of the signer. + fee: (string) # Fee to pay with the transaction (e.g.: 10uatom). + from: (string) # Name or address of the private key used to sign the transaction. + gas: (string) # Gas limit per transaction; set to 'auto' to calculate sufficient gas automatically (default is 200000). + gas-adjustment: (string) # Factor to multiply against the estimated gas (default is 1). + gas-prices: (string) # Gas prices in decimal format to determine the transaction fee (e.g., 0.1uatom). + generate-only: (bool) # Creates an unsigned transaction and writes it to STDOUT. + identity: (string) # Identity signature (e.g., UPort or Keybase). + ip: (string) # Node's public IP address (default is '192.168.1.64'). + keyring-dir: (string) # Directory for the client keyring; defaults to the 'home' directory if omitted. + ledger: (bool) # Uses a connected Ledger device if true. + min-self-delegation: (string) # Minimum self-delegation required for the validator. + node: (string) # <host>:<port> for the Tendermint RPC interface (default 'tcp://localhost:26657') + node-id: (string) # Node's NodeID + note: (string) # Adds a description to the transaction (formerly --memo). + offline: (bool) # Operates in offline mode, disallowing any online functionality. + output: (string) # Output format (text|json) (default 'json'). + output-document: (string) # Writes the genesis transaction JSON document to the specified file instead of the default location. + pubkey: (string) # Protobuf JSON encoded public key of the validator. + sequence: (uint) # Sequence number of the signing account (offline mode only). + sign-mode: (string) # Chooses sign mode (direct|amino-json), an advanced feature. + timeout-height: (uint) # Sets a block timeout height to prevent the transaction from being committed past a certain height. +``` \ No newline at end of file diff --git a/ignite/config/chain/base/config.go b/ignite/config/chain/base/config.go index de10fa873d..0473307e88 100644 --- a/ignite/config/chain/base/config.go +++ b/ignite/config/chain/base/config.go @@ -10,123 +10,115 @@ import ( // Account holds the options related to setting up Cosmos wallets. type Account struct { - Name string `yaml:"name" doc:"local name of a key pair associated with an account"` - Coins []string `yaml:"coins,omitempty" doc:"list of token balances for the account"` - Mnemonic string `yaml:"mnemonic,omitempty" doc:"account mnemonic"` - Address string `yaml:"address,omitempty" doc:"account address"` - CoinType string `yaml:"cointype,omitempty" doc:"coin type number for HD derivation (default 118)"` - AccountNumber string `yaml:"account_number,omitempty" doc:"account number for HD derivation (less than equal 2147483647)"` - AddressIndex string `yaml:"address_index,omitempty" doc:"address index number for HD derivation (less than equal 2147483647)"` + Name string `yaml:"name" doc:"Local name associated with the Account's key pair."` + Coins []string `yaml:"coins,omitempty" doc:"List of token balances for the account."` + Mnemonic string `yaml:"mnemonic,omitempty" doc:"Mnemonic phrase for the account."` + Address string `yaml:"address,omitempty" doc:"Address of the account."` + CoinType string `yaml:"cointype,omitempty" doc:"Coin type number for HD derivation (default is 118)."` + AccountNumber string `yaml:"account_number,omitempty" doc:"Account number for HD derivation (must be ≤ 2147483647)."` + AddressIndex string `yaml:"address_index,omitempty" doc:"Address index number for HD derivation (must be ≤ 2147483647)."` } // Build holds build configs. type Build struct { - Main string `yaml:"main,omitempty" doc:"build main path"` - Binary string `yaml:"binary,omitempty" doc:"binary path"` - LDFlags []string `yaml:"ldflags,omitempty" doc:"custom build ld flags"` - Proto Proto `yaml:"proto" doc:"holds proto build configs"` + Main string `yaml:"main,omitempty" doc:"Path to the main build file."` + Binary string `yaml:"binary,omitempty" doc:"Path to the binary file."` + LDFlags []string `yaml:"ldflags,omitempty" doc:"List of custom linker flags for building the binary."` + Proto Proto `yaml:"proto" doc:"Contains proto build configuration options."` } // Proto holds proto build configs. type Proto struct { // Path is the relative path of where app's proto files are located at. - Path string `yaml:"path" doc:"relative path of where app's proto files are located at"` + Path string `yaml:"path" doc:"Relative path where the application's proto files are located."` // ThirdPartyPath is the relative path of where the third party proto files are // located that used by the app. - ThirdPartyPaths []string `yaml:"third_party_paths" doc:"relative path of where the third party proto files are located that used by the app"` + ThirdPartyPaths []string `yaml:"third_party_paths" doc:"Relative paths to third-party proto files used by the application."` } // Client configures code generation for clients. type Client struct { // TSClient configures code generation for Typescript Client. - Typescript Typescript `yaml:"typescript,omitempty" doc:"configures code generation for Typescript Client"` + Typescript Typescript `yaml:"typescript,omitempty" doc:"Relative path where the application's Typescript files are located."` // Composables configures code generation for Vue 3 composables. - Composables Composables `yaml:"composables,omitempty" doc:"configures code generation for Vue 3 composables"` + Composables Composables `yaml:"composables,omitempty" doc:"Configures Vue 3 composables code generation."` // Hooks configures code generation for React hooks. - Hooks Hooks `yaml:"hooks,omitempty" doc:"configures code generation for React hooks"` + Hooks Hooks `yaml:"hooks,omitempty" doc:"Configures React hooks code generation."` // OpenAPI configures OpenAPI spec generation for API. - OpenAPI OpenAPI `yaml:"openapi,omitempty" doc:"configures OpenAPI spec generation for API"` + OpenAPI OpenAPI `yaml:"openapi,omitempty" doc:"Configures OpenAPI spec generation for the API."` } // Typescript configures code generation for Typescript Client. type Typescript struct { // Path configures out location for generated Typescript Client code. - Path string `yaml:"path" doc:"relative path of where app's typescript files are located at"` -} - -// Vuex configures code generation for Vuex stores. -// -// Deprecated: Will be removed eventually. -type Vuex struct { - // Path configures out location for generated Vuex stores code. - Path string `yaml:"path" doc:"relative path of where app's vuex files are located at"` + Path string `yaml:"path" doc:"Relative path where the application's Typescript files are located."` } // Composables configures code generation for vue-query hooks. type Composables struct { // Path configures out location for generated vue-query hooks. - Path string `yaml:"path" doc:"relative path of where app's composable files are located at"` + Path string `yaml:"path" doc:"Relative path where the application's composable files are located."` } // Hooks configures code generation for react-query hooks. type Hooks struct { // Path configures out location for generated vue-query hooks. - Path string `yaml:"path" doc:"relative path of where app's hooks are located at"` + Path string `yaml:"path" doc:"Relative path where the application's hooks files are located."` } // OpenAPI configures OpenAPI spec generation for API. type OpenAPI struct { - Path string `yaml:"path" doc:"relative path of where app's openapi files are located at"` + Path string `yaml:"path" doc:"Relative path where the application's OpenAPI files are located."` } // Faucet configuration. type Faucet struct { // Name is faucet account's name. - Name *string `yaml:"name" doc:"faucet account's name"` + Name *string `yaml:"name" doc:"Name of the faucet account."` // Coins holds type of coin denoms and amounts to distribute. - Coins []string `yaml:"coins" doc:"holds type of coin denoms and amounts to distribute"` + Coins []string `yaml:"coins" doc:"Types and amounts of coins the faucet distributes."` // CoinsMax holds of chain denoms and their max amounts that can be transferred to single user. - CoinsMax []string `yaml:"coins_max,omitempty" doc:"holds of chain denoms and their max amounts that can be transferred to single user"` + CoinsMax []string `yaml:"coins_max,omitempty" doc:"Maximum amounts of coins that can be transferred to a single user."` // LimitRefreshTime sets the timeframe at the end of which the limit will be refreshed. - RateLimitWindow string `yaml:"rate_limit_window,omitempty" doc:"sets the timeframe at the end of which the limit will be refreshed"` + RateLimitWindow string `yaml:"rate_limit_window,omitempty" doc:"Timeframe after which the limit will be refreshed."` // Host is the host of the faucet server. - Host string `yaml:"host,omitempty" doc:"the host of the faucet server"` + Host string `yaml:"host,omitempty" doc:"Host address of the faucet server."` // Port number for faucet server to listen at. - Port uint `yaml:"port,omitempty" doc:"number for faucet server to listen at"` + Port uint `yaml:"port,omitempty" doc:"Port number for the faucet server."` } // Init overwrites sdk configurations with given values. type Init struct { // App overwrites appd's config/app.toml configs. - App xyaml.Map `yaml:"app" doc:"overwrites appd's config/app.toml configs"` + App xyaml.Map `yaml:"app" doc:"Overwrites the appd's config/app.toml configurations."` // Client overwrites appd's config/client.toml configs. - Client xyaml.Map `yaml:"client" doc:"overwrites appd's config/client.toml configs"` + Client xyaml.Map `yaml:"client" doc:"Overwrites the appd's config/client.toml configurations."` // Config overwrites appd's config/config.toml configs. - Config xyaml.Map `yaml:"config" doc:"overwrites appd's config/config.toml configs"` + Config xyaml.Map `yaml:"config" doc:"Overwrites the appd's config/config.toml configurations."` // Home overwrites default home directory used for the app. - Home string `yaml:"home" doc:"overwrites default home directory used for the app"` + Home string `yaml:"home" doc:"Overwrites the default home directory used for the application."` } // Host keeps configuration related to started servers. type Host struct { - RPC string `yaml:"rpc" doc:"RPC server address"` - P2P string `yaml:"p2p" doc:"P2P server address"` - Prof string `yaml:"prof" doc:"Profiling server address"` - GRPC string `yaml:"grpc" doc:"GRPC server address"` - GRPCWeb string `yaml:"grpc-web" doc:"GRPC Web server address"` - API string `yaml:"api" doc:"API server address"` + RPC string `yaml:"rpc" doc:"RPC server address."` + P2P string `yaml:"p2p" doc:"P2P server address."` + Prof string `yaml:"prof" doc:"Profiling server address."` + GRPC string `yaml:"grpc" doc:"GRPC server address."` + GRPCWeb string `yaml:"grpc-web" doc:"GRPC Web server address."` + API string `yaml:"api" doc:"API server address."` } // Validation describes the kind of validation the chain has. @@ -144,14 +136,14 @@ const ( // Config defines a struct with the fields that are common to all config versions. type Config struct { - Validation Validation `yaml:"validation,omitempty" doc:"describes the kind of validation the chain has"` - Version version.Version `yaml:"version" doc:"defines the type for the config version number"` - Build Build `yaml:"build,omitempty" doc:"holds build configs"` - Accounts []Account `yaml:"accounts" doc:"holds the options related to setting up Cosmos wallets"` - Faucet Faucet `yaml:"faucet,omitempty" doc:"faucet configuration"` - Client Client `yaml:"client,omitempty" doc:"configures code generation for clients"` - Genesis xyaml.Map `yaml:"genesis,omitempty" doc:"custom genesis modifications"` - Minimal bool `yaml:"minimal,omitempty" doc:"minimal blockchain with the minimum required Cosmos SDK modules"` + Validation Validation `yaml:"validation,omitempty" doc:"Specifies the type of validation the blockchain uses (e.g., sovereign)."` + Version version.Version `yaml:"version" doc:"Defines the configuration version number."` + Build Build `yaml:"build,omitempty" doc:"Contains build configuration options."` + Accounts []Account `yaml:"accounts" doc:"Lists the options for setting up Cosmos Accounts."` + Faucet Faucet `yaml:"faucet,omitempty" doc:"Configuration for the faucet."` + Client Client `yaml:"client,omitempty" doc:"Configures client code generation."` + Genesis xyaml.Map `yaml:"genesis,omitempty" doc:"Custom genesis block modifications. Follow the nesting of the genesis file here to access all the parameters."` + Minimal bool `yaml:"minimal,omitempty" doc:"Indicates if the blockchain is minimal with the required Cosmos SDK modules."` } // GetVersion returns the config version. diff --git a/ignite/config/chain/v0/config.go b/ignite/config/chain/v0/config.go index ffed30ee4f..02c5364057 100644 --- a/ignite/config/chain/v0/config.go +++ b/ignite/config/chain/v0/config.go @@ -14,9 +14,9 @@ import ( type Config struct { base.Config `yaml:",inline"` - Validator Validator `yaml:"validator" doc:"holds info related to validator settings"` - Init base.Init `yaml:"init" doc:"overwrites sdk configurations with given values"` - Host base.Host `yaml:"host" doc:"keeps configuration related to started servers"` + Validator Validator `yaml:"validator" doc:"Contains information related to the validator and settings."` + Init base.Init `yaml:"init" doc:"Overwrites the appd's config/config.toml configurations."` + Host base.Host `yaml:"host" doc:"Keeps configuration related to started servers."` } // Clone returns an identical copy of the instance. @@ -32,6 +32,6 @@ func (c *Config) Decode(r io.Reader) error { // Validator holds info related to validator settings. type Validator struct { - Name string `yaml:"name" doc:"name of the validator"` - Staked string `yaml:"staked" doc:"how much the validator has staked"` + Name string `yaml:"name" doc:"Name of the validator."` + Staked string `yaml:"staked" doc:"Amount staked by the validator."` } diff --git a/ignite/config/chain/v1/config.go b/ignite/config/chain/v1/config.go index 2afe32ec59..2960d4b826 100644 --- a/ignite/config/chain/v1/config.go +++ b/ignite/config/chain/v1/config.go @@ -23,7 +23,7 @@ func DefaultConfig() *Config { type Config struct { base.Config `yaml:",inline"` - Validators []Validator `yaml:"validators" doc:"holds info related to validator list settings"` + Validators []Validator `yaml:"validators" doc:"Contains information related to the list of validators and settings."` } func (c *Config) SetDefaults() error { diff --git a/ignite/config/chain/v1/validator.go b/ignite/config/chain/v1/validator.go index 39bb3a488f..9ee1e51103 100644 --- a/ignite/config/chain/v1/validator.go +++ b/ignite/config/chain/v1/validator.go @@ -7,134 +7,134 @@ import ( // Validator holds info related to validator settings. type Validator struct { // Name is the name of the validator. - Name string `yaml:"name" doc:"name of the validator"` + Name string `yaml:"name" doc:"Name of the validator."` // Bonded is how much the validator has staked. - Bonded string `yaml:"bonded" doc:"how much the validator has staked"` + Bonded string `yaml:"bonded" doc:"Amount staked by the validator."` // App overwrites appd's config/app.toml configs. - App xyaml.Map `yaml:"app,omitempty" doc:"overwrites appd's config/app.toml configs"` + App xyaml.Map `yaml:"app,omitempty" doc:"Overwrites the appd's config/app.toml configurations."` // Config overwrites appd's config/config.toml configs. - Config xyaml.Map `yaml:"config,omitempty" doc:"overwrites appd's config/config.toml configs"` + Config xyaml.Map `yaml:"config,omitempty" doc:"Overwrites the appd's config/config.toml configurations."` // Client overwrites appd's config/client.toml configs. - Client xyaml.Map `yaml:"client,omitempty" doc:"overwrites appd's config/client.toml configs"` + Client xyaml.Map `yaml:"client,omitempty" doc:"Overwrites the appd's config/client.toml configurations."` // Home overwrites default home directory used for the app. - Home string `yaml:"home,omitempty" doc:"overwrites default home directory used for the app"` + Home string `yaml:"home,omitempty" doc:"Overwrites the default home directory used for the application."` // Gentx overwrites appd's config/gentx.toml configs. - Gentx *Gentx `yaml:"gentx,omitempty" doc:"overwrites appd's config/gentx.toml configs"` + Gentx *Gentx `yaml:"gentx,omitempty" doc:"Overwrites the appd's config/gentx.toml configurations."` } // Gentx holds info related to Gentx settings. type Gentx struct { // Amount is the amount for the current Gentx. - Amount string `yaml:"amount" doc:"the amount for the current Gentx"` + Amount string `yaml:"amount" doc:"Amount for the current Gentx."` // Moniker is the validator's (optional) moniker. - Moniker string `yaml:"moniker" doc:"the validator's (optional) moniker"` + Moniker string `yaml:"moniker" doc:"Optional moniker for the validator."` // Home is directory for config and data. - Home string `yaml:"home" doc:"directory for config and data"` + Home string `yaml:"home" doc:"Directory for configuration and data."` // KeyringBackend is keyring's backend. - KeyringBackend string `yaml:"keyring-backend" doc:"keyring's backend"` + KeyringBackend string `yaml:"keyring-backend" doc:"Backend for the keyring."` // ChainID is the network chain ID. - ChainID string `yaml:"chain-id" doc:"network chain ID"` + ChainID string `yaml:"chain-id" doc:"Network chain ID."` // CommissionMaxChangeRate is the maximum commission change rate percentage (per day). - CommissionMaxChangeRate string `yaml:"commission-max-change-rate" doc:"maximum commission change rate percentage (per day)"` + CommissionMaxChangeRate string `yaml:"commission-max-change-rate" doc:"Maximum commission change rate percentage per day."` // CommissionMaxRate is the maximum commission rate percentage. - CommissionMaxRate string `yaml:"commission-max-rate" doc:"maximum commission rate percentage"` + CommissionMaxRate string `yaml:"commission-max-rate" doc:"Maximum commission rate percentage (e.g., 0.01 = 1%)."` // CommissionRate is the initial commission rate percentage. - CommissionRate string `yaml:"commission-rate" doc:"initial commission rate percentage"` + CommissionRate string `yaml:"commission-rate" doc:"Initial commission rate percentage (e.g., 0.01 = 1%)."` // Details is the validator's (optional) details. - Details string `yaml:"details" doc:"validator's (optional) details"` + Details string `yaml:"details" doc:"Optional details about the validator."` // SecurityContact is the validator's (optional) security contact email. - SecurityContact string `yaml:"security-contact" doc:"validator's (optional) security contact email"` + SecurityContact string `yaml:"security-contact" doc:"Optional security contact email for the validator."` // Website is the validator's (optional) website. - Website string `yaml:"website" doc:"validator's (optional) website"` + Website string `yaml:"website" doc:"Optional website for the validator."` // AccountNumber is the account number of the signing account (offline mode only). - AccountNumber int `yaml:"account-number" doc:"account number of the signing account (offline mode only)"` + AccountNumber int `yaml:"account-number" doc:"Account number of the signing account (offline mode only)."` // BroadcastMode is the transaction broadcasting mode (sync|async|block) (default "sync"). - BroadcastMode string `yaml:"broadcast-mode" doc:"transaction broadcasting mode (sync|async|block) (default 'sync')"` + BroadcastMode string `yaml:"broadcast-mode" doc:"Transaction broadcasting mode (sync|async|block) (default is 'sync')."` // DryRun is a boolean determining whether to ignore the --gas flag and perform a simulation of a transaction. - DryRun bool `yaml:"dry-run" doc:"boolean determining whether to ignore the --gas flag and perform a simulation of a transaction"` + DryRun bool `yaml:"dry-run" doc:"Simulates the transaction without actually performing it, ignoring the --gas flag."` // FeeAccount is the fee account pays fees for the transaction instead of deducting from the signer. - FeeAccount string `yaml:"fee-account" doc:"fee account pays fees for the transaction instead of deducting from the signer"` + FeeAccount string `yaml:"fee-account" doc:"Account that pays the transaction fees instead of the signer."` // Fee is the fee to pay along with transaction; eg: 10uatom. - Fee string `yaml:"fee" doc:"fee to pay along with transaction; eg: 10uatom"` + Fee string `yaml:"fee" doc:"Fee to pay with the transaction (e.g.: 10uatom)."` // From is the name or address of private key with which to sign. - From string `yaml:"from" doc:"name or address of private key with which to sign"` + From string `yaml:"from" doc:"Name or address of the private key used to sign the transaction."` // From is the gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically (default 200000). - Gas string `yaml:"gas" doc:"gas limit to set per-transaction; set to 'auto' to calculate sufficient gas automatically (default 200000)"` + Gas string `yaml:"gas" doc:"Gas limit per transaction; set to 'auto' to calculate sufficient gas automatically (default is 200000)."` // GasAdjustment is the adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1). - GasAdjustment string `yaml:"gas-adjustment" doc:"adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1)"` + GasAdjustment string `yaml:"gas-adjustment" doc:"Factor to multiply against the estimated gas (default is 1)."` // GasPrices is the gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom). - GasPrices string `yaml:"gas-prices" doc:"gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom)"` + GasPrices string `yaml:"gas-prices" doc:"Gas prices in decimal format to determine the transaction fee (e.g., 0.1uatom)."` // GenerateOnly is a boolean determining whether to build an unsigned transaction and write it to STDOUT. - GenerateOnly bool `yaml:"generate-only" doc:"boolean determining whether to build an unsigned transaction and write it to STDOUT"` + GenerateOnly bool `yaml:"generate-only" doc:"Creates an unsigned transaction and writes it to STDOUT."` // Identity is the (optional) identity signature (ex. UPort or Keybase). - Identity string `yaml:"identity" doc:"identity signature (ex. UPort or Keybase)"` + Identity string `yaml:"identity" doc:"Identity signature (e.g., UPort or Keybase)."` // IP is the node's public IP (default "192.168.1.64"). - IP string `yaml:"ip" doc:"node's public IP (default '192.168.1.64')"` + IP string `yaml:"ip" doc:"Node's public IP address (default is '192.168.1.64')."` // KeyringDir is the client Keyring directory; if omitted, the default 'home' directory will be used. - KeyringDir string `yaml:"keyring-dir" doc:"client Keyring directory; if omitted, the default 'home' directory will be used"` + KeyringDir string `yaml:"keyring-dir" doc:"Directory for the client keyring; defaults to the 'home' directory if omitted."` // Ledger is a boolean determining whether to use a connected Ledger device. - Ledger bool `yaml:"ledger" doc:"boolean determining whether to use a connected Ledger device"` + Ledger bool `yaml:"ledger" doc:"Uses a connected Ledger device if true."` // KeyringDir is the minimum self delegation required on the validator. - MinSelfDelegation string `yaml:"min-self-delegation" doc:"minimum self delegation required on the validator"` + MinSelfDelegation string `yaml:"min-self-delegation" doc:"Minimum self-delegation required for the validator."` // Node is : to tendermint rpc interface for this chain (default "tcp://localhost:26657"). - Node string `yaml:"node" doc:": to tendermint rpc interface for this chain (default 'tcp://localhost:26657')"` + Node string `yaml:"node" doc:": for the Tendermint RPC interface (default 'tcp://localhost:26657')"` // NodeID is the node's NodeID. - NodeID string `yaml:"node-id" doc:"node's NodeID"` + NodeID string `yaml:"node-id" doc:"Node's NodeID"` // Note is the note to add a description to the transaction (previously --memo). - Note string `yaml:"note" doc:"note to add a description to the transaction (previously --memo)"` + Note string `yaml:"note" doc:"Adds a description to the transaction (formerly --memo)."` // Offline is a boolean determining the offline mode (does not allow any online functionality). - Offline bool `yaml:"offline" doc:"boolean determining the offline mode (does not allow any online functionality)"` + Offline bool `yaml:"offline" doc:"Operates in offline mode, disallowing any online functionality."` // Output is the output format (text|json) (default "json"). - Output string `yaml:"output" doc:"output format (text|json) (default 'json')"` + Output string `yaml:"output" doc:"Output format (text|json) (default 'json')."` // OutputDocument writes the genesis transaction JSON document to the given file instead of the default location. - OutputDocument string `yaml:"output-document" doc:"writes the genesis transaction JSON document to the given file instead of the default location"` + OutputDocument string `yaml:"output-document" doc:"Writes the genesis transaction JSON document to the specified file instead of the default location."` // PubKey is the validator's Protobuf JSON encoded public key. - PubKey string `yaml:"pubkey" doc:"validator's Protobuf JSON encoded public key"` + PubKey string `yaml:"pubkey" doc:"Protobuf JSON encoded public key of the validator."` // Sequence is the sequence number of the signing account (offline mode only). - Sequence uint `yaml:"sequence" doc:"sequence number of the signing account (offline mode only)"` + Sequence uint `yaml:"sequence" doc:"Sequence number of the signing account (offline mode only)."` // SignMode is the choose sign mode (direct|amino-json), this is an advanced feature. - SignMode string `yaml:"sign-mode" doc:"choose sign mode (direct|amino-json), this is an advanced feature"` + SignMode string `yaml:"sign-mode" doc:"Chooses sign mode (direct|amino-json), an advanced feature."` // TimeoutHeight sets a block timeout height to prevent the tx from being committed past a certain height. - TimeoutHeight uint `yaml:"timeout-height" doc:"sets a block timeout height to prevent the tx from being committed past a certain height"` + TimeoutHeight uint `yaml:"timeout-height" doc:"Sets a block timeout height to prevent the transaction from being committed past a certain height."` } diff --git a/ignite/internal/tools/gen-config-doc/cmd/root.go b/ignite/internal/tools/gen-config-doc/cmd/root.go index 18f3a1648a..cbea0ac6db 100644 --- a/ignite/internal/tools/gen-config-doc/cmd/root.go +++ b/ignite/internal/tools/gen-config-doc/cmd/root.go @@ -21,7 +21,7 @@ const ( flagOutput = "output" flagFilename = "filename" - defaultFilename = "sample-config.yml" + defaultFilename = "03-config.md" defaultDocPath = "docs/docs/08-references" ) diff --git a/ignite/internal/tools/gen-config-doc/go.mod b/ignite/internal/tools/gen-config-doc/go.mod index c09b525880..51ba62f286 100644 --- a/ignite/internal/tools/gen-config-doc/go.mod +++ b/ignite/internal/tools/gen-config-doc/go.mod @@ -6,7 +6,7 @@ replace github.com/ignite/cli/v29 => ../../../../ require ( github.com/gobuffalo/genny/v2 v2.1.0 - github.com/gobuffalo/plush/v4 v4.1.19 + github.com/gobuffalo/plush/v4 v4.1.20 github.com/ignite/cli/v29 v29.0.0-00010101000000-000000000000 github.com/spf13/cobra v1.8.0 ) @@ -61,7 +61,6 @@ require ( github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d // indirect github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e // indirect github.com/spf13/pflag v1.0.5 // indirect - golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 // indirect golang.org/x/net v0.24.0 // indirect golang.org/x/sys v0.19.0 // indirect golang.org/x/term v0.19.0 // indirect diff --git a/ignite/internal/tools/gen-config-doc/go.sum b/ignite/internal/tools/gen-config-doc/go.sum index 5f0520b88c..7cb7487616 100644 --- a/ignite/internal/tools/gen-config-doc/go.sum +++ b/ignite/internal/tools/gen-config-doc/go.sum @@ -65,8 +65,8 @@ github.com/gobuffalo/logger v1.0.7/go.mod h1:u40u6Bq3VVvaMcy5sRBclD8SXhBYPS0Qk95 github.com/gobuffalo/packd v1.0.2 h1:Yg523YqnOxGIWCp69W12yYBKsoChwI7mtu6ceM9Bwfw= github.com/gobuffalo/packd v1.0.2/go.mod h1:sUc61tDqGMXON80zpKGp92lDb86Km28jfvX7IAyxFT8= github.com/gobuffalo/plush/v4 v4.1.16/go.mod h1:6t7swVsarJ8qSLw1qyAH/KbrcSTwdun2ASEQkOznakg= -github.com/gobuffalo/plush/v4 v4.1.19 h1:o0E5gEJw+ozkAwQoCeiaWC6VOU2lEmX+GhtGkwpqZ8o= -github.com/gobuffalo/plush/v4 v4.1.19/go.mod h1:WiKHJx3qBvfaDVlrv8zT7NCd3dEMaVR/fVxW4wqV17M= +github.com/gobuffalo/plush/v4 v4.1.20 h1:UJjUITuVJf9GacfG1g9KhW+CdB1N4liCLcn8LmTunfs= +github.com/gobuffalo/plush/v4 v4.1.20/go.mod h1:WiKHJx3qBvfaDVlrv8zT7NCd3dEMaVR/fVxW4wqV17M= github.com/gobuffalo/tags/v3 v3.1.4 h1:X/ydLLPhgXV4h04Hp2xlbI2oc5MDaa7eub6zw8oHjsM= github.com/gobuffalo/tags/v3 v3.1.4/go.mod h1:ArRNo3ErlHO8BtdA0REaZxijuWnWzF6PUXngmMXd2I0= github.com/gobuffalo/validate/v3 v3.3.3 h1:o7wkIGSvZBYBd6ChQoLxkz2y1pfmhbI4jNJYh6PuNJ4= @@ -181,8 +181,6 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= -golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 h1:985EYyeCOxTpcgOTJpflJUwOeEz0CQOdPt73OzpE9F8= -golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI= 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.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= diff --git a/ignite/internal/tools/gen-config-doc/templates/doc/files/{{Name}}.plush b/ignite/internal/tools/gen-config-doc/templates/doc/files/{{Name}}.plush index bd62983020..1f56a82675 100644 --- a/ignite/internal/tools/gen-config-doc/templates/doc/files/{{Name}}.plush +++ b/ignite/internal/tools/gen-config-doc/templates/doc/files/{{Name}}.plush @@ -1 +1,11 @@ +--- +sidebar_position: 4 +description: Configuration file example. +title: Configuration file example +--- + +## Configuration file example + +```yaml title="config.yml" <%= Config %> +``` \ No newline at end of file diff --git a/ignite/pkg/clidoc/struct.go b/ignite/pkg/clidoc/struct.go index 0ed2aaa03e..e423c6c845 100644 --- a/ignite/pkg/clidoc/struct.go +++ b/ignite/pkg/clidoc/struct.go @@ -4,8 +4,12 @@ import ( "fmt" "reflect" "strings" + + "github.com/ignite/cli/v29/ignite/pkg/errors" ) +const listSuffix = "list" + type ( // Docs represents a slice of Doc. Docs []Doc @@ -31,11 +35,13 @@ func (d Docs) writeString(sb *strings.Builder, level int) { indent := strings.Repeat(" ", level+1) // Two spaces per YAML indentation standard for _, doc := range d { sb.WriteString(indent) - if doc.Type != "" { - sb.WriteString(fmt.Sprintf("%s: [%s] # %s\n", doc.Key, doc.Type, doc.Comment)) - } else { + switch doc.Type { + case "": sb.WriteString(fmt.Sprintf("%s: # %s\n", doc.Key, doc.Comment)) + default: + sb.WriteString(fmt.Sprintf("%s: (%s) # %s\n", doc.Key, doc.Type, doc.Comment)) } + if len(doc.Value) > 0 { doc.Value.writeString(sb, level+1) } @@ -51,11 +57,14 @@ func GenDoc(v interface{}) (fields Docs, err error) { for i := 0; i < t.NumField(); i++ { var ( field = t.Field(i) - doc = field.Tag.Get("doc") yaml = field.Tag.Get("yaml") + doc = field.Tag.Get("doc") ) tags := strings.Split(yaml, ",") + if len(tags) == 0 { + return fields, errors.Errorf("no tags found in struct field %s", field.Name) + } name := tags[0] if name == "" { name = strings.ToLower(field.Name) @@ -87,7 +96,7 @@ func GenDoc(v interface{}) (fields Docs, err error) { return nil, err } case reflect.Slice: - elemType = fmt.Sprintf("[]%s", field.Type.Elem().Kind().String()) + elemType = listName(field.Type.Elem().Kind().String()) elemFields, err = GenDoc(reflect.New(field.Type.Elem()).Elem().Interface()) if err != nil { return nil, err @@ -106,14 +115,18 @@ func GenDoc(v interface{}) (fields Docs, err error) { return fields, nil } +func listName(name string) string { + return fmt.Sprintf("%s %s", name, listSuffix) +} + func mapTypes(doc string) string { docTypes := map[string]string{ - "[]struct": "list", - "struct": "", - "[]map": "list", - "map": "", - "[]slice": "list", - "slice": "list", + "struct": "", + "map": "key/value", + "slice": listSuffix, + listName("map"): listSuffix, + listName("slice"): listSuffix, + listName("struct"): listSuffix, } if docType, ok := docTypes[doc]; ok { return docType diff --git a/ignite/pkg/clidoc/struct_test.go b/ignite/pkg/clidoc/struct_test.go index 7bd9196e05..e382fcac2b 100644 --- a/ignite/pkg/clidoc/struct_test.go +++ b/ignite/pkg/clidoc/struct_test.go @@ -44,7 +44,7 @@ func TestGenDoc(t *testing.T) { }, { Key: "ldflags", - Type: "[]string", + Type: listName("string"), }, { Key: "proto", @@ -57,7 +57,7 @@ func TestGenDoc(t *testing.T) { { Key: "third_party_paths", Comment: "doc of third party paths", - Type: "[]string", + Type: listName("string"), }, }, Comment: "doc of proto", @@ -73,7 +73,7 @@ func TestGenDoc(t *testing.T) { { Key: "third_party_paths", Comment: "doc of third party paths", - Type: "[]string", + Type: listName("string"), }, }, Comment: "doc of pointer proto", @@ -90,7 +90,7 @@ func TestGenDoc(t *testing.T) { { Key: "third_party_paths", Comment: "doc of third party paths", - Type: "[]string", + Type: listName("string"), }, }, Comment: "doc of protos", @@ -109,7 +109,7 @@ func TestGenDoc(t *testing.T) { { Key: "third_party_paths", Comment: "doc of third party paths", - Type: "[]string", + Type: listName("string"), }, }, }, diff --git a/scripts/gen-config-doc b/scripts/gen-config-doc old mode 100644 new mode 100755 index 84056fa0c6..a8d35aaa23 --- a/scripts/gen-config-doc +++ b/scripts/gen-config-doc @@ -1,3 +1,8 @@ #!/bin/bash -go run ignite/internal/tools/gen-config-doc/*.go +cd ignite/internal/tools/gen-config-doc || exit + +go run . + +rsync -av docs ../../../../ +rm -r docs \ No newline at end of file From c22073bc77120745ab37fa039bb032e78dc31216 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Tue, 21 May 2024 02:32:39 +0800 Subject: [PATCH 3/3] chore: enable gci linter (#4159) --- .github/workflows/test-lint.yml | 2 +- .golangci.yml | 19 +++++++++++++++---- changelog.md | 1 + ignite/cmd/chain_faucet.go | 3 ++- ignite/cmd/chain_simulate.go | 3 ++- ignite/cmd/node_query.go | 3 ++- ignite/cmd/node_tx_bank_send.go | 3 ++- ignite/config/chain/parse.go | 3 ++- ignite/pkg/cosmosaccount/cosmosaccount.go | 3 ++- ignite/pkg/cosmosclient/cosmosclient.go | 14 ++++++++------ ignite/pkg/cosmosclient/gasometer.go | 3 ++- ignite/pkg/cosmosfaucet/cosmosfaucet.go | 1 + ignite/pkg/cosmosfaucet/transfer.go | 1 + .../adapter/postgres/postgres.go | 3 ++- ignite/pkg/cosmosutil/gentx.go | 4 +++- ignite/services/chain/faucet.go | 1 + ignite/services/chain/runtime.go | 3 ++- 17 files changed, 49 insertions(+), 21 deletions(-) diff --git a/.github/workflows/test-lint.yml b/.github/workflows/test-lint.yml index aad15e59e4..514fbaae64 100644 --- a/.github/workflows/test-lint.yml +++ b/.github/workflows/test-lint.yml @@ -35,7 +35,7 @@ jobs: - uses: golangci/golangci-lint-action@v6 if: env.GIT_DIFF with: - version: v1.54.2 + version: v1.58.0 install-mode: goinstall args: --timeout 10m github-token: ${{ secrets.github_token }} diff --git a/.golangci.yml b/.golangci.yml index dd076db8ad..fd302aa6ec 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,9 +1,5 @@ run: tests: false - skip-dirs: - - ignite/ui -# # timeout for analysis, e.g. 30s, 5m, default is 1m -# timeout: 5m linters: disable-all: true @@ -17,6 +13,7 @@ linters: - errchkjson - errorlint - exhaustive + - gci - goconst - gocritic - godot @@ -47,6 +44,16 @@ linters: # - wsl linters-settings: + gci: + custom-order: true + sections: + - standard # Standard section: captures all standard packages. + - default # Default section: contains all imports that could not be matched to another section type. + - prefix(cosmossdk.io) + - prefix(github.com/cosmos/cosmos-sdk) + - prefix(github.com/cosmos/ibc-go + - prefix(github.com/cometbft/cometbft) + - prefix(github.com/ignite/cli) forbidigo: forbid: - p: ^fmt\.Errorf$ @@ -61,5 +68,9 @@ linters-settings: desc: Should be replaced by '"github.com/ignite/cli/ignite/pkg/errors"' issues: + exclude-dirs: + - ignite/ui + # # timeout for analysis, e.g. 30s, 5m, default is 1m + # timeout: 5m max-issues-per-linter: 0 max-same-issues: 0 diff --git a/changelog.md b/changelog.md index cf8cca8401..1268e0551c 100644 --- a/changelog.md +++ b/changelog.md @@ -21,6 +21,7 @@ ### Changes +- [#4159](https://github.com/ignite/cli/pull/4159) Enable gci linter - [#4157](https://github.com/ignite/cli/pull/4157) Upgrade golang to 1.22 - [#4094](https://github.com/ignite/cli/pull/4094) Scaffolding a multi-index map using `ignite s map foo bar baz --index foobar,foobaz` is no longer supported. Use one index instead of use `collections.IndexedMap`. - [#4058](https://github.com/ignite/cli/pull/4058) Simplify scaffolded modules by including `ValidateBasic()` logic in message handler. diff --git a/ignite/cmd/chain_faucet.go b/ignite/cmd/chain_faucet.go index 0e0dc9a4eb..83df815ff5 100644 --- a/ignite/cmd/chain_faucet.go +++ b/ignite/cmd/chain_faucet.go @@ -1,9 +1,10 @@ package ignitecmd import ( - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/spf13/cobra" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ignite/cli/v29/ignite/pkg/chaincmd" "github.com/ignite/cli/v29/ignite/pkg/cliui" "github.com/ignite/cli/v29/ignite/services/chain" diff --git a/ignite/cmd/chain_simulate.go b/ignite/cmd/chain_simulate.go index 433503995b..3bafd43fc1 100644 --- a/ignite/cmd/chain_simulate.go +++ b/ignite/cmd/chain_simulate.go @@ -3,9 +3,10 @@ package ignitecmd import ( "path/filepath" - "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/ignite/cli/v29/ignite/services/chain" ) diff --git a/ignite/cmd/node_query.go b/ignite/cmd/node_query.go index 082a565f16..e1c033cefc 100644 --- a/ignite/cmd/node_query.go +++ b/ignite/cmd/node_query.go @@ -3,10 +3,11 @@ package ignitecmd import ( "fmt" - "github.com/cosmos/cosmos-sdk/types/query" "github.com/spf13/cobra" flag "github.com/spf13/pflag" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/ignite/cli/v29/ignite/pkg/errors" ) diff --git a/ignite/cmd/node_tx_bank_send.go b/ignite/cmd/node_tx_bank_send.go index eadc54d2e7..ed8ca47579 100644 --- a/ignite/cmd/node_tx_bank_send.go +++ b/ignite/cmd/node_tx_bank_send.go @@ -1,9 +1,10 @@ package ignitecmd import ( - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/spf13/cobra" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ignite/cli/v29/ignite/pkg/cliui" ) diff --git a/ignite/config/chain/parse.go b/ignite/config/chain/parse.go index bc23cb4b91..fbba0e3c3b 100644 --- a/ignite/config/chain/parse.go +++ b/ignite/config/chain/parse.go @@ -5,9 +5,10 @@ import ( "io" "os" - "github.com/cosmos/cosmos-sdk/types/bech32" "gopkg.in/yaml.v3" + "github.com/cosmos/cosmos-sdk/types/bech32" + "github.com/ignite/cli/v29/ignite/config/chain/version" "github.com/ignite/cli/v29/ignite/pkg/errors" ) diff --git a/ignite/pkg/cosmosaccount/cosmosaccount.go b/ignite/pkg/cosmosaccount/cosmosaccount.go index 92e714f2bf..69a865f686 100644 --- a/ignite/pkg/cosmosaccount/cosmosaccount.go +++ b/ignite/pkg/cosmosaccount/cosmosaccount.go @@ -7,6 +7,8 @@ import ( "os" dkeyring "github.com/99designs/keyring" + "github.com/cosmos/go-bip39" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" @@ -15,7 +17,6 @@ import ( sdktypes "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/bech32" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/go-bip39" "github.com/ignite/cli/v29/ignite/pkg/errors" ) diff --git a/ignite/pkg/cosmosclient/cosmosclient.go b/ignite/pkg/cosmosclient/cosmosclient.go index 06dcb9802b..6453656ce3 100644 --- a/ignite/pkg/cosmosclient/cosmosclient.go +++ b/ignite/pkg/cosmosclient/cosmosclient.go @@ -14,9 +14,10 @@ import ( "time" "github.com/cenkalti/backoff" - rpcclient "github.com/cometbft/cometbft/rpc/client" - rpchttp "github.com/cometbft/cometbft/rpc/client/http" - ctypes "github.com/cometbft/cometbft/rpc/core/types" + gogogrpc "github.com/cosmos/gogoproto/grpc" + "github.com/cosmos/gogoproto/proto" + prototypes "github.com/cosmos/gogoproto/types" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" @@ -30,9 +31,10 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" staking "github.com/cosmos/cosmos-sdk/x/staking/types" - gogogrpc "github.com/cosmos/gogoproto/grpc" - "github.com/cosmos/gogoproto/proto" - prototypes "github.com/cosmos/gogoproto/types" + + rpcclient "github.com/cometbft/cometbft/rpc/client" + rpchttp "github.com/cometbft/cometbft/rpc/client/http" + ctypes "github.com/cometbft/cometbft/rpc/core/types" "github.com/ignite/cli/v29/ignite/pkg/cosmosaccount" "github.com/ignite/cli/v29/ignite/pkg/cosmosfaucet" diff --git a/ignite/pkg/cosmosclient/gasometer.go b/ignite/pkg/cosmosclient/gasometer.go index 57f0114809..bdf259b36c 100644 --- a/ignite/pkg/cosmosclient/gasometer.go +++ b/ignite/pkg/cosmosclient/gasometer.go @@ -1,10 +1,11 @@ package cosmosclient import ( + gogogrpc "github.com/cosmos/gogoproto/grpc" + "github.com/cosmos/cosmos-sdk/client/tx" sdktypes "github.com/cosmos/cosmos-sdk/types" txtypes "github.com/cosmos/cosmos-sdk/types/tx" - gogogrpc "github.com/cosmos/gogoproto/grpc" ) // gasometer implements the Gasometer interface. diff --git a/ignite/pkg/cosmosfaucet/cosmosfaucet.go b/ignite/pkg/cosmosfaucet/cosmosfaucet.go index 5e798740af..6b914bce54 100644 --- a/ignite/pkg/cosmosfaucet/cosmosfaucet.go +++ b/ignite/pkg/cosmosfaucet/cosmosfaucet.go @@ -6,6 +6,7 @@ import ( "time" sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" chaincmdrunner "github.com/ignite/cli/v29/ignite/pkg/chaincmd/runner" diff --git a/ignite/pkg/cosmosfaucet/transfer.go b/ignite/pkg/cosmosfaucet/transfer.go index b797aadefc..57536c787e 100644 --- a/ignite/pkg/cosmosfaucet/transfer.go +++ b/ignite/pkg/cosmosfaucet/transfer.go @@ -7,6 +7,7 @@ import ( "time" sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ignite/cli/v29/ignite/pkg/chaincmd" diff --git a/ignite/pkg/cosmostxcollector/adapter/postgres/postgres.go b/ignite/pkg/cosmostxcollector/adapter/postgres/postgres.go index e173fe1c69..6bc76094e9 100644 --- a/ignite/pkg/cosmostxcollector/adapter/postgres/postgres.go +++ b/ignite/pkg/cosmostxcollector/adapter/postgres/postgres.go @@ -8,9 +8,10 @@ import ( "fmt" "net/url" - ctypes "github.com/cometbft/cometbft/rpc/core/types" "github.com/lib/pq" + ctypes "github.com/cometbft/cometbft/rpc/core/types" + "github.com/ignite/cli/v29/ignite/pkg/cosmosclient" "github.com/ignite/cli/v29/ignite/pkg/cosmostxcollector/query" "github.com/ignite/cli/v29/ignite/pkg/errors" diff --git a/ignite/pkg/cosmosutil/gentx.go b/ignite/pkg/cosmosutil/gentx.go index fb19aeaf18..4951414df7 100644 --- a/ignite/pkg/cosmosutil/gentx.go +++ b/ignite/pkg/cosmosutil/gentx.go @@ -6,9 +6,11 @@ import ( "os" sdkmath "cosmossdk.io/math" - "github.com/cometbft/cometbft/crypto/ed25519" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cometbft/cometbft/crypto/ed25519" + "github.com/ignite/cli/v29/ignite/pkg/errors" ) diff --git a/ignite/services/chain/faucet.go b/ignite/services/chain/faucet.go index 273197f8e2..836625788a 100644 --- a/ignite/services/chain/faucet.go +++ b/ignite/services/chain/faucet.go @@ -6,6 +6,7 @@ import ( "time" sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" chainconfig "github.com/ignite/cli/v29/ignite/config/chain" diff --git a/ignite/services/chain/runtime.go b/ignite/services/chain/runtime.go index a45da52d57..6d04982d99 100644 --- a/ignite/services/chain/runtime.go +++ b/ignite/services/chain/runtime.go @@ -5,10 +5,11 @@ import ( "os" "path/filepath" - sdktypes "github.com/cosmos/cosmos-sdk/types" "github.com/nqd/flat" "github.com/pelletier/go-toml" + sdktypes "github.com/cosmos/cosmos-sdk/types" + chainconfig "github.com/ignite/cli/v29/ignite/config/chain" "github.com/ignite/cli/v29/ignite/pkg/chaincmd" chaincmdrunner "github.com/ignite/cli/v29/ignite/pkg/chaincmd/runner"