Skip to content

Commit

Permalink
fix: make linters happy
Browse files Browse the repository at this point in the history
  • Loading branch information
amimart committed Jun 27, 2022
1 parent faa0763 commit 309193a
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 18 deletions.
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
#--- Build stage
FROM golang:1.18.2-alpine3.15 AS go-builder
FROM golang:1.18.2-alpine3.16 AS go-builder

WORKDIR /src

# CosmWasm: see https://github.com/CosmWasm/wasmvm/releases
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a

RUN set -eux; apk add --no-cache ca-certificates build-base git \
# hadolint ignore=DL4006
RUN set -eux \
&& apk add --no-cache ca-certificates=20211220-r0 build-base=0.5-r3 git=2.36.1-r0 \
&& sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 7d2239e9f25e96d0d4daba982ce92367aacf0cbd95d2facb8442268f2b1cc1fc \
&& sha256sum /lib/libwasmvm_muslc.x86_64.a | grep f6282df732a13dec836cda1f399dd874b1e3163504dbd9607c6af915b2740479 \
&& cp /lib/libwasmvm_muslc.$(uname -m).a /lib/libwasmvm_muslc.a
&& cp "/lib/libwasmvm_muslc.$(uname -m).a" /lib/libwasmvm_muslc.a

COPY . /src/

Expand Down
25 changes: 13 additions & 12 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,17 +146,17 @@ var (
// DefaultNodeHome default home directories for the application daemon.
DefaultNodeHome string

// Bech32PrefixAccAddr defines the Bech32 prefix of an account's address
// Bech32PrefixAccAddr defines the Bech32 prefix of an account's address.
Bech32PrefixAccAddr = AccountAddressPrefix
// Bech32PrefixAccPub defines the Bech32 prefix of an account's public key
// Bech32PrefixAccPub defines the Bech32 prefix of an account's public key.
Bech32PrefixAccPub = AccountAddressPrefix + sdk.PrefixPublic
// Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address
// Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address.
Bech32PrefixValAddr = AccountAddressPrefix + sdk.PrefixValidator + sdk.PrefixOperator
// Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key
// Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key.
Bech32PrefixValPub = AccountAddressPrefix + sdk.PrefixValidator + sdk.PrefixOperator + sdk.PrefixPublic
// Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address
// Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address.
Bech32PrefixConsAddr = AccountAddressPrefix + sdk.PrefixValidator + sdk.PrefixConsensus
// Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key
// Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key.
Bech32PrefixConsPub = AccountAddressPrefix + sdk.PrefixValidator + sdk.PrefixConsensus + sdk.PrefixPublic

// ModuleBasics defines the module BasicManager is in charge of setting up basic,
Expand Down Expand Up @@ -223,7 +223,7 @@ func init() {
DefaultNodeHome = filepath.Join(userHomeDir, "."+Name)
}

// App extends an ABCI application, but with most of its parameters exported.
// OKP4App 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 OKP4App struct {
Expand Down Expand Up @@ -262,22 +262,23 @@ type OKP4App struct {
FeeGrantKeeper feegrantkeeper.Keeper
WasmKeeper wasm.Keeper

// make scoped keepers public for test purposes
// make scoped keepers public for test purposes.
ScopedIBCKeeper capabilitykeeper.ScopedKeeper
ScopedICAHostKeeper capabilitykeeper.ScopedKeeper
ScopedICAControllerKeeper capabilitykeeper.ScopedKeeper
ScopedInterTxKeeper capabilitykeeper.ScopedKeeper
ScopedTransferKeeper capabilitykeeper.ScopedKeeper
ScopedWasmKeeper capabilitykeeper.ScopedKeeper

// mm is the module manager
// mm is the module manager.
mm *module.Manager

// sm is the simulation manager
// sm is the simulation manager.
sm *module.SimulationManager
}

// NewOKP4App returns a reference to an initialized OKP4 blockchain app
// NewOKP4App returns a reference to an initialized OKP4 blockchain app.
// nolint:funlen
func NewOKP4App(
logger log.Logger,
db dbm.DB,
Expand Down Expand Up @@ -671,7 +672,7 @@ func NewOKP4App(
wasmkeeper.NewWasmSnapshotter(app.CommitMultiStore(), &app.WasmKeeper),
)
if err != nil {
panic(fmt.Errorf("failed to register snapshot extension: %s", err))
panic(fmt.Errorf("failed to register snapshot extension: %w", err))
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"github.com/okp4/okp4d/app/params"
)

// MakeEncodingConfig creates a new EncodingConfig with all modules registered
// MakeEncodingConfig creates a new EncodingConfig with all modules registered.
func MakeEncodingConfig() params.EncodingConfig {
encodingConfig := params.MakeEncodingConfig()
std.RegisterLegacyAminoCodec(encodingConfig.Amino)
Expand Down
1 change: 1 addition & 0 deletions app/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func (app *OKP4App) ExportAppStateAndValidators(
// prepare for fresh start at zero height
// NOTE zero height genesis is a temporary feature which will be deprecated
// in favour of export at a block height
// nolint:funlen
func (app *OKP4App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) {
applyAllowedAddrs := false

Expand Down
1 change: 1 addition & 0 deletions cmd/okp4d/genaccounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const (
)

// AddGenesisAccountCmd returns add-genesis-account cobra Command.
// nolint:funlen,gocognit,nestif,cyclop
func AddGenesisAccountCmd(defaultNodeHome string) *cobra.Command {
cmd := &cobra.Command{
Use: "add-genesis-account [address_or_key_name] [coin][,[coin]]",
Expand Down
3 changes: 1 addition & 2 deletions cmd/okp4d/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (
"github.com/tendermint/tendermint/libs/log"
)

// NewRootCmd creates a new root command for the OKP4 application
// NewRootCmd creates a new root command for the OKP4 application.
func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
cfg := sdk.GetConfig()
cfg.SetBech32PrefixForAccount(app.Bech32PrefixAccAddr, app.Bech32PrefixAccPub)
Expand Down Expand Up @@ -80,7 +80,6 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {

if err := server.InterceptConfigsPreRunHandler(cmd, "", nil); err != nil {
return err

}

return nil
Expand Down

0 comments on commit 309193a

Please sign in to comment.