From 74985e1919e0bde8c94195fc5aa1f2cb16e565bc Mon Sep 17 00:00:00 2001 From: loloicci Date: Tue, 4 Jul 2023 14:52:27 +0900 Subject: [PATCH 01/13] chore: fix Makefile for format and execute make format --- Makefile | 6 ++--- ante/ante.go | 7 +++--- ante/ante_test.go | 7 +++--- app/app.go | 43 ++++++++++++++++++----------------- app/app_test.go | 8 ++++--- cli_test/cli_test.go | 5 ++-- cli_test/test_helpers.go | 3 ++- cmd/fnsad/cmd/root.go | 19 ++++++++-------- cmd/fnsad/cmd/root_test.go | 7 +++--- cmd/fnsad/cmd/testnet.go | 3 ++- cmd/fnsad/cmd/testnet_test.go | 7 +++--- 11 files changed, 63 insertions(+), 52 deletions(-) diff --git a/Makefile b/Makefile index cbe0d0b1..265af6ef 100644 --- a/Makefile +++ b/Makefile @@ -378,9 +378,9 @@ lint: find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" | xargs gofmt -d -s format: - find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gofmt -w -s - find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs misspell -w - find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs goimports -w -local github.com/Finschia/finschia-sdk + find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" | xargs gofmt -w -s + find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" | xargs misspell -w + find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" | xargs goimports -w -local github.com/Finschia/finschia-sdk ############################################################################### ### Localnet ### diff --git a/ante/ante.go b/ante/ante.go index bbdddf61..b4d5d33b 100644 --- a/ante/ante.go +++ b/ante/ante.go @@ -1,13 +1,14 @@ package ante import ( - sdk "github.com/Finschia/finschia-sdk/types" - sdkerrors "github.com/Finschia/finschia-sdk/types/errors" - "github.com/Finschia/finschia-sdk/x/auth/ante" ibcante "github.com/Finschia/ibc-go/v3/modules/core/ante" ibckeeper "github.com/Finschia/ibc-go/v3/modules/core/keeper" wasmkeeper "github.com/Finschia/wasmd/x/wasm/keeper" wasmtypes "github.com/Finschia/wasmd/x/wasm/types" + + sdk "github.com/Finschia/finschia-sdk/types" + sdkerrors "github.com/Finschia/finschia-sdk/types/errors" + "github.com/Finschia/finschia-sdk/x/auth/ante" ) // HandlerOptions extend the SDK's AnteHandler options by requiring the IBC diff --git a/ante/ante_test.go b/ante/ante_test.go index 32915fce..e6cbbc6c 100644 --- a/ante/ante_test.go +++ b/ante/ante_test.go @@ -4,6 +4,10 @@ import ( "fmt" "testing" + ocrand "github.com/Finschia/ostracon/libs/rand" + "github.com/stretchr/testify/suite" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/Finschia/finschia-sdk/client" "github.com/Finschia/finschia-sdk/client/tx" cryptotypes "github.com/Finschia/finschia-sdk/crypto/types" @@ -12,9 +16,6 @@ import ( sdk "github.com/Finschia/finschia-sdk/types" "github.com/Finschia/finschia-sdk/types/tx/signing" xauthsigning "github.com/Finschia/finschia-sdk/x/auth/signing" - ocrand "github.com/Finschia/ostracon/libs/rand" - "github.com/stretchr/testify/suite" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" linkapp "github.com/Finschia/finschia/app" linkhelpers "github.com/Finschia/finschia/app/helpers" diff --git a/app/app.go b/app/app.go index 009d91cc..92a3caa3 100644 --- a/app/app.go +++ b/app/app.go @@ -19,6 +19,28 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" + ica "github.com/Finschia/ibc-go/v3/modules/apps/27-interchain-accounts" + icahost "github.com/Finschia/ibc-go/v3/modules/apps/27-interchain-accounts/host" + icahostkeeper "github.com/Finschia/ibc-go/v3/modules/apps/27-interchain-accounts/host/keeper" + icahosttypes "github.com/Finschia/ibc-go/v3/modules/apps/27-interchain-accounts/host/types" + icatypes "github.com/Finschia/ibc-go/v3/modules/apps/27-interchain-accounts/types" + "github.com/Finschia/ibc-go/v3/modules/apps/transfer" + ibctransferkeeper "github.com/Finschia/ibc-go/v3/modules/apps/transfer/keeper" + ibctransfertypes "github.com/Finschia/ibc-go/v3/modules/apps/transfer/types" + ibc "github.com/Finschia/ibc-go/v3/modules/core" + ibcclient "github.com/Finschia/ibc-go/v3/modules/core/02-client" + ibcclientclient "github.com/Finschia/ibc-go/v3/modules/core/02-client/client" + ibcclienttypes "github.com/Finschia/ibc-go/v3/modules/core/02-client/types" + porttypes "github.com/Finschia/ibc-go/v3/modules/core/05-port/types" + ibchost "github.com/Finschia/ibc-go/v3/modules/core/24-host" + ibckeeper "github.com/Finschia/ibc-go/v3/modules/core/keeper" + "github.com/Finschia/wasmd/x/wasm" + wasmclient "github.com/Finschia/wasmd/x/wasm/client" + wasmkeeper "github.com/Finschia/wasmd/x/wasm/keeper" + "github.com/Finschia/wasmd/x/wasmplus" + wasmpluskeeper "github.com/Finschia/wasmd/x/wasmplus/keeper" + wasmplustypes "github.com/Finschia/wasmd/x/wasmplus/types" + "github.com/Finschia/finschia-sdk/baseapp" "github.com/Finschia/finschia-sdk/client" nodeservice "github.com/Finschia/finschia-sdk/client/grpc/node" @@ -100,27 +122,6 @@ import ( upgradeclient "github.com/Finschia/finschia-sdk/x/upgrade/client" upgradekeeper "github.com/Finschia/finschia-sdk/x/upgrade/keeper" upgradetypes "github.com/Finschia/finschia-sdk/x/upgrade/types" - ica "github.com/Finschia/ibc-go/v3/modules/apps/27-interchain-accounts" - icahost "github.com/Finschia/ibc-go/v3/modules/apps/27-interchain-accounts/host" - icahostkeeper "github.com/Finschia/ibc-go/v3/modules/apps/27-interchain-accounts/host/keeper" - icahosttypes "github.com/Finschia/ibc-go/v3/modules/apps/27-interchain-accounts/host/types" - icatypes "github.com/Finschia/ibc-go/v3/modules/apps/27-interchain-accounts/types" - "github.com/Finschia/ibc-go/v3/modules/apps/transfer" - ibctransferkeeper "github.com/Finschia/ibc-go/v3/modules/apps/transfer/keeper" - ibctransfertypes "github.com/Finschia/ibc-go/v3/modules/apps/transfer/types" - ibc "github.com/Finschia/ibc-go/v3/modules/core" - ibcclient "github.com/Finschia/ibc-go/v3/modules/core/02-client" - ibcclientclient "github.com/Finschia/ibc-go/v3/modules/core/02-client/client" - ibcclienttypes "github.com/Finschia/ibc-go/v3/modules/core/02-client/types" - porttypes "github.com/Finschia/ibc-go/v3/modules/core/05-port/types" - ibchost "github.com/Finschia/ibc-go/v3/modules/core/24-host" - ibckeeper "github.com/Finschia/ibc-go/v3/modules/core/keeper" - "github.com/Finschia/wasmd/x/wasm" - wasmclient "github.com/Finschia/wasmd/x/wasm/client" - wasmkeeper "github.com/Finschia/wasmd/x/wasm/keeper" - "github.com/Finschia/wasmd/x/wasmplus" - wasmpluskeeper "github.com/Finschia/wasmd/x/wasmplus/keeper" - wasmplustypes "github.com/Finschia/wasmd/x/wasmplus/types" appante "github.com/Finschia/finschia/ante" appparams "github.com/Finschia/finschia/app/params" diff --git a/app/app_test.go b/app/app_test.go index f26c6963..21156c87 100644 --- a/app/app_test.go +++ b/app/app_test.go @@ -13,6 +13,8 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" + "github.com/Finschia/wasmd/x/wasmplus" + "github.com/Finschia/finschia-sdk/baseapp" "github.com/Finschia/finschia-sdk/simapp" "github.com/Finschia/finschia-sdk/tests/mocks" @@ -32,7 +34,9 @@ import ( foundationmodule "github.com/Finschia/finschia-sdk/x/foundation/module" "github.com/Finschia/finschia-sdk/x/genutil" "github.com/Finschia/finschia-sdk/x/gov" - "github.com/Finschia/wasmd/x/wasmplus" + + "github.com/Finschia/ibc-go/v3/modules/apps/transfer" + ibc "github.com/Finschia/ibc-go/v3/modules/core" "github.com/Finschia/finschia-sdk/x/mint" "github.com/Finschia/finschia-sdk/x/params" @@ -40,8 +44,6 @@ import ( "github.com/Finschia/finschia-sdk/x/staking" tokenmodule "github.com/Finschia/finschia-sdk/x/token/module" "github.com/Finschia/finschia-sdk/x/upgrade" - "github.com/Finschia/ibc-go/v3/modules/apps/transfer" - ibc "github.com/Finschia/ibc-go/v3/modules/core" ) func TestSimAppExportAndBlockedAddrs(t *testing.T) { diff --git a/cli_test/cli_test.go b/cli_test/cli_test.go index 123f69f8..efac208b 100644 --- a/cli_test/cli_test.go +++ b/cli_test/cli_test.go @@ -15,14 +15,15 @@ import ( "testing" "time" + osttypes "github.com/Finschia/ostracon/types" + "github.com/stretchr/testify/require" + "github.com/Finschia/finschia-sdk/client/flags" "github.com/Finschia/finschia-sdk/crypto/keys/ed25519" sdk "github.com/Finschia/finschia-sdk/types" "github.com/Finschia/finschia-sdk/types/tx" gov "github.com/Finschia/finschia-sdk/x/gov/types" minttypes "github.com/Finschia/finschia-sdk/x/mint/types" - osttypes "github.com/Finschia/ostracon/types" - "github.com/stretchr/testify/require" "github.com/Finschia/finschia/app" ) diff --git a/cli_test/test_helpers.go b/cli_test/test_helpers.go index 1162c8a3..f4e4dd2f 100644 --- a/cli_test/test_helpers.go +++ b/cli_test/test_helpers.go @@ -19,6 +19,8 @@ import ( "github.com/spf13/cobra" "github.com/stretchr/testify/require" + wasmcli "github.com/Finschia/wasmd/x/wasm/client/cli" + "github.com/Finschia/finschia-sdk/baseapp" "github.com/Finschia/finschia-sdk/client" clientkeys "github.com/Finschia/finschia-sdk/client/keys" @@ -52,7 +54,6 @@ import ( stakingcli "github.com/Finschia/finschia-sdk/x/staking/client/cli" staking "github.com/Finschia/finschia-sdk/x/staking/types" "github.com/Finschia/finschia-sdk/x/stakingplus" - wasmcli "github.com/Finschia/wasmd/x/wasm/client/cli" ostcmd "github.com/Finschia/ostracon/cmd/ostracon/commands" ostcfg "github.com/Finschia/ostracon/config" diff --git a/cmd/fnsad/cmd/root.go b/cmd/fnsad/cmd/root.go index ca3612c8..4d9c6fc3 100644 --- a/cmd/fnsad/cmd/root.go +++ b/cmd/fnsad/cmd/root.go @@ -7,6 +7,16 @@ import ( "os" "path/filepath" + ostcli "github.com/Finschia/ostracon/libs/cli" + "github.com/Finschia/ostracon/libs/log" + "github.com/Finschia/wasmd/x/wasm" + wasmkeeper "github.com/Finschia/wasmd/x/wasm/keeper" + "github.com/prometheus/client_golang/prometheus" + "github.com/spf13/cast" + "github.com/spf13/cobra" + "github.com/spf13/viper" + dbm "github.com/tendermint/tm-db" + "github.com/Finschia/finschia-sdk/baseapp" "github.com/Finschia/finschia-sdk/client" "github.com/Finschia/finschia-sdk/client/config" @@ -27,15 +37,6 @@ import ( banktypes "github.com/Finschia/finschia-sdk/x/bank/types" "github.com/Finschia/finschia-sdk/x/crisis" genutilcli "github.com/Finschia/finschia-sdk/x/genutil/client/cli" - ostcli "github.com/Finschia/ostracon/libs/cli" - "github.com/Finschia/ostracon/libs/log" - "github.com/Finschia/wasmd/x/wasm" - wasmkeeper "github.com/Finschia/wasmd/x/wasm/keeper" - "github.com/prometheus/client_golang/prometheus" - "github.com/spf13/cast" - "github.com/spf13/cobra" - "github.com/spf13/viper" - dbm "github.com/tendermint/tm-db" "github.com/Finschia/finschia/app" "github.com/Finschia/finschia/app/params" diff --git a/cmd/fnsad/cmd/root_test.go b/cmd/fnsad/cmd/root_test.go index b91280da..ada413fb 100644 --- a/cmd/fnsad/cmd/root_test.go +++ b/cmd/fnsad/cmd/root_test.go @@ -4,12 +4,13 @@ import ( "os" "testing" - "github.com/Finschia/finschia-sdk/client/flags" - "github.com/Finschia/finschia-sdk/server" - "github.com/Finschia/finschia-sdk/store/types" "github.com/Finschia/ostracon/libs/log" "github.com/stretchr/testify/require" dbm "github.com/tendermint/tm-db" + + "github.com/Finschia/finschia-sdk/client/flags" + "github.com/Finschia/finschia-sdk/server" + "github.com/Finschia/finschia-sdk/store/types" ) func TestNewApp(t *testing.T) { diff --git a/cmd/fnsad/cmd/testnet.go b/cmd/fnsad/cmd/testnet.go index 85d82862..d1ee1506 100644 --- a/cmd/fnsad/cmd/testnet.go +++ b/cmd/fnsad/cmd/testnet.go @@ -10,7 +10,6 @@ import ( "os" "path/filepath" - "github.com/Finschia/finschia-sdk/testutil" ostconfig "github.com/Finschia/ostracon/config" ostos "github.com/Finschia/ostracon/libs/os" ostrand "github.com/Finschia/ostracon/libs/rand" @@ -18,6 +17,8 @@ import ( osttime "github.com/Finschia/ostracon/types/time" "github.com/spf13/cobra" + "github.com/Finschia/finschia-sdk/testutil" + "github.com/Finschia/finschia-sdk/client" "github.com/Finschia/finschia-sdk/client/flags" "github.com/Finschia/finschia-sdk/client/tx" diff --git a/cmd/fnsad/cmd/testnet_test.go b/cmd/fnsad/cmd/testnet_test.go index ed809797..8156c8a5 100644 --- a/cmd/fnsad/cmd/testnet_test.go +++ b/cmd/fnsad/cmd/testnet_test.go @@ -5,15 +5,16 @@ import ( "fmt" "testing" + "github.com/Finschia/ostracon/libs/log" + "github.com/spf13/viper" + "github.com/stretchr/testify/require" + "github.com/Finschia/finschia-sdk/client" "github.com/Finschia/finschia-sdk/client/flags" "github.com/Finschia/finschia-sdk/server" banktypes "github.com/Finschia/finschia-sdk/x/bank/types" genutiltest "github.com/Finschia/finschia-sdk/x/genutil/client/testutil" genutiltypes "github.com/Finschia/finschia-sdk/x/genutil/types" - "github.com/Finschia/ostracon/libs/log" - "github.com/spf13/viper" - "github.com/stretchr/testify/require" "github.com/Finschia/finschia/app" ) From a1635207e2e69154054e892d049c775987d91d2c Mon Sep 17 00:00:00 2001 From: loloicci Date: Tue, 4 Jul 2023 14:57:19 +0900 Subject: [PATCH 02/13] docs: add this PR to CHANGELOG --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e3450ba..a30ee2eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Features ### Improvements +* (improvements) [\#230](https://github.com/Finschia/finschia/pull/230) fix Makefile for format and execute make format #230 + * (build) [\#221](https://github.com/Finschia/finschia/pull/221) compile static binary as release assets and docker image * (swagger) [\#223](https://github.com/Finschia/finschia/pull/223) add integrated swagger for finschia From 6f2afa656f5172711cd3115282ebb465e7c7748f Mon Sep 17 00:00:00 2001 From: loloicci Date: Tue, 18 Jul 2023 17:21:21 +0900 Subject: [PATCH 03/13] chore: treat all Finschia packages as local packages in format --- Makefile | 2 +- ante/ante_test.go | 3 ++- app/app.go | 7 ++++--- app/app_test.go | 3 ++- app/genesis_account_test.go | 3 ++- app/helpers/test_helpers.go | 5 +++-- cli_test/cli_test.go | 3 ++- cmd/fnsad/cmd/genaccounts_test.go | 3 ++- cmd/fnsad/cmd/root.go | 9 +++++---- cmd/fnsad/cmd/root_test.go | 3 ++- cmd/fnsad/cmd/testnet.go | 3 ++- cmd/fnsad/cmd/testnet_test.go | 3 ++- 12 files changed, 29 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 71a5aee0..ca5e4a98 100644 --- a/Makefile +++ b/Makefile @@ -380,7 +380,7 @@ lint: format: find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" | xargs gofmt -w -s find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" | xargs misspell -w - find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" | xargs goimports -w -local github.com/Finschia/finschia-sdk + find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" | xargs goimports -w -local github.com/Finschia ############################################################################### ### Localnet ### diff --git a/ante/ante_test.go b/ante/ante_test.go index e6cbbc6c..18832bf1 100644 --- a/ante/ante_test.go +++ b/ante/ante_test.go @@ -4,10 +4,11 @@ import ( "fmt" "testing" - ocrand "github.com/Finschia/ostracon/libs/rand" "github.com/stretchr/testify/suite" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + ocrand "github.com/Finschia/ostracon/libs/rand" + "github.com/Finschia/finschia-sdk/client" "github.com/Finschia/finschia-sdk/client/tx" cryptotypes "github.com/Finschia/finschia-sdk/crypto/types" diff --git a/app/app.go b/app/app.go index 92a3caa3..649e396a 100644 --- a/app/app.go +++ b/app/app.go @@ -12,13 +12,14 @@ import ( "github.com/gorilla/mux" "github.com/rakyll/statik/fs" - ocabci "github.com/Finschia/ostracon/abci/types" - "github.com/Finschia/ostracon/libs/log" - ostos "github.com/Finschia/ostracon/libs/os" abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" + ocabci "github.com/Finschia/ostracon/abci/types" + "github.com/Finschia/ostracon/libs/log" + ostos "github.com/Finschia/ostracon/libs/os" + ica "github.com/Finschia/ibc-go/v3/modules/apps/27-interchain-accounts" icahost "github.com/Finschia/ibc-go/v3/modules/apps/27-interchain-accounts/host" icahostkeeper "github.com/Finschia/ibc-go/v3/modules/apps/27-interchain-accounts/host/keeper" diff --git a/app/app_test.go b/app/app_test.go index 21156c87..6dd777b2 100644 --- a/app/app_test.go +++ b/app/app_test.go @@ -8,11 +8,12 @@ import ( "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" - "github.com/Finschia/ostracon/libs/log" abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" + "github.com/Finschia/ostracon/libs/log" + "github.com/Finschia/wasmd/x/wasmplus" "github.com/Finschia/finschia-sdk/baseapp" diff --git a/app/genesis_account_test.go b/app/genesis_account_test.go index f3e3ce7a..e8745495 100644 --- a/app/genesis_account_test.go +++ b/app/genesis_account_test.go @@ -4,9 +4,10 @@ import ( "testing" "time" - "github.com/Finschia/ostracon/crypto" "github.com/stretchr/testify/require" + "github.com/Finschia/ostracon/crypto" + "github.com/Finschia/finschia-sdk/crypto/keys/secp256k1" "github.com/Finschia/finschia-sdk/simapp" sdk "github.com/Finschia/finschia-sdk/types" diff --git a/app/helpers/test_helpers.go b/app/helpers/test_helpers.go index 29004eec..f6e09660 100644 --- a/app/helpers/test_helpers.go +++ b/app/helpers/test_helpers.go @@ -5,13 +5,14 @@ import ( "testing" "time" - "github.com/Finschia/ostracon/libs/log" - octypes "github.com/Finschia/ostracon/types" "github.com/stretchr/testify/require" abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" + "github.com/Finschia/ostracon/libs/log" + octypes "github.com/Finschia/ostracon/types" + linkapp "github.com/Finschia/finschia/app" ) diff --git a/cli_test/cli_test.go b/cli_test/cli_test.go index efac208b..3dcf1c8e 100644 --- a/cli_test/cli_test.go +++ b/cli_test/cli_test.go @@ -15,9 +15,10 @@ import ( "testing" "time" - osttypes "github.com/Finschia/ostracon/types" "github.com/stretchr/testify/require" + osttypes "github.com/Finschia/ostracon/types" + "github.com/Finschia/finschia-sdk/client/flags" "github.com/Finschia/finschia-sdk/crypto/keys/ed25519" sdk "github.com/Finschia/finschia-sdk/types" diff --git a/cmd/fnsad/cmd/genaccounts_test.go b/cmd/fnsad/cmd/genaccounts_test.go index bc9273c4..8a6bdbba 100644 --- a/cmd/fnsad/cmd/genaccounts_test.go +++ b/cmd/fnsad/cmd/genaccounts_test.go @@ -10,10 +10,11 @@ import ( "github.com/Finschia/finschia-sdk/crypto/keyring" sdk "github.com/Finschia/finschia-sdk/types" - "github.com/Finschia/ostracon/libs/log" "github.com/spf13/viper" "github.com/stretchr/testify/require" + "github.com/Finschia/ostracon/libs/log" + "github.com/Finschia/finschia-sdk/client" "github.com/Finschia/finschia-sdk/client/flags" "github.com/Finschia/finschia-sdk/server" diff --git a/cmd/fnsad/cmd/root.go b/cmd/fnsad/cmd/root.go index 4d9c6fc3..3514e891 100644 --- a/cmd/fnsad/cmd/root.go +++ b/cmd/fnsad/cmd/root.go @@ -7,16 +7,17 @@ import ( "os" "path/filepath" - ostcli "github.com/Finschia/ostracon/libs/cli" - "github.com/Finschia/ostracon/libs/log" - "github.com/Finschia/wasmd/x/wasm" - wasmkeeper "github.com/Finschia/wasmd/x/wasm/keeper" "github.com/prometheus/client_golang/prometheus" "github.com/spf13/cast" "github.com/spf13/cobra" "github.com/spf13/viper" dbm "github.com/tendermint/tm-db" + ostcli "github.com/Finschia/ostracon/libs/cli" + "github.com/Finschia/ostracon/libs/log" + "github.com/Finschia/wasmd/x/wasm" + wasmkeeper "github.com/Finschia/wasmd/x/wasm/keeper" + "github.com/Finschia/finschia-sdk/baseapp" "github.com/Finschia/finschia-sdk/client" "github.com/Finschia/finschia-sdk/client/config" diff --git a/cmd/fnsad/cmd/root_test.go b/cmd/fnsad/cmd/root_test.go index ada413fb..8362f178 100644 --- a/cmd/fnsad/cmd/root_test.go +++ b/cmd/fnsad/cmd/root_test.go @@ -4,10 +4,11 @@ import ( "os" "testing" - "github.com/Finschia/ostracon/libs/log" "github.com/stretchr/testify/require" dbm "github.com/tendermint/tm-db" + "github.com/Finschia/ostracon/libs/log" + "github.com/Finschia/finschia-sdk/client/flags" "github.com/Finschia/finschia-sdk/server" "github.com/Finschia/finschia-sdk/store/types" diff --git a/cmd/fnsad/cmd/testnet.go b/cmd/fnsad/cmd/testnet.go index d1ee1506..14a8cdd5 100644 --- a/cmd/fnsad/cmd/testnet.go +++ b/cmd/fnsad/cmd/testnet.go @@ -10,12 +10,13 @@ import ( "os" "path/filepath" + "github.com/spf13/cobra" + ostconfig "github.com/Finschia/ostracon/config" ostos "github.com/Finschia/ostracon/libs/os" ostrand "github.com/Finschia/ostracon/libs/rand" "github.com/Finschia/ostracon/types" osttime "github.com/Finschia/ostracon/types/time" - "github.com/spf13/cobra" "github.com/Finschia/finschia-sdk/testutil" diff --git a/cmd/fnsad/cmd/testnet_test.go b/cmd/fnsad/cmd/testnet_test.go index 8156c8a5..80e43f2e 100644 --- a/cmd/fnsad/cmd/testnet_test.go +++ b/cmd/fnsad/cmd/testnet_test.go @@ -5,10 +5,11 @@ import ( "fmt" "testing" - "github.com/Finschia/ostracon/libs/log" "github.com/spf13/viper" "github.com/stretchr/testify/require" + "github.com/Finschia/ostracon/libs/log" + "github.com/Finschia/finschia-sdk/client" "github.com/Finschia/finschia-sdk/client/flags" "github.com/Finschia/finschia-sdk/server" From b5cb63440af61896efe8e010b14b15107425f519 Mon Sep 17 00:00:00 2001 From: loloicci Date: Mon, 11 Sep 2023 17:00:40 +0900 Subject: [PATCH 04/13] chore: replace import formatting tool with goimport-reviser --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ca5e4a98..1158368b 100644 --- a/Makefile +++ b/Makefile @@ -380,7 +380,7 @@ lint: format: find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" | xargs gofmt -w -s find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" | xargs misspell -w - find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" | xargs goimports -w -local github.com/Finschia + find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" | xargs goimports-reviser -rm-unused -format -set-alias -company-prefixes "github.com/Finschia/" ############################################################################### ### Localnet ### From c5f71397d61fb0057806b8cafcc058c323d258dd Mon Sep 17 00:00:00 2001 From: loloicci Date: Mon, 11 Sep 2023 17:40:30 +0900 Subject: [PATCH 05/13] ci: add check format workflow --- .github/workflows/format.yml | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/format.yml diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 00000000..18754bc2 --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,39 @@ +name: Check Make Format +# this workflow checks that go files is formated by `make format` +on: + pull_request: + push: + branches: + - main + +jobs: + install-tools: + runs-on: ubuntu-latest + steps: + - uses: actions/setup-go@v4 + with: go-version 1.18 + - name: Display go version + run: go version + - name: install tools + run: | + go install github.com/client9/misspell/cmd/misspell@v0.3.4 && + go install github.com/incu6us/goimports-reviser/v3@v3.4.5 + - uses: actions/cache@v3 + with: + path: ${GOPATH}/bin + key: ${{ runner.os }}-misspell-v0.3.4-goimports-reviser-v3.4.5 + + check-format: + runs-on: ubuntu-latest + needs: install-tools + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 + with: + go-version: 1.18 + - name: Display go version + run: go version + - name: Make Format + run: | + make format && + git diff --exit-code From 12067574f068256417072145bbf277ba3670e71a Mon Sep 17 00:00:00 2001 From: loloicci Date: Mon, 11 Sep 2023 18:33:58 +0900 Subject: [PATCH 06/13] ci: fix format.yml --- .github/workflows/format.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 18754bc2..8ba28476 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -11,7 +11,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/setup-go@v4 - with: go-version 1.18 + with: + go-version: 1.18 - name: Display go version run: go version - name: install tools @@ -20,7 +21,7 @@ jobs: go install github.com/incu6us/goimports-reviser/v3@v3.4.5 - uses: actions/cache@v3 with: - path: ${GOPATH}/bin + path: ~/go/bin key: ${{ runner.os }}-misspell-v0.3.4-goimports-reviser-v3.4.5 check-format: @@ -33,7 +34,11 @@ jobs: go-version: 1.18 - name: Display go version run: go version + - uses: actions/cache@v3 + with: + path: ~/go/bin + key: ${{ runner.os }}-misspell-v0.3.4-goimports-reviser-v3.4.5 - name: Make Format - run: | - make format && - git diff --exit-code + run: make format + - name: Check Diff + run: git diff --exit-code From 2f2f5a59b895d047364d901e3f9049ed45d62634 Mon Sep 17 00:00:00 2001 From: loloicci Date: Mon, 11 Sep 2023 18:45:15 +0900 Subject: [PATCH 07/13] chore: execute make format --- cmd/fnsad/cmd/testnet.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmd/fnsad/cmd/testnet.go b/cmd/fnsad/cmd/testnet.go index 14a8cdd5..d1d5da06 100644 --- a/cmd/fnsad/cmd/testnet.go +++ b/cmd/fnsad/cmd/testnet.go @@ -18,8 +18,6 @@ import ( "github.com/Finschia/ostracon/types" osttime "github.com/Finschia/ostracon/types/time" - "github.com/Finschia/finschia-sdk/testutil" - "github.com/Finschia/finschia-sdk/client" "github.com/Finschia/finschia-sdk/client/flags" "github.com/Finschia/finschia-sdk/client/tx" @@ -28,6 +26,7 @@ import ( cryptotypes "github.com/Finschia/finschia-sdk/crypto/types" "github.com/Finschia/finschia-sdk/server" srvconfig "github.com/Finschia/finschia-sdk/server/config" + "github.com/Finschia/finschia-sdk/testutil" sdk "github.com/Finschia/finschia-sdk/types" "github.com/Finschia/finschia-sdk/types/module" authtypes "github.com/Finschia/finschia-sdk/x/auth/types" From 3bf30b70239378fad44c3c75faa2d19f7cf1ed15 Mon Sep 17 00:00:00 2001 From: loloicci Date: Mon, 11 Sep 2023 19:17:37 +0900 Subject: [PATCH 08/13] fix: fix how to use goimports-reviser in Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index fb1607a7..38979d85 100644 --- a/Makefile +++ b/Makefile @@ -314,7 +314,7 @@ lint: format: find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" | xargs gofmt -w -s find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" | xargs misspell -w - find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" | xargs goimports-reviser -rm-unused -format -set-alias -company-prefixes "github.com/Finschia/" + find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" | xargs -n1 goimports-reviser -rm-unused -set-alias -project-name "github.com/Finschia/finschia/" -company-prefixes "github.com/Finschia/" ############################################################################### ### Localnet ### From c06df15c2e3d832822bc91fb3cf65b074055351b Mon Sep 17 00:00:00 2001 From: loloicci Date: Mon, 11 Sep 2023 19:17:42 +0900 Subject: [PATCH 09/13] chore: make format --- ante/ante.go | 5 ++-- ante/ante_test.go | 3 +-- app/app.go | 39 ++++++++++++++----------------- app/app_test.go | 10 ++++---- app/genesis_account_test.go | 3 +-- cli_test/cli_test.go | 3 +-- cli_test/test_helpers.go | 4 +--- cmd/fnsad/cmd/genaccounts_test.go | 11 ++++----- cmd/fnsad/cmd/root.go | 9 ++++--- cmd/fnsad/cmd/root_test.go | 3 +-- cmd/fnsad/cmd/testnet.go | 11 ++++----- cmd/fnsad/cmd/testnet_test.go | 3 +-- 12 files changed, 44 insertions(+), 60 deletions(-) diff --git a/ante/ante.go b/ante/ante.go index d193953a..b8610ce3 100644 --- a/ante/ante.go +++ b/ante/ante.go @@ -1,13 +1,14 @@ package ante import ( + ibcante "github.com/cosmos/ibc-go/v4/modules/core/ante" + ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper" + sdk "github.com/Finschia/finschia-sdk/types" sdkerrors "github.com/Finschia/finschia-sdk/types/errors" "github.com/Finschia/finschia-sdk/x/auth/ante" wasmkeeper "github.com/Finschia/wasmd/x/wasm/keeper" wasmtypes "github.com/Finschia/wasmd/x/wasm/types" - ibcante "github.com/cosmos/ibc-go/v4/modules/core/ante" - ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper" ) // HandlerOptions extend the SDK's AnteHandler options by requiring the IBC diff --git a/ante/ante_test.go b/ante/ante_test.go index 18832bf1..6ca195fa 100644 --- a/ante/ante_test.go +++ b/ante/ante_test.go @@ -7,8 +7,6 @@ import ( "github.com/stretchr/testify/suite" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - ocrand "github.com/Finschia/ostracon/libs/rand" - "github.com/Finschia/finschia-sdk/client" "github.com/Finschia/finschia-sdk/client/tx" cryptotypes "github.com/Finschia/finschia-sdk/crypto/types" @@ -17,6 +15,7 @@ import ( sdk "github.com/Finschia/finschia-sdk/types" "github.com/Finschia/finschia-sdk/types/tx/signing" xauthsigning "github.com/Finschia/finschia-sdk/x/auth/signing" + ocrand "github.com/Finschia/ostracon/libs/rand" linkapp "github.com/Finschia/finschia/app" linkhelpers "github.com/Finschia/finschia/app/helpers" diff --git a/app/app.go b/app/app.go index f0fb1f0b..699ed4a8 100644 --- a/app/app.go +++ b/app/app.go @@ -9,12 +9,23 @@ import ( "os" "path/filepath" + ica "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts" + icahost "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host" + icahostkeeper "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/keeper" + icahosttypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/types" + icatypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/types" + "github.com/cosmos/ibc-go/v4/modules/apps/transfer" + ibctransferkeeper "github.com/cosmos/ibc-go/v4/modules/apps/transfer/keeper" + ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types" + ibc "github.com/cosmos/ibc-go/v4/modules/core" + ibcclient "github.com/cosmos/ibc-go/v4/modules/core/02-client" + ibcclientclient "github.com/cosmos/ibc-go/v4/modules/core/02-client/client" + ibcclienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + 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" "github.com/gorilla/mux" "github.com/rakyll/statik/fs" - - ocabci "github.com/Finschia/ostracon/abci/types" - "github.com/Finschia/ostracon/libs/log" - ostos "github.com/Finschia/ostracon/libs/os" abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" @@ -101,32 +112,18 @@ import ( upgradeclient "github.com/Finschia/finschia-sdk/x/upgrade/client" upgradekeeper "github.com/Finschia/finschia-sdk/x/upgrade/keeper" upgradetypes "github.com/Finschia/finschia-sdk/x/upgrade/types" + ocabci "github.com/Finschia/ostracon/abci/types" + "github.com/Finschia/ostracon/libs/log" + ostos "github.com/Finschia/ostracon/libs/os" "github.com/Finschia/wasmd/x/wasm" wasmclient "github.com/Finschia/wasmd/x/wasm/client" wasmkeeper "github.com/Finschia/wasmd/x/wasm/keeper" "github.com/Finschia/wasmd/x/wasmplus" wasmpluskeeper "github.com/Finschia/wasmd/x/wasmplus/keeper" wasmplustypes "github.com/Finschia/wasmd/x/wasmplus/types" - ica "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts" - icahost "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host" - icahostkeeper "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/keeper" - icahosttypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/types" - icatypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/types" - "github.com/cosmos/ibc-go/v4/modules/apps/transfer" - ibctransferkeeper "github.com/cosmos/ibc-go/v4/modules/apps/transfer/keeper" - ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types" - ibc "github.com/cosmos/ibc-go/v4/modules/core" - ibcclient "github.com/cosmos/ibc-go/v4/modules/core/02-client" - ibcclientclient "github.com/cosmos/ibc-go/v4/modules/core/02-client/client" - ibcclienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" - 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" appante "github.com/Finschia/finschia/ante" appparams "github.com/Finschia/finschia/app/params" - - // unnamed import of statik for swagger UI support _ "github.com/Finschia/finschia/client/docs/statik" ) diff --git a/app/app_test.go b/app/app_test.go index bc5fdc30..c5247f00 100644 --- a/app/app_test.go +++ b/app/app_test.go @@ -5,10 +5,10 @@ import ( "os" "testing" + "github.com/cosmos/ibc-go/v4/modules/apps/transfer" + ibc "github.com/cosmos/ibc-go/v4/modules/core" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" - - "github.com/Finschia/ostracon/libs/log" abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" @@ -32,16 +32,14 @@ import ( foundationmodule "github.com/Finschia/finschia-sdk/x/foundation/module" "github.com/Finschia/finschia-sdk/x/genutil" "github.com/Finschia/finschia-sdk/x/gov" - "github.com/Finschia/wasmd/x/wasmplus" - "github.com/Finschia/finschia-sdk/x/mint" "github.com/Finschia/finschia-sdk/x/params" "github.com/Finschia/finschia-sdk/x/slashing" "github.com/Finschia/finschia-sdk/x/staking" tokenmodule "github.com/Finschia/finschia-sdk/x/token/module" "github.com/Finschia/finschia-sdk/x/upgrade" - "github.com/cosmos/ibc-go/v4/modules/apps/transfer" - ibc "github.com/cosmos/ibc-go/v4/modules/core" + "github.com/Finschia/ostracon/libs/log" + "github.com/Finschia/wasmd/x/wasmplus" ) func TestSimAppExportAndBlockedAddrs(t *testing.T) { diff --git a/app/genesis_account_test.go b/app/genesis_account_test.go index e8745495..268c2b3b 100644 --- a/app/genesis_account_test.go +++ b/app/genesis_account_test.go @@ -6,12 +6,11 @@ import ( "github.com/stretchr/testify/require" - "github.com/Finschia/ostracon/crypto" - "github.com/Finschia/finschia-sdk/crypto/keys/secp256k1" "github.com/Finschia/finschia-sdk/simapp" sdk "github.com/Finschia/finschia-sdk/types" authtypes "github.com/Finschia/finschia-sdk/x/auth/types" + "github.com/Finschia/ostracon/crypto" ) func TestSimGenesisAccountValidate(t *testing.T) { diff --git a/cli_test/cli_test.go b/cli_test/cli_test.go index 3dcf1c8e..83155e0b 100644 --- a/cli_test/cli_test.go +++ b/cli_test/cli_test.go @@ -17,14 +17,13 @@ import ( "github.com/stretchr/testify/require" - osttypes "github.com/Finschia/ostracon/types" - "github.com/Finschia/finschia-sdk/client/flags" "github.com/Finschia/finschia-sdk/crypto/keys/ed25519" sdk "github.com/Finschia/finschia-sdk/types" "github.com/Finschia/finschia-sdk/types/tx" gov "github.com/Finschia/finschia-sdk/x/gov/types" minttypes "github.com/Finschia/finschia-sdk/x/mint/types" + osttypes "github.com/Finschia/ostracon/types" "github.com/Finschia/finschia/app" ) diff --git a/cli_test/test_helpers.go b/cli_test/test_helpers.go index f4e4dd2f..e014eccb 100644 --- a/cli_test/test_helpers.go +++ b/cli_test/test_helpers.go @@ -19,8 +19,6 @@ import ( "github.com/spf13/cobra" "github.com/stretchr/testify/require" - wasmcli "github.com/Finschia/wasmd/x/wasm/client/cli" - "github.com/Finschia/finschia-sdk/baseapp" "github.com/Finschia/finschia-sdk/client" clientkeys "github.com/Finschia/finschia-sdk/client/keys" @@ -54,13 +52,13 @@ import ( stakingcli "github.com/Finschia/finschia-sdk/x/staking/client/cli" staking "github.com/Finschia/finschia-sdk/x/staking/types" "github.com/Finschia/finschia-sdk/x/stakingplus" - ostcmd "github.com/Finschia/ostracon/cmd/ostracon/commands" ostcfg "github.com/Finschia/ostracon/config" "github.com/Finschia/ostracon/libs/log" osthttp "github.com/Finschia/ostracon/rpc/client/http" ostctypes "github.com/Finschia/ostracon/rpc/core/types" osttypes "github.com/Finschia/ostracon/types" + wasmcli "github.com/Finschia/wasmd/x/wasm/client/cli" wasmtypes "github.com/Finschia/wasmd/x/wasm/types" "github.com/Finschia/finschia/app" diff --git a/cmd/fnsad/cmd/genaccounts_test.go b/cmd/fnsad/cmd/genaccounts_test.go index 8a6bdbba..7981ac4a 100644 --- a/cmd/fnsad/cmd/genaccounts_test.go +++ b/cmd/fnsad/cmd/genaccounts_test.go @@ -3,27 +3,24 @@ package cmd_test import ( "context" "fmt" - "testing" - "github.com/Finschia/finschia-sdk/crypto/hd" - "github.com/Finschia/finschia-sdk/crypto/keyring" - sdk "github.com/Finschia/finschia-sdk/types" - "github.com/spf13/viper" "github.com/stretchr/testify/require" - "github.com/Finschia/ostracon/libs/log" - "github.com/Finschia/finschia-sdk/client" "github.com/Finschia/finschia-sdk/client/flags" + "github.com/Finschia/finschia-sdk/crypto/hd" + "github.com/Finschia/finschia-sdk/crypto/keyring" "github.com/Finschia/finschia-sdk/server" "github.com/Finschia/finschia-sdk/simapp" simcmd "github.com/Finschia/finschia-sdk/simapp/simd/cmd" "github.com/Finschia/finschia-sdk/testutil/testdata" + sdk "github.com/Finschia/finschia-sdk/types" "github.com/Finschia/finschia-sdk/types/module" "github.com/Finschia/finschia-sdk/x/genutil" genutiltest "github.com/Finschia/finschia-sdk/x/genutil/client/testutil" + "github.com/Finschia/ostracon/libs/log" ) var testMbm = module.NewBasicManager(genutil.AppModuleBasic{}) diff --git a/cmd/fnsad/cmd/root.go b/cmd/fnsad/cmd/root.go index 11c4ae89..a48b4491 100644 --- a/cmd/fnsad/cmd/root.go +++ b/cmd/fnsad/cmd/root.go @@ -13,11 +13,6 @@ import ( "github.com/spf13/viper" dbm "github.com/tendermint/tm-db" - ostcli "github.com/Finschia/ostracon/libs/cli" - "github.com/Finschia/ostracon/libs/log" - "github.com/Finschia/wasmd/x/wasm" - wasmkeeper "github.com/Finschia/wasmd/x/wasm/keeper" - "github.com/Finschia/finschia-sdk/baseapp" "github.com/Finschia/finschia-sdk/client" "github.com/Finschia/finschia-sdk/client/config" @@ -38,6 +33,10 @@ import ( banktypes "github.com/Finschia/finschia-sdk/x/bank/types" "github.com/Finschia/finschia-sdk/x/crisis" genutilcli "github.com/Finschia/finschia-sdk/x/genutil/client/cli" + ostcli "github.com/Finschia/ostracon/libs/cli" + "github.com/Finschia/ostracon/libs/log" + "github.com/Finschia/wasmd/x/wasm" + wasmkeeper "github.com/Finschia/wasmd/x/wasm/keeper" "github.com/Finschia/finschia/app" "github.com/Finschia/finschia/app/params" diff --git a/cmd/fnsad/cmd/root_test.go b/cmd/fnsad/cmd/root_test.go index 8362f178..1fc47373 100644 --- a/cmd/fnsad/cmd/root_test.go +++ b/cmd/fnsad/cmd/root_test.go @@ -7,11 +7,10 @@ import ( "github.com/stretchr/testify/require" dbm "github.com/tendermint/tm-db" - "github.com/Finschia/ostracon/libs/log" - "github.com/Finschia/finschia-sdk/client/flags" "github.com/Finschia/finschia-sdk/server" "github.com/Finschia/finschia-sdk/store/types" + "github.com/Finschia/ostracon/libs/log" ) func TestNewApp(t *testing.T) { diff --git a/cmd/fnsad/cmd/testnet.go b/cmd/fnsad/cmd/testnet.go index d1d5da06..17f0cec4 100644 --- a/cmd/fnsad/cmd/testnet.go +++ b/cmd/fnsad/cmd/testnet.go @@ -12,12 +12,6 @@ import ( "github.com/spf13/cobra" - ostconfig "github.com/Finschia/ostracon/config" - ostos "github.com/Finschia/ostracon/libs/os" - ostrand "github.com/Finschia/ostracon/libs/rand" - "github.com/Finschia/ostracon/types" - osttime "github.com/Finschia/ostracon/types/time" - "github.com/Finschia/finschia-sdk/client" "github.com/Finschia/finschia-sdk/client/flags" "github.com/Finschia/finschia-sdk/client/tx" @@ -34,6 +28,11 @@ import ( "github.com/Finschia/finschia-sdk/x/genutil" genutiltypes "github.com/Finschia/finschia-sdk/x/genutil/types" stakingtypes "github.com/Finschia/finschia-sdk/x/staking/types" + ostconfig "github.com/Finschia/ostracon/config" + ostos "github.com/Finschia/ostracon/libs/os" + ostrand "github.com/Finschia/ostracon/libs/rand" + "github.com/Finschia/ostracon/types" + osttime "github.com/Finschia/ostracon/types/time" ) var ( diff --git a/cmd/fnsad/cmd/testnet_test.go b/cmd/fnsad/cmd/testnet_test.go index 80e43f2e..3145a77b 100644 --- a/cmd/fnsad/cmd/testnet_test.go +++ b/cmd/fnsad/cmd/testnet_test.go @@ -8,14 +8,13 @@ import ( "github.com/spf13/viper" "github.com/stretchr/testify/require" - "github.com/Finschia/ostracon/libs/log" - "github.com/Finschia/finschia-sdk/client" "github.com/Finschia/finschia-sdk/client/flags" "github.com/Finschia/finschia-sdk/server" banktypes "github.com/Finschia/finschia-sdk/x/bank/types" genutiltest "github.com/Finschia/finschia-sdk/x/genutil/client/testutil" genutiltypes "github.com/Finschia/finschia-sdk/x/genutil/types" + "github.com/Finschia/ostracon/libs/log" "github.com/Finschia/finschia/app" ) From 2fa0ca07a09ac6b36753ba11bc4ac56b3cd5da8d Mon Sep 17 00:00:00 2001 From: loloicci Date: Mon, 11 Sep 2023 19:41:25 +0900 Subject: [PATCH 10/13] fix: add a mistaken deleted comment --- app/app.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/app.go b/app/app.go index 699ed4a8..4d82134d 100644 --- a/app/app.go +++ b/app/app.go @@ -124,7 +124,7 @@ import ( appante "github.com/Finschia/finschia/ante" appparams "github.com/Finschia/finschia/app/params" - _ "github.com/Finschia/finschia/client/docs/statik" + _ "github.com/Finschia/finschia/client/docs/statik" // unnamed import of statik for swagger UI support ) const appName = "Finschia" From 305aa2c73dcf29ef9f22e60754c94e70e27ee194 Mon Sep 17 00:00:00 2001 From: loloicci Date: Tue, 12 Sep 2023 11:10:19 +0900 Subject: [PATCH 11/13] ci: upgrade go used in format workflow --- .github/workflows/format.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 8ba28476..7366bea5 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -12,7 +12,7 @@ jobs: steps: - uses: actions/setup-go@v4 with: - go-version: 1.18 + go-version: '1.20' - name: Display go version run: go version - name: install tools @@ -31,7 +31,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: 1.18 + go-version: '1.20' - name: Display go version run: go version - uses: actions/cache@v3 From fae5fa3f8bfbca739301a7135614cca4eaf43732 Mon Sep 17 00:00:00 2001 From: loloicci Date: Thu, 14 Sep 2023 14:23:12 +0900 Subject: [PATCH 12/13] ci: fix format.yml to use cache properly --- .github/workflows/format.yml | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 7366bea5..040d9c8a 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -7,26 +7,8 @@ on: - main jobs: - install-tools: - runs-on: ubuntu-latest - steps: - - uses: actions/setup-go@v4 - with: - go-version: '1.20' - - name: Display go version - run: go version - - name: install tools - run: | - go install github.com/client9/misspell/cmd/misspell@v0.3.4 && - go install github.com/incu6us/goimports-reviser/v3@v3.4.5 - - uses: actions/cache@v3 - with: - path: ~/go/bin - key: ${{ runner.os }}-misspell-v0.3.4-goimports-reviser-v3.4.5 - check-format: runs-on: ubuntu-latest - needs: install-tools steps: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 @@ -37,7 +19,15 @@ jobs: - uses: actions/cache@v3 with: path: ~/go/bin - key: ${{ runner.os }}-misspell-v0.3.4-goimports-reviser-v3.4.5 + key: ${{ runner.os }}-go-v1.20-misspell-v0.3.4-goimports-reviser-v3.4.5 + - name: install misspell + run: | + type misspell || + go install github.com/client9/misspell/cmd/misspell@v0.3.4 + - name: install goimports-reviser + run: | + type goimports-reviser || + go install github.com/incu6us/goimports-reviser/v3@v3.4.5 - name: Make Format run: make format - name: Check Diff From 2773527d9eea965025436fff07a720418f21c718 Mon Sep 17 00:00:00 2001 From: loloicci Date: Thu, 14 Sep 2023 15:05:37 +0900 Subject: [PATCH 13/13] ci: change how to check cache works in format --- .github/workflows/format.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 040d9c8a..84c5f318 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -17,16 +17,17 @@ jobs: - name: Display go version run: go version - uses: actions/cache@v3 + id: cache with: path: ~/go/bin key: ${{ runner.os }}-go-v1.20-misspell-v0.3.4-goimports-reviser-v3.4.5 - name: install misspell + if: steps.cache.outputs.cache-hit != 'true' run: | - type misspell || go install github.com/client9/misspell/cmd/misspell@v0.3.4 - name: install goimports-reviser + if: steps.cache.outputs.cache-hit != 'true' run: | - type goimports-reviser || go install github.com/incu6us/goimports-reviser/v3@v3.4.5 - name: Make Format run: make format