From 7984502c960bdca841a00f39abae4d71d919c2db Mon Sep 17 00:00:00 2001 From: Dreamer Date: Thu, 6 Jun 2024 09:33:17 +0800 Subject: [PATCH] format code --- Makefile | 3 +- app/ante/ante.go | 3 +- app/ante/handler_options.go | 3 +- app/app.go | 74 +++++++++---------- app/app_test.go | 13 ++-- app/export.go | 4 +- app/sim_bench_test.go | 3 +- app/sim_test.go | 12 ++- cmd/irita/cmd/genaccounts.go | 8 +- cmd/irita/cmd/genrootcert.go | 6 +- cmd/irita/cmd/genvalidators.go | 16 ++-- cmd/irita/cmd/root.go | 32 +++----- cmd/irita/cmd/snapshot.go | 12 ++- cmd/irita/cmd/testnet.go | 36 ++++----- cmd/irita/cmd/utils.go | 13 ++-- .../services/keystore/keys/vrfkey/crypto.go | 3 +- .../services/keystore/keys/vrfkey/export.go | 1 - .../services/keystore/keys/vrfkey/key_v2.go | 3 +- .../services/keystore/keys/vrfkey/models.go | 1 - .../keystore/keys/vrfkey/private_key.go | 3 +- .../chainlink/core/services/keystore/vrf.go | 1 - .../services/signatures/secp256k1/curve.go | 2 +- .../services/signatures/secp256k1/field.go | 2 + .../signatures/secp256k1/public_key.go | 6 +- .../services/signatures/secp256k1/scalar.go | 2 +- .../services/signatures/secp256k1/suite.go | 6 +- .../core/services/vrf/integration_v2_test.go | 9 +-- .../core/services/vrf/proof/proof_response.go | 6 +- .../chainlink/core/services/vrf/proof/seed.go | 1 - .../chainlink/core/utils/utils.go | 7 +- .../2.deploy-vrf/vrf-provider/cmd/genkey.go | 1 - .../app/client/repostitory/eth/client.go | 16 ++-- .../app/client/repostitory/eth/client_test.go | 11 +-- .../app/client/services/channels/channels.go | 1 + .../app/client/services/channels/writer_mw.go | 1 - .../internal/app/client/services/listener.go | 3 +- .../internal/pkg/initialization/channel.go | 4 +- .../internal/pkg/initialization/logger.go | 1 - .../internal/pkg/initialization/services.go | 1 - .../2.deploy-vrf/vrf-provider/tools/global.go | 3 + lite/swagger.go | 3 +- modules/evm/client/export.go | 3 +- modules/evm/client/import.go | 4 +- modules/evm/eth.go | 11 +-- modules/evm/interfaces.go | 3 +- modules/evm/rpc/apis.go | 5 +- modules/evm/rpc/ethereum/backend/backend.go | 13 ++-- modules/evm/server/json_rpc.go | 6 +- modules/evm/server/start.go | 30 +++----- modules/evm/server/util.go | 8 +- modules/tibc/client/cli/tx.go | 13 ++-- modules/tibc/handler.go | 3 +- modules/tibc/keeper/keeper.go | 3 +- modules/tibc/keeper/msg_server.go | 4 +- modules/tibc/module.go | 10 +-- modules/tibc/routing/cli/tx.go | 4 +- modules/tibc/types/msgs.go | 1 - simapp/app.go | 34 ++++----- simapp/export.go | 3 +- simapp/test_helpers.go | 14 ++-- wallet/init.go | 5 +- wallet/keyring/crypto.go | 8 +- wallet/keyring/file_keyring.go | 3 +- wallet/keyring/info.go | 3 +- wallet/keyring/keyring.go | 1 - wallet/keys/show.go | 3 +- wallet/update.go | 3 +- 67 files changed, 212 insertions(+), 322 deletions(-) diff --git a/Makefile b/Makefile index 8c7b3351..388dfc70 100644 --- a/Makefile +++ b/Makefile @@ -160,9 +160,8 @@ lint: go mod verify format: - find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./lite/*/statik.go" -not -path "*.pb.go" | xargs gofmt -w -s find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./lite/*/statik.go" -not -path "*.pb.go" | xargs misspell -w - find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./lite/*/statik.go" -not -path "*.pb.go" | xargs goimports -w -local github.com/bianjieai/irita + goimports-reviser -rm-unused -excludes './vendor/,./lite/statik/statik.go,*.pb.go' -format ./... benchmark: @go test -mod=readonly -bench=. ./... diff --git a/app/ante/ante.go b/app/ante/ante.go index a7e5145a..89315919 100644 --- a/app/ante/ante.go +++ b/app/ante/ante.go @@ -4,7 +4,6 @@ import ( "fmt" "runtime/debug" - evmmoduleante "github.com/bianjieai/irita/modules/evm" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/auth/ante" @@ -15,6 +14,8 @@ import ( tokenkeeper "github.com/irisnet/irismod/modules/token/keeper" tmlog "github.com/tendermint/tendermint/libs/log" evmtypes "github.com/tharsis/ethermint/x/evm/types" + + evmmoduleante "github.com/bianjieai/irita/modules/evm" ) type HandlerOptions struct { diff --git a/app/ante/handler_options.go b/app/ante/handler_options.go index b4c8cd01..f49de044 100644 --- a/app/ante/handler_options.go +++ b/app/ante/handler_options.go @@ -1,11 +1,12 @@ package ante import ( - evmmoduleante "github.com/bianjieai/irita/modules/evm" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/ante" tokenkeeper "github.com/irisnet/irismod/modules/token/keeper" ethermintante "github.com/tharsis/ethermint/app/ante" + + evmmoduleante "github.com/bianjieai/irita/modules/evm" ) func newEthAnteHandler(options HandlerOptions) sdk.AnteHandler { diff --git a/app/app.go b/app/app.go index e17c676b..555db50b 100644 --- a/app/app.go +++ b/app/app.go @@ -6,16 +6,15 @@ import ( "os" "path/filepath" - appante "github.com/bianjieai/irita/app/ante" - "github.com/bianjieai/irita/modules/evm/crypto" - evmutils "github.com/bianjieai/irita/modules/evm/utils" - "github.com/irisnet/irismod/modules/mt" - "github.com/spf13/cast" - abci "github.com/tendermint/tendermint/abci/types" - "github.com/tendermint/tendermint/libs/log" - tmos "github.com/tendermint/tendermint/libs/os" - dbm "github.com/tendermint/tm-db" - + tibcmttransfer "github.com/bianjieai/tibc-go/modules/tibc/apps/mt_transfer" + tibcmttransferkeeper "github.com/bianjieai/tibc-go/modules/tibc/apps/mt_transfer/keeper" + tibcmttypes "github.com/bianjieai/tibc-go/modules/tibc/apps/mt_transfer/types" + tibcnfttransfer "github.com/bianjieai/tibc-go/modules/tibc/apps/nft_transfer" + tibcnfttransferkeeper "github.com/bianjieai/tibc-go/modules/tibc/apps/nft_transfer/keeper" + tibcnfttypes "github.com/bianjieai/tibc-go/modules/tibc/apps/nft_transfer/types" + tibchost "github.com/bianjieai/tibc-go/modules/tibc/core/24-host" + tibcroutingtypes "github.com/bianjieai/tibc-go/modules/tibc/core/26-routing/types" + tibccorekeeper "github.com/bianjieai/tibc-go/modules/tibc/core/keeper" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" @@ -32,7 +31,6 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/version" "github.com/cosmos/cosmos-sdk/x/auth" - authrest "github.com/cosmos/cosmos-sdk/x/auth/client/rest" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation" @@ -61,7 +59,7 @@ import ( stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" sdkupgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" sdkupgrade "github.com/cosmos/cosmos-sdk/x/upgrade/types" - + "github.com/irisnet/irismod/modules/mt" mtkeeper "github.com/irisnet/irismod/modules/mt/keeper" mttypes "github.com/irisnet/irismod/modules/mt/types" "github.com/irisnet/irismod/modules/nft" @@ -82,7 +80,30 @@ import ( "github.com/irisnet/irismod/modules/token" tokenkeeper "github.com/irisnet/irismod/modules/token/keeper" tokentypes "github.com/irisnet/irismod/modules/token/types" + "github.com/spf13/cast" + abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/libs/log" + tmos "github.com/tendermint/tendermint/libs/os" + dbm "github.com/tendermint/tm-db" + ethermintante "github.com/tharsis/ethermint/app/ante" + srvflags "github.com/tharsis/ethermint/server/flags" + ethermint "github.com/tharsis/ethermint/types" + "github.com/tharsis/ethermint/x/evm" + evmrest "github.com/tharsis/ethermint/x/evm/client/rest" + evmkeeper "github.com/tharsis/ethermint/x/evm/keeper" + evmtypes "github.com/tharsis/ethermint/x/evm/types" + "github.com/tharsis/ethermint/x/feemarket" + feemarketkeeper "github.com/tharsis/ethermint/x/feemarket/keeper" + feemarkettypes "github.com/tharsis/ethermint/x/feemarket/types" + "github.com/bianjieai/irita/address" + appante "github.com/bianjieai/irita/app/ante" + "github.com/bianjieai/irita/lite" + appkeeper "github.com/bianjieai/irita/modules/evm" + "github.com/bianjieai/irita/modules/evm/crypto" + evmutils "github.com/bianjieai/irita/modules/evm/utils" + tibc "github.com/bianjieai/irita/modules/tibc" + tibckeeper "github.com/bianjieai/irita/modules/tibc/keeper" "github.com/bianjieai/iritamod/modules/genutil" genutiltypes "github.com/bianjieai/iritamod/modules/genutil" "github.com/bianjieai/iritamod/modules/identity" @@ -96,34 +117,6 @@ import ( "github.com/bianjieai/iritamod/modules/upgrade" upgradekeeper "github.com/bianjieai/iritamod/modules/upgrade/keeper" upgradetypes "github.com/bianjieai/iritamod/modules/upgrade/types" - - "github.com/bianjieai/irita/address" - "github.com/bianjieai/irita/lite" - appkeeper "github.com/bianjieai/irita/modules/evm" - - tibc "github.com/bianjieai/irita/modules/tibc" - tibckeeper "github.com/bianjieai/irita/modules/tibc/keeper" - - tibcmttransfer "github.com/bianjieai/tibc-go/modules/tibc/apps/mt_transfer" - tibcmttransferkeeper "github.com/bianjieai/tibc-go/modules/tibc/apps/mt_transfer/keeper" - tibcmttypes "github.com/bianjieai/tibc-go/modules/tibc/apps/mt_transfer/types" - tibcnfttransfer "github.com/bianjieai/tibc-go/modules/tibc/apps/nft_transfer" - tibcnfttransferkeeper "github.com/bianjieai/tibc-go/modules/tibc/apps/nft_transfer/keeper" - tibcnfttypes "github.com/bianjieai/tibc-go/modules/tibc/apps/nft_transfer/types" - tibchost "github.com/bianjieai/tibc-go/modules/tibc/core/24-host" - tibcroutingtypes "github.com/bianjieai/tibc-go/modules/tibc/core/26-routing/types" - tibccorekeeper "github.com/bianjieai/tibc-go/modules/tibc/core/keeper" - - ethermintante "github.com/tharsis/ethermint/app/ante" - srvflags "github.com/tharsis/ethermint/server/flags" - ethermint "github.com/tharsis/ethermint/types" - "github.com/tharsis/ethermint/x/evm" - evmrest "github.com/tharsis/ethermint/x/evm/client/rest" - evmkeeper "github.com/tharsis/ethermint/x/evm/keeper" - evmtypes "github.com/tharsis/ethermint/x/evm/types" - "github.com/tharsis/ethermint/x/feemarket" - feemarketkeeper "github.com/tharsis/ethermint/x/feemarket/keeper" - feemarkettypes "github.com/tharsis/ethermint/x/feemarket/types" ) const appName = "IritaApp" @@ -155,6 +148,7 @@ var storeKeys = []string{ // DefaultNodeHome default home directories for the application daemon var DefaultNodeHome string + var ( // ModuleBasics defines the module BasicManager is in charge of setting up basic, // non-dependant module elements, such as codec registration diff --git a/app/app_test.go b/app/app_test.go index 018dad0f..f26696b2 100644 --- a/app/app_test.go +++ b/app/app_test.go @@ -5,19 +5,16 @@ import ( "os" "testing" - "github.com/stretchr/testify/require" - - abci "github.com/tendermint/tendermint/abci/types" - "github.com/tendermint/tendermint/crypto" - "github.com/tendermint/tendermint/libs/log" - dbm "github.com/tendermint/tm-db" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - tokentypes "github.com/irisnet/irismod/modules/token/types" + "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/crypto" + "github.com/tendermint/tendermint/libs/log" + dbm "github.com/tendermint/tm-db" "github.com/bianjieai/iritamod/modules/node" ) diff --git a/app/export.go b/app/export.go index ef2588cc..ebf0df7c 100644 --- a/app/export.go +++ b/app/export.go @@ -3,12 +3,10 @@ package app import ( "encoding/json" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/irisnet/irismod/modules/service" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/bianjieai/iritamod/modules/node" ) diff --git a/app/sim_bench_test.go b/app/sim_bench_test.go index 4ae6eaf6..c030f5c7 100644 --- a/app/sim_bench_test.go +++ b/app/sim_bench_test.go @@ -5,11 +5,10 @@ import ( "os" "testing" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/simapp" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" ) // Profile with: diff --git a/app/sim_test.go b/app/sim_test.go index 2fd38542..fef88fdf 100644 --- a/app/sim_test.go +++ b/app/sim_test.go @@ -7,13 +7,6 @@ import ( "os" "testing" - "github.com/stretchr/testify/require" - - abci "github.com/tendermint/tendermint/abci/types" - "github.com/tendermint/tendermint/libs/log" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - dbm "github.com/tendermint/tm-db" - "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/simapp" "github.com/cosmos/cosmos-sdk/simapp/helpers" @@ -28,6 +21,11 @@ import ( "github.com/cosmos/cosmos-sdk/x/simulation" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/libs/log" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + dbm "github.com/tendermint/tm-db" ) // Get flags every time the simulator is run diff --git a/cmd/irita/cmd/genaccounts.go b/cmd/irita/cmd/genaccounts.go index 9fb5dbde..b78c851a 100644 --- a/cmd/irita/cmd/genaccounts.go +++ b/cmd/irita/cmd/genaccounts.go @@ -6,11 +6,6 @@ import ( "errors" "fmt" - evmhd "github.com/tharsis/ethermint/crypto/hd" - evmtypes "github.com/tharsis/ethermint/x/evm/types" - - "github.com/spf13/cobra" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/crypto/keyring" @@ -21,6 +16,9 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/genutil" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" + "github.com/spf13/cobra" + evmhd "github.com/tharsis/ethermint/crypto/hd" + evmtypes "github.com/tharsis/ethermint/x/evm/types" ) const ( diff --git a/cmd/irita/cmd/genrootcert.go b/cmd/irita/cmd/genrootcert.go index fe170991..300964da 100644 --- a/cmd/irita/cmd/genrootcert.go +++ b/cmd/irita/cmd/genrootcert.go @@ -5,12 +5,10 @@ import ( "fmt" "os" - "github.com/spf13/cobra" - - "github.com/tendermint/tendermint/libs/cli" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/server" + "github.com/spf13/cobra" + "github.com/tendermint/tendermint/libs/cli" "github.com/bianjieai/iritamod/modules/genutil" "github.com/bianjieai/iritamod/modules/node" diff --git a/cmd/irita/cmd/genvalidators.go b/cmd/irita/cmd/genvalidators.go index 0c3f18a4..a16ef44f 100644 --- a/cmd/irita/cmd/genvalidators.go +++ b/cmd/irita/cmd/genvalidators.go @@ -4,15 +4,6 @@ import ( "encoding/json" "fmt" - "github.com/pkg/errors" - "github.com/spf13/cobra" - flag "github.com/spf13/pflag" - "github.com/spf13/viper" - - cfg "github.com/tendermint/tendermint/config" - "github.com/tendermint/tendermint/crypto/tmhash" - tmtypes "github.com/tendermint/tendermint/types" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" @@ -20,6 +11,13 @@ import ( "github.com/cosmos/cosmos-sdk/server" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + "github.com/pkg/errors" + "github.com/spf13/cobra" + flag "github.com/spf13/pflag" + "github.com/spf13/viper" + cfg "github.com/tendermint/tendermint/config" + "github.com/tendermint/tendermint/crypto/tmhash" + tmtypes "github.com/tendermint/tendermint/types" "github.com/bianjieai/iritamod/modules/genutil" "github.com/bianjieai/iritamod/modules/node" diff --git a/cmd/irita/cmd/root.go b/cmd/irita/cmd/root.go index a0d0a2f9..05dd6d49 100644 --- a/cmd/irita/cmd/root.go +++ b/cmd/irita/cmd/root.go @@ -5,20 +5,6 @@ import ( "os" "path/filepath" - evmutils "github.com/bianjieai/irita/modules/evm/utils" - - ethermintclient "github.com/tharsis/ethermint/client" - ethermint "github.com/tharsis/ethermint/types" - - "github.com/pkg/errors" - - "github.com/spf13/cast" - "github.com/spf13/cobra" - - tmcli "github.com/tendermint/tendermint/libs/cli" - "github.com/tendermint/tendermint/libs/log" - dbm "github.com/tendermint/tm-db" - "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/config" @@ -35,18 +21,24 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/crisis" - - genutilcli "github.com/bianjieai/iritamod/modules/genutil/client/cli" - "github.com/bianjieai/iritamod/modules/node" - - "github.com/bianjieai/irita/app" - + "github.com/pkg/errors" + "github.com/spf13/cast" + "github.com/spf13/cobra" + tmcli "github.com/tendermint/tendermint/libs/cli" + "github.com/tendermint/tendermint/libs/log" + dbm "github.com/tendermint/tm-db" + ethermintclient "github.com/tharsis/ethermint/client" "github.com/tharsis/ethermint/crypto/hd" "github.com/tharsis/ethermint/encoding" servercfg "github.com/tharsis/ethermint/server/config" + ethermint "github.com/tharsis/ethermint/types" + "github.com/bianjieai/irita/app" evmclient "github.com/bianjieai/irita/modules/evm/client" evmserver "github.com/bianjieai/irita/modules/evm/server" + evmutils "github.com/bianjieai/irita/modules/evm/utils" + genutilcli "github.com/bianjieai/iritamod/modules/genutil/client/cli" + "github.com/bianjieai/iritamod/modules/node" ) // NewRootCmd creates a new root command for simd. It is called once in the main function. diff --git a/cmd/irita/cmd/snapshot.go b/cmd/irita/cmd/snapshot.go index 79891e17..e641fccd 100644 --- a/cmd/irita/cmd/snapshot.go +++ b/cmd/irita/cmd/snapshot.go @@ -9,8 +9,10 @@ import ( "sync" "time" - "github.com/bianjieai/irita/app" - + "github.com/cosmos/cosmos-sdk/version" + "github.com/cosmos/iavl" + "github.com/spf13/cobra" + "github.com/spf13/viper" "github.com/tendermint/tendermint/consensus" tmcli "github.com/tendermint/tendermint/libs/cli" tmmath "github.com/tendermint/tendermint/libs/math" @@ -21,11 +23,7 @@ import ( "github.com/tendermint/tendermint/types" dbm "github.com/tendermint/tm-db" - "github.com/cosmos/cosmos-sdk/version" - "github.com/cosmos/iavl" - - "github.com/spf13/cobra" - "github.com/spf13/viper" + "github.com/bianjieai/irita/app" ) const ( diff --git a/cmd/irita/cmd/testnet.go b/cmd/irita/cmd/testnet.go index 3c034c59..fcbdf4f2 100644 --- a/cmd/irita/cmd/testnet.go +++ b/cmd/irita/cmd/testnet.go @@ -11,23 +11,6 @@ import ( "os" "path/filepath" - evmhd "github.com/tharsis/ethermint/crypto/hd" - - evmtypes "github.com/tharsis/ethermint/x/evm/types" - evmfmttypes "github.com/tharsis/ethermint/x/feemarket/types" - - ethermint "github.com/tharsis/ethermint/types" - - "github.com/spf13/cobra" - "github.com/spf13/viper" - - tmconfig "github.com/tendermint/tendermint/config" - tmos "github.com/tendermint/tendermint/libs/os" - tmrand "github.com/tendermint/tendermint/libs/rand" - "github.com/tendermint/tendermint/libs/tempfile" - "github.com/tendermint/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" @@ -41,17 +24,26 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" - - evmutils "github.com/bianjieai/irita/modules/evm/utils" - servicetypes "github.com/irisnet/irismod/modules/service/types" tokentypes "github.com/irisnet/irismod/modules/token/types" + "github.com/spf13/cobra" + "github.com/spf13/viper" + tmconfig "github.com/tendermint/tendermint/config" + tmos "github.com/tendermint/tendermint/libs/os" + tmrand "github.com/tendermint/tendermint/libs/rand" + "github.com/tendermint/tendermint/libs/tempfile" + "github.com/tendermint/tendermint/types" + tmtime "github.com/tendermint/tendermint/types/time" + evmhd "github.com/tharsis/ethermint/crypto/hd" + evmosConfig "github.com/tharsis/ethermint/server/config" + ethermint "github.com/tharsis/ethermint/types" + evmtypes "github.com/tharsis/ethermint/x/evm/types" + evmfmttypes "github.com/tharsis/ethermint/x/feemarket/types" + evmutils "github.com/bianjieai/irita/modules/evm/utils" "github.com/bianjieai/iritamod/modules/genutil" "github.com/bianjieai/iritamod/modules/node" "github.com/bianjieai/iritamod/utils" - - evmosConfig "github.com/tharsis/ethermint/server/config" ) const ( diff --git a/cmd/irita/cmd/utils.go b/cmd/irita/cmd/utils.go index 22bdc2be..1cc69464 100644 --- a/cmd/irita/cmd/utils.go +++ b/cmd/irita/cmd/utils.go @@ -8,19 +8,16 @@ import ( "os" "strings" - "github.com/olebedev/config" - "github.com/spf13/cobra" - "github.com/spf13/pflag" - "github.com/spf13/viper" - - "github.com/tendermint/tendermint/libs/cli" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - tokentypes "github.com/irisnet/irismod/modules/token/types" + "github.com/olebedev/config" + "github.com/spf13/cobra" + "github.com/spf13/pflag" + "github.com/spf13/viper" + "github.com/tendermint/tendermint/libs/cli" ) const ( diff --git a/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/keystore/keys/vrfkey/crypto.go b/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/keystore/keys/vrfkey/crypto.go index 86a5ff51..4aa88d64 100644 --- a/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/keystore/keys/vrfkey/crypto.go +++ b/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/keystore/keys/vrfkey/crypto.go @@ -5,11 +5,10 @@ import ( "math/big" "github.com/ethereum/go-ethereum/common" - "go.dedis.ch/kyber/v3" - "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/services/signatures/secp256k1" "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/utils" bm "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/utils/big_math" + "go.dedis.ch/kyber/v3" ) // This file contains golang re-implementations of functions on the VRF solidity diff --git a/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/keystore/keys/vrfkey/export.go b/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/keystore/keys/vrfkey/export.go index 58cd8482..0dc8e6d2 100644 --- a/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/keystore/keys/vrfkey/export.go +++ b/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/keystore/keys/vrfkey/export.go @@ -7,7 +7,6 @@ import ( "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/google/uuid" "github.com/pkg/errors" - "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/services/signatures/secp256k1" "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/utils" ) diff --git a/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/keystore/keys/vrfkey/key_v2.go b/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/keystore/keys/vrfkey/key_v2.go index 2be8b687..4b5f78c5 100644 --- a/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/keystore/keys/vrfkey/key_v2.go +++ b/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/keystore/keys/vrfkey/key_v2.go @@ -7,11 +7,10 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/pkg/errors" - "go.dedis.ch/kyber/v3" - "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/services/signatures/secp256k1" "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/utils" bm "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/utils/big_math" + "go.dedis.ch/kyber/v3" ) var suite = secp256k1.NewBlakeKeccackSecp256k1() diff --git a/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/keystore/keys/vrfkey/models.go b/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/keystore/keys/vrfkey/models.go index 195ece73..8e5e5de2 100644 --- a/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/keystore/keys/vrfkey/models.go +++ b/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/keystore/keys/vrfkey/models.go @@ -8,7 +8,6 @@ import ( "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/pkg/errors" - "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/services/signatures/secp256k1" ) diff --git a/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/keystore/keys/vrfkey/private_key.go b/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/keystore/keys/vrfkey/private_key.go index 20846c27..e8aa1c52 100644 --- a/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/keystore/keys/vrfkey/private_key.go +++ b/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/keystore/keys/vrfkey/private_key.go @@ -7,9 +7,8 @@ import ( "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/google/uuid" "github.com/pkg/errors" - "go.dedis.ch/kyber/v3" - "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/services/signatures/secp256k1" + "go.dedis.ch/kyber/v3" ) // PrivateKey represents the secret used to construct a VRF proof. diff --git a/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/keystore/vrf.go b/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/keystore/vrf.go index 68951150..99eecd8c 100644 --- a/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/keystore/vrf.go +++ b/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/keystore/vrf.go @@ -5,7 +5,6 @@ import ( "math/big" "github.com/pkg/errors" - "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/services/keystore/keys/vrfkey" ) diff --git a/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/signatures/secp256k1/curve.go b/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/signatures/secp256k1/curve.go index 2ed52a87..86018c5a 100644 --- a/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/signatures/secp256k1/curve.go +++ b/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/signatures/secp256k1/curve.go @@ -13,7 +13,6 @@ import ( "math/big" secp256k1BTCD "github.com/btcsuite/btcd/btcec" - "go.dedis.ch/kyber/v3" ) @@ -29,6 +28,7 @@ var s256 *secp256k1BTCD.KoblitzCurve = secp256k1BTCD.S256() func (*Secp256k1) String() string { return "Secp256k1" } var egScalar kyber.Scalar = newScalar(big.NewInt(0)) + var egPoint kyber.Point = &secp256k1Point{newFieldZero(), newFieldZero()} // ScalarLen returns the length of a marshalled Scalar diff --git a/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/signatures/secp256k1/field.go b/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/signatures/secp256k1/field.go index 7cfa7af2..db8a88e7 100644 --- a/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/signatures/secp256k1/field.go +++ b/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/signatures/secp256k1/field.go @@ -53,6 +53,7 @@ func fieldEltFromInt(v int64) *fieldElt { } var fieldZero = fieldEltFromInt(0) + var bigZero = big.NewInt(0) // String returns the string representation of f @@ -156,6 +157,7 @@ func maybeSqrtInField(v *fieldElt) *fieldElt { } var three = big.NewInt(3) + var seven = fieldEltFromInt(7) // rightHandSide returns the RHS of the secp256k1 equation, x³+7 mod q, given x diff --git a/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/signatures/secp256k1/public_key.go b/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/signatures/secp256k1/public_key.go index b7db0119..904650ad 100644 --- a/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/signatures/secp256k1/public_key.go +++ b/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/signatures/secp256k1/public_key.go @@ -4,13 +4,11 @@ import ( "database/sql/driver" "fmt" - "github.com/pkg/errors" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" - "go.dedis.ch/kyber/v3" - + "github.com/pkg/errors" "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/utils" + "go.dedis.ch/kyber/v3" ) // PublicKey is a secp256k1 point in compressed format diff --git a/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/signatures/secp256k1/scalar.go b/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/signatures/secp256k1/scalar.go index 9d89188c..10d4acc2 100644 --- a/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/signatures/secp256k1/scalar.go +++ b/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/signatures/secp256k1/scalar.go @@ -21,12 +21,12 @@ import ( secp256k1BTCD "github.com/btcsuite/btcd/btcec" "github.com/ethereum/go-ethereum/common" - "go.dedis.ch/kyber/v3" "go.dedis.ch/kyber/v3/util/random" ) var GroupOrder = secp256k1BTCD.S256().N + var FieldSize = secp256k1BTCD.S256().P type secp256k1Scalar big.Int diff --git a/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/signatures/secp256k1/suite.go b/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/signatures/secp256k1/suite.go index 605f0828..70dcb4a4 100644 --- a/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/signatures/secp256k1/suite.go +++ b/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/signatures/secp256k1/suite.go @@ -15,12 +15,11 @@ import ( "io" "reflect" - "golang.org/x/crypto/sha3" - "go.dedis.ch/fixbuf" "go.dedis.ch/kyber/v3" "go.dedis.ch/kyber/v3/util/random" "go.dedis.ch/kyber/v3/xof/blake2xb" + "golang.org/x/crypto/sha3" ) // SuiteSecp256k1 implements some basic functionalities such as Group, HashFactory, @@ -58,8 +57,11 @@ func (s *SuiteSecp256k1) Write(w io.Writer, objs ...interface{}) error { } var aScalar kyber.Scalar + var tScalar = reflect.TypeOf(aScalar) + var aPoint kyber.Point + var tPoint = reflect.TypeOf(aPoint) // New implements the kyber.Encoding interface, and returns a new element of diff --git a/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/vrf/integration_v2_test.go b/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/vrf/integration_v2_test.go index 457eaa8e..fdade43e 100644 --- a/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/vrf/integration_v2_test.go +++ b/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/vrf/integration_v2_test.go @@ -4,15 +4,12 @@ import ( "math/big" "testing" - "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/services/signatures/secp256k1" - - "github.com/ethereum/go-ethereum/core/types" - - "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/gethwrappers/generated/vrf_coordinator_v2" - "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" "github.com/stretchr/testify/require" + "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/gethwrappers/generated/vrf_coordinator_v2" "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/services/keystore" + "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/services/signatures/secp256k1" "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/services/vrf/proof" ) diff --git a/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/vrf/proof/proof_response.go b/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/vrf/proof/proof_response.go index 03790207..13fa8934 100644 --- a/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/vrf/proof/proof_response.go +++ b/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/vrf/proof/proof_response.go @@ -6,14 +6,12 @@ package proof import ( "math/big" - "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/gethwrappers/generated/vrf_coordinator_v2" - "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/services/signatures/secp256k1" - "github.com/ethereum/go-ethereum/common" "github.com/pkg/errors" - + "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/gethwrappers/generated/vrf_coordinator_v2" "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/services/keystore" "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/services/keystore/keys/vrfkey" + "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/services/signatures/secp256k1" "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/utils" ) diff --git a/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/vrf/proof/seed.go b/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/vrf/proof/seed.go index c3b8840a..ea4f1fd5 100644 --- a/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/vrf/proof/seed.go +++ b/how-to/2.deploy-vrf/vrf-provider/chainlink/core/services/vrf/proof/seed.go @@ -6,7 +6,6 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" - "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/utils" ) diff --git a/how-to/2.deploy-vrf/vrf-provider/chainlink/core/utils/utils.go b/how-to/2.deploy-vrf/vrf-provider/chainlink/core/utils/utils.go index f00a2d82..4740b5cb 100644 --- a/how-to/2.deploy-vrf/vrf-provider/chainlink/core/utils/utils.go +++ b/how-to/2.deploy-vrf/vrf-provider/chainlink/core/utils/utils.go @@ -8,7 +8,6 @@ import ( "encoding/hex" "encoding/json" "fmt" - "github.com/robfig/cron/v3" "io" "math/big" mrand "math/rand" @@ -17,18 +16,18 @@ import ( "sync" "time" - cryptop2p "github.com/libp2p/go-libp2p-core/crypto" - "golang.org/x/exp/constraints" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/jpillora/backoff" + cryptop2p "github.com/libp2p/go-libp2p-core/crypto" "github.com/libp2p/go-libp2p-core/peer" "github.com/pkg/errors" + "github.com/robfig/cron/v3" uuid "github.com/satori/go.uuid" "go.uber.org/atomic" "golang.org/x/crypto/bcrypt" "golang.org/x/crypto/sha3" + "golang.org/x/exp/constraints" ) const ( diff --git a/how-to/2.deploy-vrf/vrf-provider/cmd/genkey.go b/how-to/2.deploy-vrf/vrf-provider/cmd/genkey.go index d1895598..7da13a4c 100644 --- a/how-to/2.deploy-vrf/vrf-provider/cmd/genkey.go +++ b/how-to/2.deploy-vrf/vrf-provider/cmd/genkey.go @@ -4,7 +4,6 @@ import ( "fmt" "github.com/spf13/cobra" - "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/services/keystore" ) diff --git a/how-to/2.deploy-vrf/vrf-provider/internal/app/client/repostitory/eth/client.go b/how-to/2.deploy-vrf/vrf-provider/internal/app/client/repostitory/eth/client.go index 4fee6a65..b50481a9 100644 --- a/how-to/2.deploy-vrf/vrf-provider/internal/app/client/repostitory/eth/client.go +++ b/how-to/2.deploy-vrf/vrf-provider/internal/app/client/repostitory/eth/client.go @@ -6,27 +6,23 @@ import ( "math/big" "time" - "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/services/signatures/secp256k1" - - "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/services/keystore" - "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/services/keystore/keys/vrfkey" - - "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/services/vrf/proof" - "gitlab.bianjie.ai/avata/contracts/vrf-provider/internal/app/client/repostitory/eth/contracts" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" gethcmn "github.com/ethereum/go-ethereum/common" gethtypes "github.com/ethereum/go-ethereum/core/types" gethcrypto "github.com/ethereum/go-ethereum/crypto" - gethethclient "github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/ethclient/gethclient" gethrpc "github.com/ethereum/go-ethereum/rpc" + "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/services/keystore" + "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/services/keystore/keys/vrfkey" + "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/services/signatures/secp256k1" + "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/services/vrf/proof" + "gitlab.bianjie.ai/avata/contracts/vrf-provider/internal/app/client/repostitory/eth/contracts" ) const CtxTimeout = 10 * time.Second + const TryGetGasPriceTimeInterval = 10 * time.Second type Eth struct { diff --git a/how-to/2.deploy-vrf/vrf-provider/internal/app/client/repostitory/eth/client_test.go b/how-to/2.deploy-vrf/vrf-provider/internal/app/client/repostitory/eth/client_test.go index 321b2b77..7b40d996 100644 --- a/how-to/2.deploy-vrf/vrf-provider/internal/app/client/repostitory/eth/client_test.go +++ b/how-to/2.deploy-vrf/vrf-provider/internal/app/client/repostitory/eth/client_test.go @@ -3,18 +3,13 @@ package eth import ( "testing" - "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/services/signatures/secp256k1" - "github.com/ethereum/go-ethereum/common" - - "gitlab.bianjie.ai/avata/contracts/vrf-provider/internal/app/client/repostitory/eth/contracts" - - "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/services/vrf/proof" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/stretchr/testify/require" "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/services/keystore" + "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/services/signatures/secp256k1" + "gitlab.bianjie.ai/avata/contracts/vrf-provider/chainlink/core/services/vrf/proof" + "gitlab.bianjie.ai/avata/contracts/vrf-provider/internal/app/client/repostitory/eth/contracts" ) const ( diff --git a/how-to/2.deploy-vrf/vrf-provider/internal/app/client/services/channels/channels.go b/how-to/2.deploy-vrf/vrf-provider/internal/app/client/services/channels/channels.go index e1c1ad2b..570a621d 100644 --- a/how-to/2.deploy-vrf/vrf-provider/internal/app/client/services/channels/channels.go +++ b/how-to/2.deploy-vrf/vrf-provider/internal/app/client/services/channels/channels.go @@ -11,6 +11,7 @@ import ( ) const RetryTimeout = 10 * time.Second + const RetryTimes = 20 type IChannel interface { diff --git a/how-to/2.deploy-vrf/vrf-provider/internal/app/client/services/channels/writer_mw.go b/how-to/2.deploy-vrf/vrf-provider/internal/app/client/services/channels/writer_mw.go index 4845500f..886a540c 100644 --- a/how-to/2.deploy-vrf/vrf-provider/internal/app/client/services/channels/writer_mw.go +++ b/how-to/2.deploy-vrf/vrf-provider/internal/app/client/services/channels/writer_mw.go @@ -2,7 +2,6 @@ package channels import ( log "github.com/sirupsen/logrus" - "gitlab.bianjie.ai/avata/contracts/vrf-provider/internal/app/client/domain" ) diff --git a/how-to/2.deploy-vrf/vrf-provider/internal/app/client/services/listener.go b/how-to/2.deploy-vrf/vrf-provider/internal/app/client/services/listener.go index db81bee3..12f7d94a 100644 --- a/how-to/2.deploy-vrf/vrf-provider/internal/app/client/services/listener.go +++ b/how-to/2.deploy-vrf/vrf-provider/internal/app/client/services/listener.go @@ -5,9 +5,8 @@ import ( "sync" "time" - "gitlab.bianjie.ai/avata/contracts/vrf-provider/internal/app/client/services/channels" - log "github.com/sirupsen/logrus" + "gitlab.bianjie.ai/avata/contracts/vrf-provider/internal/app/client/services/channels" ) const DefaultTimeout = 10 diff --git a/how-to/2.deploy-vrf/vrf-provider/internal/pkg/initialization/channel.go b/how-to/2.deploy-vrf/vrf-provider/internal/pkg/initialization/channel.go index 87984875..5bbbdca3 100644 --- a/how-to/2.deploy-vrf/vrf-provider/internal/pkg/initialization/channel.go +++ b/how-to/2.deploy-vrf/vrf-provider/internal/pkg/initialization/channel.go @@ -6,14 +6,12 @@ import ( "os" "path" - "gitlab.bianjie.ai/avata/contracts/vrf-provider/tools" - log "github.com/sirupsen/logrus" - "gitlab.bianjie.ai/avata/contracts/vrf-provider/internal/app/client/repostitory" "gitlab.bianjie.ai/avata/contracts/vrf-provider/internal/app/client/services/channels" "gitlab.bianjie.ai/avata/contracts/vrf-provider/internal/pkg/configs" "gitlab.bianjie.ai/avata/contracts/vrf-provider/internal/pkg/types/cache" + "gitlab.bianjie.ai/avata/contracts/vrf-provider/tools" ) const TypSource = "source" diff --git a/how-to/2.deploy-vrf/vrf-provider/internal/pkg/initialization/logger.go b/how-to/2.deploy-vrf/vrf-provider/internal/pkg/initialization/logger.go index dc172e98..143055f7 100644 --- a/how-to/2.deploy-vrf/vrf-provider/internal/pkg/initialization/logger.go +++ b/how-to/2.deploy-vrf/vrf-provider/internal/pkg/initialization/logger.go @@ -2,7 +2,6 @@ package initialization import ( log "github.com/sirupsen/logrus" - "gitlab.bianjie.ai/avata/contracts/vrf-provider/internal/pkg/configs" ) diff --git a/how-to/2.deploy-vrf/vrf-provider/internal/pkg/initialization/services.go b/how-to/2.deploy-vrf/vrf-provider/internal/pkg/initialization/services.go index aec30c8e..498ef8a2 100644 --- a/how-to/2.deploy-vrf/vrf-provider/internal/pkg/initialization/services.go +++ b/how-to/2.deploy-vrf/vrf-provider/internal/pkg/initialization/services.go @@ -2,7 +2,6 @@ package initialization import ( log "github.com/sirupsen/logrus" - "gitlab.bianjie.ai/avata/contracts/vrf-provider/internal/app/client/repostitory" repoeth "gitlab.bianjie.ai/avata/contracts/vrf-provider/internal/app/client/repostitory/eth" "gitlab.bianjie.ai/avata/contracts/vrf-provider/internal/pkg/configs" diff --git a/how-to/2.deploy-vrf/vrf-provider/tools/global.go b/how-to/2.deploy-vrf/vrf-provider/tools/global.go index a9e2f2f1..0b6e4067 100644 --- a/how-to/2.deploy-vrf/vrf-provider/tools/global.go +++ b/how-to/2.deploy-vrf/vrf-provider/tools/global.go @@ -6,8 +6,11 @@ import ( ) const DefaultHomeDirName = ".vrf-provider" + const DefaultConfigDirName = "configs" + const DefaultConfigName = "config.toml" + const DefaultCacheDirName = "cache" var ( diff --git a/lite/swagger.go b/lite/swagger.go index 532ce7d8..b7dfa4e7 100644 --- a/lite/swagger.go +++ b/lite/swagger.go @@ -3,11 +3,10 @@ package lite import ( "net/http" + "github.com/cosmos/cosmos-sdk/client" "github.com/gorilla/mux" "github.com/rakyll/statik/fs" - "github.com/cosmos/cosmos-sdk/client" - _ "github.com/bianjieai/irita/lite/statik" ) diff --git a/modules/evm/client/export.go b/modules/evm/client/export.go index 64975fa7..70fcd7e1 100644 --- a/modules/evm/client/export.go +++ b/modules/evm/client/export.go @@ -8,12 +8,11 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/input" "github.com/cosmos/cosmos-sdk/crypto" + "github.com/cosmos/cosmos-sdk/crypto/keyring" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/common/hexutil" ethcrypto "github.com/ethereum/go-ethereum/crypto" "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/tharsis/ethermint/crypto/ethsecp256k1" "github.com/tharsis/ethermint/crypto/hd" ) diff --git a/modules/evm/client/import.go b/modules/evm/client/import.go index baa76195..55f5e31a 100644 --- a/modules/evm/client/import.go +++ b/modules/evm/client/import.go @@ -3,16 +3,14 @@ package client import ( "bufio" - "github.com/spf13/cobra" - "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/input" "github.com/cosmos/cosmos-sdk/crypto" "github.com/cosmos/cosmos-sdk/crypto/keyring" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/common" + "github.com/spf13/cobra" "github.com/tharsis/ethermint/crypto/ethsecp256k1" - "github.com/tharsis/ethermint/crypto/hd" ) diff --git a/modules/evm/eth.go b/modules/evm/eth.go index 3b51c616..0bd727b8 100644 --- a/modules/evm/eth.go +++ b/modules/evm/eth.go @@ -3,20 +3,17 @@ package evm import ( "math/big" - "github.com/tharsis/ethermint/crypto/ethsecp256k1" - sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" authante "github.com/cosmos/cosmos-sdk/x/auth/ante" authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" - - evmcrypto "github.com/bianjieai/irita/modules/evm/crypto" - + "github.com/ethereum/go-ethereum/common" + ethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/tharsis/ethermint/crypto/ethsecp256k1" ethermint "github.com/tharsis/ethermint/types" evmtypes "github.com/tharsis/ethermint/x/evm/types" - "github.com/ethereum/go-ethereum/common" - ethtypes "github.com/ethereum/go-ethereum/core/types" + evmcrypto "github.com/bianjieai/irita/modules/evm/crypto" ) // EthSigVerificationDecorator validates an ethereum signatures diff --git a/modules/evm/interfaces.go b/modules/evm/interfaces.go index 6789faf2..65835ae3 100644 --- a/modules/evm/interfaces.go +++ b/modules/evm/interfaces.go @@ -3,10 +3,9 @@ package evm import ( "math/big" - "github.com/cosmos/cosmos-sdk/x/feegrant" - sdk "github.com/cosmos/cosmos-sdk/types" tx "github.com/cosmos/cosmos-sdk/types/tx" + "github.com/cosmos/cosmos-sdk/x/feegrant" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/vm" diff --git a/modules/evm/rpc/apis.go b/modules/evm/rpc/apis.go index 3e493fc1..227e60e4 100644 --- a/modules/evm/rpc/apis.go +++ b/modules/evm/rpc/apis.go @@ -5,9 +5,8 @@ package rpc import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/server" - "github.com/ethereum/go-ethereum/rpc" - + rpcclient "github.com/tendermint/tendermint/rpc/jsonrpc/client" "github.com/tharsis/ethermint/rpc/ethereum/namespaces/debug" "github.com/tharsis/ethermint/rpc/ethereum/namespaces/eth" "github.com/tharsis/ethermint/rpc/ethereum/namespaces/eth/filters" @@ -19,8 +18,6 @@ import ( "github.com/tharsis/ethermint/rpc/ethereum/types" "github.com/bianjieai/irita/modules/evm/rpc/ethereum/backend" - - rpcclient "github.com/tendermint/tendermint/rpc/jsonrpc/client" ) // RPC namespaces and API version diff --git a/modules/evm/rpc/ethereum/backend/backend.go b/modules/evm/rpc/ethereum/backend/backend.go index 1695cc0d..035140f6 100644 --- a/modules/evm/rpc/ethereum/backend/backend.go +++ b/modules/evm/rpc/ethereum/backend/backend.go @@ -5,14 +5,6 @@ import ( "fmt" "math/big" - "github.com/tharsis/ethermint/crypto/ethsecp256k1" - - ethtypes "github.com/ethereum/go-ethereum/core/types" - - "github.com/bianjieai/irita/modules/evm/crypto" - - "github.com/tendermint/tendermint/libs/log" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -22,9 +14,14 @@ import ( authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/common" + ethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/tendermint/tendermint/libs/log" + "github.com/tharsis/ethermint/crypto/ethsecp256k1" "github.com/tharsis/ethermint/rpc/ethereum/backend" "github.com/tharsis/ethermint/rpc/ethereum/types" evmtypes "github.com/tharsis/ethermint/x/evm/types" + + "github.com/bianjieai/irita/modules/evm/crypto" ) type EVMWBackend struct { diff --git a/modules/evm/server/json_rpc.go b/modules/evm/server/json_rpc.go index 53a25460..33c17909 100644 --- a/modules/evm/server/json_rpc.go +++ b/modules/evm/server/json_rpc.go @@ -4,16 +4,14 @@ import ( "net/http" "time" - "github.com/gorilla/mux" - "github.com/rs/cors" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/server" "github.com/cosmos/cosmos-sdk/server/types" ethlog "github.com/ethereum/go-ethereum/log" ethrpc "github.com/ethereum/go-ethereum/rpc" + "github.com/gorilla/mux" + "github.com/rs/cors" "github.com/tharsis/ethermint/rpc" - "github.com/tharsis/ethermint/server/config" iritaevmrpc "github.com/bianjieai/irita/modules/evm/rpc" diff --git a/modules/evm/server/start.go b/modules/evm/server/start.go index 97f1d33a..f73f4d1d 100644 --- a/modules/evm/server/start.go +++ b/modules/evm/server/start.go @@ -11,13 +11,20 @@ import ( "strings" "time" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/crypto/keyring" - + "github.com/cosmos/cosmos-sdk/server" + "github.com/cosmos/cosmos-sdk/server/api" + serverconfig "github.com/cosmos/cosmos-sdk/server/config" + servergrpc "github.com/cosmos/cosmos-sdk/server/grpc" + "github.com/cosmos/cosmos-sdk/server/rosetta" + crgserver "github.com/cosmos/cosmos-sdk/server/rosetta/lib/server" + "github.com/cosmos/cosmos-sdk/server/types" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/spf13/cobra" - - "google.golang.org/grpc" - abciserver "github.com/tendermint/tendermint/abci/server" tcmd "github.com/tendermint/tendermint/cmd/tendermint/commands" tmos "github.com/tendermint/tendermint/libs/os" @@ -27,23 +34,10 @@ import ( "github.com/tendermint/tendermint/proxy" "github.com/tendermint/tendermint/rpc/client/local" dbm "github.com/tendermint/tm-db" - - "github.com/cosmos/cosmos-sdk/server/rosetta" - crgserver "github.com/cosmos/cosmos-sdk/server/rosetta/lib/server" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/server" - "github.com/cosmos/cosmos-sdk/server/api" - serverconfig "github.com/cosmos/cosmos-sdk/server/config" - servergrpc "github.com/cosmos/cosmos-sdk/server/grpc" - "github.com/cosmos/cosmos-sdk/server/types" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" - ethdebug "github.com/tharsis/ethermint/rpc/ethereum/namespaces/debug" "github.com/tharsis/ethermint/server/config" srvflags "github.com/tharsis/ethermint/server/flags" + "google.golang.org/grpc" ) // StartCmd runs the service passed in, either stand-alone or in-process with diff --git a/modules/evm/server/util.go b/modules/evm/server/util.go index 20010f33..54aa26c9 100644 --- a/modules/evm/server/util.go +++ b/modules/evm/server/util.go @@ -4,14 +4,12 @@ import ( "net/http" "time" - "github.com/gorilla/mux" - "github.com/improbable-eng/grpc-web/go/grpcweb" - "github.com/spf13/cobra" - sdkserver "github.com/cosmos/cosmos-sdk/server" "github.com/cosmos/cosmos-sdk/server/types" "github.com/cosmos/cosmos-sdk/version" - + "github.com/gorilla/mux" + "github.com/improbable-eng/grpc-web/go/grpcweb" + "github.com/spf13/cobra" tmlog "github.com/tendermint/tendermint/libs/log" rpcclient "github.com/tendermint/tendermint/rpc/jsonrpc/client" ) diff --git a/modules/tibc/client/cli/tx.go b/modules/tibc/client/cli/tx.go index 31aef851..c3465696 100644 --- a/modules/tibc/client/cli/tx.go +++ b/modules/tibc/client/cli/tx.go @@ -4,18 +4,15 @@ import ( "io/ioutil" "strings" - "github.com/spf13/cobra" - - "github.com/pkg/errors" - + "github.com/bianjieai/tibc-go/modules/tibc/core/02-client/client/cli" + packet "github.com/bianjieai/tibc-go/modules/tibc/core/04-packet" + "github.com/bianjieai/tibc-go/modules/tibc/core/exported" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" "github.com/cosmos/cosmos-sdk/codec" - - "github.com/bianjieai/tibc-go/modules/tibc/core/02-client/client/cli" - packet "github.com/bianjieai/tibc-go/modules/tibc/core/04-packet" - "github.com/bianjieai/tibc-go/modules/tibc/core/exported" + "github.com/pkg/errors" + "github.com/spf13/cobra" tibcrouting "github.com/bianjieai/irita/modules/tibc/routing/cli" "github.com/bianjieai/irita/modules/tibc/types" diff --git a/modules/tibc/handler.go b/modules/tibc/handler.go index d2998d03..cf086ae8 100644 --- a/modules/tibc/handler.go +++ b/modules/tibc/handler.go @@ -1,9 +1,8 @@ package tibc import ( - sdk "github.com/cosmos/cosmos-sdk/types" - tibc "github.com/bianjieai/tibc-go/modules/tibc/core" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/bianjieai/irita/modules/tibc/keeper" clienttypes "github.com/bianjieai/irita/modules/tibc/types" diff --git a/modules/tibc/keeper/keeper.go b/modules/tibc/keeper/keeper.go index 47b9f0ca..8dc8203d 100644 --- a/modules/tibc/keeper/keeper.go +++ b/modules/tibc/keeper/keeper.go @@ -1,10 +1,9 @@ package keeper import ( - sdk "github.com/cosmos/cosmos-sdk/types" - tibcnfttypes "github.com/bianjieai/tibc-go/modules/tibc/apps/nft_transfer/types" tibckeeper "github.com/bianjieai/tibc-go/modules/tibc/core/keeper" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/irisnet/irismod/modules/nft/exported" nftkeeper "github.com/irisnet/irismod/modules/nft/keeper" nfttypes "github.com/irisnet/irismod/modules/nft/types" diff --git a/modules/tibc/keeper/msg_server.go b/modules/tibc/keeper/msg_server.go index 9fc698e6..b6b759b9 100644 --- a/modules/tibc/keeper/msg_server.go +++ b/modules/tibc/keeper/msg_server.go @@ -3,9 +3,8 @@ package keeper import ( "context" - sdk "github.com/cosmos/cosmos-sdk/types" - clienttypes "github.com/bianjieai/tibc-go/modules/tibc/core/02-client/types" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/bianjieai/irita/modules/tibc/types" ) @@ -45,6 +44,7 @@ func (k Keeper) UpgradeClient(ctx context.Context, msg *types.MsgUpgradeClient) consensusState, ) } + func (k Keeper) RegisterRelayer(ctx context.Context, msg *types.MsgRegisterRelayer) (*types.MsgRegisterRelayerResponse, error) { k.ClientKeeper.RegisterRelayers( diff --git a/modules/tibc/module.go b/modules/tibc/module.go index 8524e920..699c0da0 100644 --- a/modules/tibc/module.go +++ b/modules/tibc/module.go @@ -1,21 +1,19 @@ package tibc import ( - "github.com/bianjieai/irita/modules/tibc/client/cli" - "github.com/bianjieai/irita/modules/tibc/keeper" - tibctypes "github.com/bianjieai/irita/modules/tibc/types" - tibc "github.com/bianjieai/tibc-go/modules/tibc/core" clienttypes "github.com/bianjieai/tibc-go/modules/tibc/core/02-client/types" packettypes "github.com/bianjieai/tibc-go/modules/tibc/core/04-packet/types" host "github.com/bianjieai/tibc-go/modules/tibc/core/24-host" "github.com/bianjieai/tibc-go/modules/tibc/core/types" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/spf13/cobra" + + "github.com/bianjieai/irita/modules/tibc/client/cli" + "github.com/bianjieai/irita/modules/tibc/keeper" + tibctypes "github.com/bianjieai/irita/modules/tibc/types" ) var ( diff --git a/modules/tibc/routing/cli/tx.go b/modules/tibc/routing/cli/tx.go index 29438784..3c9eaa2d 100644 --- a/modules/tibc/routing/cli/tx.go +++ b/modules/tibc/routing/cli/tx.go @@ -4,13 +4,13 @@ import ( "encoding/json" "io/ioutil" - tibctypes "github.com/bianjieai/irita/modules/tibc/types" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" "github.com/pkg/errors" "github.com/spf13/cobra" + + tibctypes "github.com/bianjieai/irita/modules/tibc/types" ) // NewSetRoutingRulesCmd implements a command handler for submitting a setting rules proposal transaction. diff --git a/modules/tibc/types/msgs.go b/modules/tibc/types/msgs.go index 66cf65f0..b0c08ba6 100644 --- a/modules/tibc/types/msgs.go +++ b/modules/tibc/types/msgs.go @@ -4,7 +4,6 @@ import ( tibctypes "github.com/bianjieai/tibc-go/modules/tibc/core/02-client/types" tibchost "github.com/bianjieai/tibc-go/modules/tibc/core/24-host" "github.com/bianjieai/tibc-go/modules/tibc/core/exported" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" diff --git a/simapp/app.go b/simapp/app.go index 86e2d652..03ee382f 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -5,6 +5,13 @@ import ( "os" "path/filepath" + tibcnfttransfer "github.com/bianjieai/tibc-go/modules/tibc/apps/nft_transfer" + tibcnfttransferkeeper "github.com/bianjieai/tibc-go/modules/tibc/apps/nft_transfer/keeper" + tibcnfttypes "github.com/bianjieai/tibc-go/modules/tibc/apps/nft_transfer/types" + tibchost "github.com/bianjieai/tibc-go/modules/tibc/core/24-host" + tibcroutingtypes "github.com/bianjieai/tibc-go/modules/tibc/core/26-routing/types" + tibccorekeeper "github.com/bianjieai/tibc-go/modules/tibc/core/keeper" + tibcmock "github.com/bianjieai/tibc-go/modules/tibc/testing/mock" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/rpc" @@ -49,12 +56,6 @@ import ( stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" sdkupgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" - "github.com/spf13/cast" - abci "github.com/tendermint/tendermint/abci/types" - "github.com/tendermint/tendermint/libs/log" - tmos "github.com/tendermint/tendermint/libs/os" - dbm "github.com/tendermint/tm-db" - "github.com/irisnet/irismod/modules/nft" nftkeeper "github.com/irisnet/irismod/modules/nft/keeper" nfttypes "github.com/irisnet/irismod/modules/nft/types" @@ -73,7 +74,15 @@ import ( "github.com/irisnet/irismod/modules/token" tokenkeeper "github.com/irisnet/irismod/modules/token/keeper" tokentypes "github.com/irisnet/irismod/modules/token/types" + "github.com/spf13/cast" + abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/libs/log" + tmos "github.com/tendermint/tendermint/libs/os" + dbm "github.com/tendermint/tm-db" + "github.com/bianjieai/irita/lite" + tibc "github.com/bianjieai/irita/modules/tibc" + tibckeeper "github.com/bianjieai/irita/modules/tibc/keeper" "github.com/bianjieai/iritamod/modules/genutil" genutiltypes "github.com/bianjieai/iritamod/modules/genutil" "github.com/bianjieai/iritamod/modules/identity" @@ -87,19 +96,6 @@ import ( "github.com/bianjieai/iritamod/modules/upgrade" upgradekeeper "github.com/bianjieai/iritamod/modules/upgrade/keeper" upgradetypes "github.com/bianjieai/iritamod/modules/upgrade/types" - - "github.com/bianjieai/irita/lite" - - tibc "github.com/bianjieai/irita/modules/tibc" - tibckeeper "github.com/bianjieai/irita/modules/tibc/keeper" - - tibcnfttransfer "github.com/bianjieai/tibc-go/modules/tibc/apps/nft_transfer" - tibcnfttransferkeeper "github.com/bianjieai/tibc-go/modules/tibc/apps/nft_transfer/keeper" - tibcnfttypes "github.com/bianjieai/tibc-go/modules/tibc/apps/nft_transfer/types" - tibchost "github.com/bianjieai/tibc-go/modules/tibc/core/24-host" - tibcroutingtypes "github.com/bianjieai/tibc-go/modules/tibc/core/26-routing/types" - tibccorekeeper "github.com/bianjieai/tibc-go/modules/tibc/core/keeper" - tibcmock "github.com/bianjieai/tibc-go/modules/tibc/testing/mock" ) const appName = "SimApp" diff --git a/simapp/export.go b/simapp/export.go index b79158c7..36943a29 100644 --- a/simapp/export.go +++ b/simapp/export.go @@ -3,11 +3,10 @@ package simapp import ( "encoding/json" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/bianjieai/iritamod/modules/node" ) diff --git a/simapp/test_helpers.go b/simapp/test_helpers.go index 1158d5b4..edfd2597 100644 --- a/simapp/test_helpers.go +++ b/simapp/test_helpers.go @@ -9,14 +9,6 @@ import ( "testing" "time" - "github.com/stretchr/testify/require" - - abci "github.com/tendermint/tendermint/abci/types" - "github.com/tendermint/tendermint/libs/log" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtypes "github.com/tendermint/tendermint/types" - dbm "github.com/tendermint/tm-db" - bam "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" @@ -31,6 +23,12 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/libs/log" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + tmtypes "github.com/tendermint/tendermint/types" + dbm "github.com/tendermint/tm-db" "github.com/bianjieai/iritamod/modules/node" ) diff --git a/wallet/init.go b/wallet/init.go index 6334afa5..04670220 100644 --- a/wallet/init.go +++ b/wallet/init.go @@ -5,12 +5,11 @@ import ( "errors" "io" - "github.com/spf13/cobra" - "github.com/spf13/viper" - "github.com/cosmos/cosmos-sdk/client/input" "github.com/cosmos/cosmos-sdk/crypto/hd" cosmoskeyring "github.com/cosmos/cosmos-sdk/crypto/keyring" + "github.com/spf13/cobra" + "github.com/spf13/viper" "github.com/bianjieai/irita/wallet/keyring" ) diff --git a/wallet/keyring/crypto.go b/wallet/keyring/crypto.go index 569bf820..d93518a4 100644 --- a/wallet/keyring/crypto.go +++ b/wallet/keyring/crypto.go @@ -4,17 +4,15 @@ import ( "encoding/hex" "fmt" + "github.com/cosmos/cosmos-sdk/crypto/hd" + "github.com/cosmos/cosmos-sdk/crypto/keyring" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/pkg/errors" - tmbcrypt "github.com/tendermint/crypto/bcrypt" "github.com/tendermint/tendermint/crypto" "github.com/tendermint/tendermint/crypto/armor" "github.com/tendermint/tendermint/crypto/tmhash" "github.com/tendermint/tendermint/crypto/xsalsa20symmetric" - - "github.com/cosmos/cosmos-sdk/crypto/hd" - "github.com/cosmos/cosmos-sdk/crypto/keyring" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" ) const ( diff --git a/wallet/keyring/file_keyring.go b/wallet/keyring/file_keyring.go index 433f3ea8..2ee0a434 100644 --- a/wallet/keyring/file_keyring.go +++ b/wallet/keyring/file_keyring.go @@ -15,11 +15,10 @@ import ( "time" "github.com/99designs/keyring" + "github.com/cosmos/cosmos-sdk/client/input" jose "github.com/dvsekhvalnov/jose2go" "github.com/mitchellh/go-homedir" "github.com/mtibben/percent" - - "github.com/cosmos/cosmos-sdk/client/input" ) var ( diff --git a/wallet/keyring/info.go b/wallet/keyring/info.go index f02f9bd9..c94c4b38 100644 --- a/wallet/keyring/info.go +++ b/wallet/keyring/info.go @@ -4,8 +4,6 @@ import ( "fmt" "io" - "github.com/ghodss/yaml" - "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" @@ -13,6 +11,7 @@ import ( cosmoskeyring "github.com/cosmos/cosmos-sdk/crypto/keyring" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ghodss/yaml" ) type rootInfo struct { diff --git a/wallet/keyring/keyring.go b/wallet/keyring/keyring.go index c7f40f47..9e52659f 100644 --- a/wallet/keyring/keyring.go +++ b/wallet/keyring/keyring.go @@ -10,7 +10,6 @@ import ( "strings" "github.com/99designs/keyring" - "github.com/cosmos/cosmos-sdk/client/input" "github.com/cosmos/cosmos-sdk/crypto/hd" cosmoskeyring "github.com/cosmos/cosmos-sdk/crypto/keyring" diff --git a/wallet/keys/show.go b/wallet/keys/show.go index c126998b..f784719a 100644 --- a/wallet/keys/show.go +++ b/wallet/keys/show.go @@ -3,10 +3,9 @@ package keys import ( "bufio" - "github.com/spf13/cobra" - cosmoskeyring "github.com/cosmos/cosmos-sdk/crypto/keyring" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/spf13/cobra" "github.com/bianjieai/irita/wallet/keyring" ) diff --git a/wallet/update.go b/wallet/update.go index f8c29bd4..52f8885d 100644 --- a/wallet/update.go +++ b/wallet/update.go @@ -5,10 +5,9 @@ import ( "errors" "fmt" + "github.com/cosmos/cosmos-sdk/client/input" "github.com/spf13/cobra" "github.com/spf13/viper" - - "github.com/cosmos/cosmos-sdk/client/input" ) func UpdateCmd() *cobra.Command {