diff --git a/Makefile b/Makefile index 1e2805b22..9c8a00e2d 100644 --- a/Makefile +++ b/Makefile @@ -202,15 +202,14 @@ test-sim-multi-seed-short: runsim ############################################################################### lint: - golangci-lint run - find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "*_test.go" | xargs gofmt -d -s + golangci-lint run --skip-files ".*.pb.go" + find . -name '*.go' -not -name "*.pb.go" -type f -not -path "./vendor*" -not -path "*.git*" -not -path "*_test.go" | xargs gofmt -d -s format: @go install mvdan.cc/gofumpt@latest @go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION) - find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" -not -path "./tests/mocks/*" -not -name "*.pb.go" -not -name "*.pb.gw.go" -not -name "*.pulsar.go" -not -path "./crypto/keys/secp256k1/*" | xargs gofumpt -w -l - golangci-lint run --fix - goimports -w -local github.com/neutron-org . + find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" -not -path "./tests/mocks/*" -not -name "*.pb.go" -not -name "*.pb.gw.go" -not -name "*.pulsar.go" -not -path "./crypto/keys/secp256k1/*" | xargs -I % sh -c 'gofumpt -w -l % && goimports -w -local github.com/neutron-org %' + golangci-lint run --fix --skip-files ".*.pb.go" .PHONY: format diff --git a/contracts/neutron_chain_manager.wasm b/contracts/neutron_chain_manager.wasm index e136f67ec..912789846 100644 Binary files a/contracts/neutron_chain_manager.wasm and b/contracts/neutron_chain_manager.wasm differ diff --git a/contrib/statesync.bash b/contrib/statesync.bash index 96d84b989..c314af9aa 100644 --- a/contrib/statesync.bash +++ b/contrib/statesync.bash @@ -70,4 +70,4 @@ NEUTROND_P2P_SEEDS=$(curl -s https://raw.githubusercontent.com/cosmos/chain-regi export NEUTROND_P2P_SEEDS # Start chain. -neutrond start --x-crisis-skip-assert-invariants --iavl-disable-fastnode false +neutrond start --x-crisis-skip-assert-invariants --iavl-disable-fastnode false --minimum-gas-prices 0untrn diff --git a/go.mod b/go.mod index e47c98848..0d6303e4a 100644 --- a/go.mod +++ b/go.mod @@ -14,14 +14,14 @@ require ( cosmossdk.io/x/tx v0.13.3 cosmossdk.io/x/upgrade v0.1.3 github.com/CosmWasm/wasmd v0.51.0 - github.com/CosmWasm/wasmvm/v2 v2.0.0 + github.com/CosmWasm/wasmvm/v2 v2.0.1 github.com/cometbft/cometbft v0.38.7 github.com/cosmos/admin-module/v2 v2.0.0-20240430142959-8b3328d1b1a2 github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/cosmos/cosmos-sdk v0.50.7 github.com/cosmos/gogoproto v1.5.0 - github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8 v8.0.1 + github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8 v8.0.2 github.com/cosmos/ibc-go/modules/capability v1.0.0 github.com/cosmos/ibc-go/v8 v8.2.1 github.com/cosmos/ics23/go v0.10.0 diff --git a/go.sum b/go.sum index 7ae72b2af..0f6d22909 100644 --- a/go.sum +++ b/go.sum @@ -227,8 +227,8 @@ github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25 github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/CosmWasm/wasmvm/v2 v2.0.0 h1:IqNCI2G0mvs7K6ej17/I28805rVqnu+Y1cWDqIdwb08= -github.com/CosmWasm/wasmvm/v2 v2.0.0/go.mod h1:su9lg5qLr7adV95eOfzjZWkGiky8WNaNIHDr7Fpu7Ck= +github.com/CosmWasm/wasmvm/v2 v2.0.1 h1:0YCQ7MKGNri7NFeRp75erPJXrqyCtH4gdc9jMstyMzk= +github.com/CosmWasm/wasmvm/v2 v2.0.1/go.mod h1:su9lg5qLr7adV95eOfzjZWkGiky8WNaNIHDr7Fpu7Ck= github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= @@ -396,8 +396,8 @@ github.com/cosmos/gogoproto v1.5.0 h1:SDVwzEqZDDBoslaeZg+dGE55hdzHfgUA40pEanMh52 github.com/cosmos/gogoproto v1.5.0/go.mod h1:iUM31aofn3ymidYG6bUR5ZFrk+Om8p5s754eMUcyp8I= github.com/cosmos/iavl v1.2.0 h1:kVxTmjTh4k0Dh1VNL046v6BXqKziqMDzxo93oh3kOfM= github.com/cosmos/iavl v1.2.0/go.mod h1:HidWWLVAtODJqFD6Hbne2Y0q3SdxByJepHUOeoH4LiI= -github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8 v8.0.1 h1:BHn+JWZILxkUT9IrlP1ctUfo9ENGi+EmiZ9om1XSHIw= -github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8 v8.0.1/go.mod h1:82hPO/tRawbuFad2gPwChvpZ0JEIoNi91LwVneAYCeM= +github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8 v8.0.2 h1:dyLNlDElY6+5zW/BT/dO/3Ad9FpQblfh+9dQpYQodbA= +github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8 v8.0.2/go.mod h1:82hPO/tRawbuFad2gPwChvpZ0JEIoNi91LwVneAYCeM= github.com/cosmos/ibc-go/modules/capability v1.0.0 h1:r/l++byFtn7jHYa09zlAdSeevo8ci1mVZNO9+V0xsLE= github.com/cosmos/ibc-go/modules/capability v1.0.0/go.mod h1:D81ZxzjZAe0ZO5ambnvn1qedsFQ8lOwtqicG6liLBco= github.com/cosmos/ibc-go/v8 v8.2.1 h1:MTsnZZjxvGD4Fv5pYyx5UkELafSX0rlPt6IfsE2BpTQ= diff --git a/testutil/tokenfactory/keeper/tokenfactory.go b/testutil/tokenfactory/keeper/tokenfactory.go index 55bbabced..d122324c1 100644 --- a/testutil/tokenfactory/keeper/tokenfactory.go +++ b/testutil/tokenfactory/keeper/tokenfactory.go @@ -14,6 +14,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" + "github.com/neutron-org/neutron/v4/testutil" "github.com/neutron-org/neutron/v4/x/tokenfactory/keeper" "github.com/neutron-org/neutron/v4/x/tokenfactory/types" ) @@ -43,7 +44,7 @@ func TokenFactoryKeeper( accountKeeper, bankKeeper, contractKeeper, - "authority", + testutil.TestOwnerAddress, ) ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) diff --git a/x/contractmanager/types/failure.pb.go b/x/contractmanager/types/failure.pb.go index 108230c3d..635899d81 100644 --- a/x/contractmanager/types/failure.pb.go +++ b/x/contractmanager/types/failure.pb.go @@ -5,12 +5,11 @@ package types import ( fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + _ "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" io "io" math "math" math_bits "math/bits" - - proto "github.com/cosmos/gogoproto/proto" - _ "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/contractmanager/types/genesis.pb.go b/x/contractmanager/types/genesis.pb.go index 198452eec..fbf415eda 100644 --- a/x/contractmanager/types/genesis.pb.go +++ b/x/contractmanager/types/genesis.pb.go @@ -5,12 +5,11 @@ package types import ( fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" - - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/contractmanager/types/params.pb.go b/x/contractmanager/types/params.pb.go index 2ca0e44c5..a3294bbd0 100644 --- a/x/contractmanager/types/params.pb.go +++ b/x/contractmanager/types/params.pb.go @@ -5,12 +5,11 @@ package types import ( fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" - - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/contractmanager/types/query.pb.go b/x/contractmanager/types/query.pb.go index 7e3209a8c..b5b0f5543 100644 --- a/x/contractmanager/types/query.pb.go +++ b/x/contractmanager/types/query.pb.go @@ -6,10 +6,6 @@ package types import ( context "context" fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - query "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" @@ -18,6 +14,9 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/contractmanager/types/tx.pb.go b/x/contractmanager/types/tx.pb.go index eaad796ed..3a69490ae 100644 --- a/x/contractmanager/types/tx.pb.go +++ b/x/contractmanager/types/tx.pb.go @@ -6,10 +6,6 @@ package types import ( context "context" fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - _ "github.com/cosmos/cosmos-proto" _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" @@ -19,6 +15,9 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/contractmanager/types/v1/failure.pb.go b/x/contractmanager/types/v1/failure.pb.go index af2f28754..597eb369b 100644 --- a/x/contractmanager/types/v1/failure.pb.go +++ b/x/contractmanager/types/v1/failure.pb.go @@ -5,11 +5,10 @@ package v1 import ( fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" - - proto "github.com/cosmos/gogoproto/proto" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/cron/types/genesis.pb.go b/x/cron/types/genesis.pb.go index 6853c1bb0..2d3546994 100644 --- a/x/cron/types/genesis.pb.go +++ b/x/cron/types/genesis.pb.go @@ -5,12 +5,11 @@ package types import ( fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" - - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/cron/types/params.pb.go b/x/cron/types/params.pb.go index 5a10eefdc..c71904ce8 100644 --- a/x/cron/types/params.pb.go +++ b/x/cron/types/params.pb.go @@ -5,12 +5,11 @@ package types import ( fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" - - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/cron/types/query.pb.go b/x/cron/types/query.pb.go index 20f19b2cc..c34c6c3f9 100644 --- a/x/cron/types/query.pb.go +++ b/x/cron/types/query.pb.go @@ -6,10 +6,6 @@ package types import ( context "context" fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - query "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" @@ -18,6 +14,9 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/cron/types/schedule.pb.go b/x/cron/types/schedule.pb.go index f9c1893cc..cda29cf72 100644 --- a/x/cron/types/schedule.pb.go +++ b/x/cron/types/schedule.pb.go @@ -5,12 +5,11 @@ package types import ( fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" - - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/cron/types/tx.pb.go b/x/cron/types/tx.pb.go index 68d972249..217bb879c 100644 --- a/x/cron/types/tx.pb.go +++ b/x/cron/types/tx.pb.go @@ -6,10 +6,6 @@ package types import ( context "context" fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - _ "github.com/cosmos/cosmos-proto" _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" @@ -19,6 +15,9 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/dex/types/deposit_record.pb.go b/x/dex/types/deposit_record.pb.go index 0941327f6..8d3ca7286 100644 --- a/x/dex/types/deposit_record.pb.go +++ b/x/dex/types/deposit_record.pb.go @@ -4,14 +4,13 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" - - cosmossdk_io_math "cosmossdk.io/math" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/dex/types/genesis.pb.go b/x/dex/types/genesis.pb.go index 474636568..167877ac6 100644 --- a/x/dex/types/genesis.pb.go +++ b/x/dex/types/genesis.pb.go @@ -5,12 +5,11 @@ package types import ( fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" - - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/dex/types/limit_order_expiration.pb.go b/x/dex/types/limit_order_expiration.pb.go index 27544964d..c983de898 100644 --- a/x/dex/types/limit_order_expiration.pb.go +++ b/x/dex/types/limit_order_expiration.pb.go @@ -5,15 +5,14 @@ package types import ( fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - time "time" - _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" + time "time" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/dex/types/limit_order_tranche.pb.go b/x/dex/types/limit_order_tranche.pb.go index 79df59140..e35ecd9cc 100644 --- a/x/dex/types/limit_order_tranche.pb.go +++ b/x/dex/types/limit_order_tranche.pb.go @@ -4,19 +4,17 @@ package types import ( - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - time "time" - cosmossdk_io_math "cosmossdk.io/math" + fmt "fmt" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" - _ "google.golang.org/protobuf/types/known/timestamppb" - github_com_neutron_org_neutron_v4_utils_math "github.com/neutron-org/neutron/v4/utils/math" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" + time "time" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/dex/types/limit_order_tranche_user.pb.go b/x/dex/types/limit_order_tranche_user.pb.go index 75737b1c2..b0e65087b 100644 --- a/x/dex/types/limit_order_tranche_user.pb.go +++ b/x/dex/types/limit_order_tranche_user.pb.go @@ -4,14 +4,13 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" - - cosmossdk_io_math "cosmossdk.io/math" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/dex/types/pair_id.pb.go b/x/dex/types/pair_id.pb.go index 5d72b9f75..1b97bd856 100644 --- a/x/dex/types/pair_id.pb.go +++ b/x/dex/types/pair_id.pb.go @@ -5,11 +5,10 @@ package types import ( fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" - - proto "github.com/cosmos/gogoproto/proto" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/dex/types/params.pb.go b/x/dex/types/params.pb.go index 28d0899dd..ca28efd3e 100644 --- a/x/dex/types/params.pb.go +++ b/x/dex/types/params.pb.go @@ -5,12 +5,11 @@ package types import ( fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" - - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/dex/types/pool.pb.go b/x/dex/types/pool.pb.go index c33507555..7468d843b 100644 --- a/x/dex/types/pool.pb.go +++ b/x/dex/types/pool.pb.go @@ -5,12 +5,11 @@ package types import ( fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" - - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/dex/types/pool_metadata.pb.go b/x/dex/types/pool_metadata.pb.go index 03aaaed20..47c15c2ae 100644 --- a/x/dex/types/pool_metadata.pb.go +++ b/x/dex/types/pool_metadata.pb.go @@ -5,11 +5,10 @@ package types import ( fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" - - proto "github.com/cosmos/gogoproto/proto" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/dex/types/pool_reserves.pb.go b/x/dex/types/pool_reserves.pb.go index c889d1e69..10e0f6d50 100644 --- a/x/dex/types/pool_reserves.pb.go +++ b/x/dex/types/pool_reserves.pb.go @@ -4,16 +4,14 @@ package types import ( - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - cosmossdk_io_math "cosmossdk.io/math" + fmt "fmt" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - github_com_neutron_org_neutron_v4_utils_math "github.com/neutron-org/neutron/v4/utils/math" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/dex/types/query.pb.go b/x/dex/types/query.pb.go index 953d59f96..9450a4a07 100644 --- a/x/dex/types/query.pb.go +++ b/x/dex/types/query.pb.go @@ -5,13 +5,8 @@ package types import ( context "context" - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - time "time" - cosmossdk_io_math "cosmossdk.io/math" + fmt "fmt" _ "github.com/cosmos/cosmos-sdk/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" query "github.com/cosmos/cosmos-sdk/types/query" @@ -19,13 +14,16 @@ import ( grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + github_com_neutron_org_neutron_v4_utils_math "github.com/neutron-org/neutron/v4/utils/math" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" _ "google.golang.org/protobuf/types/known/timestamppb" - - github_com_neutron_org_neutron_v4_utils_math "github.com/neutron-org/neutron/v4/utils/math" + io "io" + math "math" + math_bits "math/bits" + time "time" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/dex/types/tick_liquidity.pb.go b/x/dex/types/tick_liquidity.pb.go index 0f2443566..c35f64b63 100644 --- a/x/dex/types/tick_liquidity.pb.go +++ b/x/dex/types/tick_liquidity.pb.go @@ -5,12 +5,11 @@ package types import ( fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" - - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/dex/types/trade_pair_id.pb.go b/x/dex/types/trade_pair_id.pb.go index 3c4f1980e..d2d64ef4e 100644 --- a/x/dex/types/trade_pair_id.pb.go +++ b/x/dex/types/trade_pair_id.pb.go @@ -5,11 +5,10 @@ package types import ( fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" - - proto "github.com/cosmos/gogoproto/proto" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/dex/types/tx.pb.go b/x/dex/types/tx.pb.go index f94f0bee3..433e795c2 100644 --- a/x/dex/types/tx.pb.go +++ b/x/dex/types/tx.pb.go @@ -5,13 +5,8 @@ package types import ( context "context" - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - time "time" - cosmossdk_io_math "cosmossdk.io/math" + fmt "fmt" _ "github.com/cosmos/cosmos-proto" _ "github.com/cosmos/cosmos-sdk/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" @@ -21,12 +16,15 @@ import ( grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + github_com_neutron_org_neutron_v4_utils_math "github.com/neutron-org/neutron/v4/utils/math" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" _ "google.golang.org/protobuf/types/known/timestamppb" - - github_com_neutron_org_neutron_v4_utils_math "github.com/neutron-org/neutron/v4/utils/math" + io "io" + math "math" + math_bits "math/bits" + time "time" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/dex/types/v2/params.pb.go b/x/dex/types/v2/params.pb.go index 297167892..b6e4ad499 100644 --- a/x/dex/types/v2/params.pb.go +++ b/x/dex/types/v2/params.pb.go @@ -5,14 +5,12 @@ package v2 import ( fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - github_com_neutron_org_neutron_v4_utils_math "github.com/neutron-org/neutron/v4/utils/math" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/dynamicfees/types/genesis.pb.go b/x/dynamicfees/types/genesis.pb.go index a5f13a155..ff1c4b185 100644 --- a/x/dynamicfees/types/genesis.pb.go +++ b/x/dynamicfees/types/genesis.pb.go @@ -5,12 +5,11 @@ package types import ( fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" - - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/dynamicfees/types/params.pb.go b/x/dynamicfees/types/params.pb.go index 130de4b33..cd6c8940e 100644 --- a/x/dynamicfees/types/params.pb.go +++ b/x/dynamicfees/types/params.pb.go @@ -5,14 +5,13 @@ package types import ( fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/dynamicfees/types/query.pb.go b/x/dynamicfees/types/query.pb.go index ef6c9cb99..51fb31b92 100644 --- a/x/dynamicfees/types/query.pb.go +++ b/x/dynamicfees/types/query.pb.go @@ -6,10 +6,6 @@ package types import ( context "context" fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -17,6 +13,9 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/dynamicfees/types/tx.pb.go b/x/dynamicfees/types/tx.pb.go index 8ba50ed26..a2dc42872 100644 --- a/x/dynamicfees/types/tx.pb.go +++ b/x/dynamicfees/types/tx.pb.go @@ -6,10 +6,6 @@ package types import ( context "context" fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - _ "github.com/cosmos/cosmos-proto" _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" @@ -19,6 +15,9 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/feeburner/types/genesis.pb.go b/x/feeburner/types/genesis.pb.go index b378b9102..817cad2ff 100644 --- a/x/feeburner/types/genesis.pb.go +++ b/x/feeburner/types/genesis.pb.go @@ -5,12 +5,11 @@ package types import ( fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" - - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/feeburner/types/params.pb.go b/x/feeburner/types/params.pb.go index 76c19721e..2f539541e 100644 --- a/x/feeburner/types/params.pb.go +++ b/x/feeburner/types/params.pb.go @@ -5,12 +5,11 @@ package types import ( fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" - - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/feeburner/types/query.pb.go b/x/feeburner/types/query.pb.go index 8a3622a36..ea85ae590 100644 --- a/x/feeburner/types/query.pb.go +++ b/x/feeburner/types/query.pb.go @@ -6,10 +6,6 @@ package types import ( context "context" fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - _ "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" @@ -18,6 +14,9 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/feeburner/types/total_burned_neutrons_amount.pb.go b/x/feeburner/types/total_burned_neutrons_amount.pb.go index 438b721a3..8e9acf9f1 100644 --- a/x/feeburner/types/total_burned_neutrons_amount.pb.go +++ b/x/feeburner/types/total_burned_neutrons_amount.pb.go @@ -5,13 +5,12 @@ package types import ( fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/feeburner/types/tx.pb.go b/x/feeburner/types/tx.pb.go index d0c1092f9..d25168e3c 100644 --- a/x/feeburner/types/tx.pb.go +++ b/x/feeburner/types/tx.pb.go @@ -6,10 +6,6 @@ package types import ( context "context" fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - _ "github.com/cosmos/cosmos-proto" _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" @@ -19,6 +15,9 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/feerefunder/types/fee.pb.go b/x/feerefunder/types/fee.pb.go index e69c14109..540bc0581 100644 --- a/x/feerefunder/types/fee.pb.go +++ b/x/feerefunder/types/fee.pb.go @@ -5,14 +5,13 @@ package types import ( fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/feerefunder/types/genesis.pb.go b/x/feerefunder/types/genesis.pb.go index 800255d34..682002bcf 100644 --- a/x/feerefunder/types/genesis.pb.go +++ b/x/feerefunder/types/genesis.pb.go @@ -5,12 +5,11 @@ package types import ( fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" - - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/feerefunder/types/params.pb.go b/x/feerefunder/types/params.pb.go index 62f1e84fa..1bdb0da76 100644 --- a/x/feerefunder/types/params.pb.go +++ b/x/feerefunder/types/params.pb.go @@ -5,12 +5,11 @@ package types import ( fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" - - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/feerefunder/types/query.pb.go b/x/feerefunder/types/query.pb.go index fe73033ba..7bd8573fa 100644 --- a/x/feerefunder/types/query.pb.go +++ b/x/feerefunder/types/query.pb.go @@ -6,10 +6,6 @@ package types import ( context "context" fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - _ "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" @@ -18,6 +14,9 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/feerefunder/types/tx.pb.go b/x/feerefunder/types/tx.pb.go index 8aaab733d..3688fce95 100644 --- a/x/feerefunder/types/tx.pb.go +++ b/x/feerefunder/types/tx.pb.go @@ -6,10 +6,6 @@ package types import ( context "context" fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - _ "github.com/cosmos/cosmos-proto" _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" @@ -19,6 +15,9 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/globalfee/types/genesis.pb.go b/x/globalfee/types/genesis.pb.go index 49f7929e2..349c454df 100644 --- a/x/globalfee/types/genesis.pb.go +++ b/x/globalfee/types/genesis.pb.go @@ -5,12 +5,11 @@ package types import ( fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" - - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/globalfee/types/params.pb.go b/x/globalfee/types/params.pb.go index caae5be0a..f6bc1a627 100644 --- a/x/globalfee/types/params.pb.go +++ b/x/globalfee/types/params.pb.go @@ -5,14 +5,13 @@ package types import ( fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/globalfee/types/query.pb.go b/x/globalfee/types/query.pb.go index 4e5e58d3e..1f802433c 100644 --- a/x/globalfee/types/query.pb.go +++ b/x/globalfee/types/query.pb.go @@ -6,10 +6,6 @@ package types import ( context "context" fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -17,6 +13,9 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/globalfee/types/tx.pb.go b/x/globalfee/types/tx.pb.go index 5b61253dc..31da98227 100644 --- a/x/globalfee/types/tx.pb.go +++ b/x/globalfee/types/tx.pb.go @@ -6,10 +6,6 @@ package types import ( context "context" fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - _ "github.com/cosmos/cosmos-proto" _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" @@ -19,6 +15,9 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/interchainqueries/types/genesis.pb.go b/x/interchainqueries/types/genesis.pb.go index ef69e7dd3..1af0782c0 100644 --- a/x/interchainqueries/types/genesis.pb.go +++ b/x/interchainqueries/types/genesis.pb.go @@ -5,15 +5,14 @@ package types import ( fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types1 "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" types "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/interchainqueries/types/params.pb.go b/x/interchainqueries/types/params.pb.go index db88e9007..5afc785e0 100644 --- a/x/interchainqueries/types/params.pb.go +++ b/x/interchainqueries/types/params.pb.go @@ -5,14 +5,13 @@ package types import ( fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/interchainqueries/types/query.pb.go b/x/interchainqueries/types/query.pb.go index 0f1972e02..03dd0fb7a 100644 --- a/x/interchainqueries/types/query.pb.go +++ b/x/interchainqueries/types/query.pb.go @@ -6,10 +6,6 @@ package types import ( context "context" fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - query "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" @@ -18,6 +14,9 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/interchainqueries/types/tx.pb.go b/x/interchainqueries/types/tx.pb.go index a4a4ca2d9..4d6a49cee 100644 --- a/x/interchainqueries/types/tx.pb.go +++ b/x/interchainqueries/types/tx.pb.go @@ -6,10 +6,6 @@ package types import ( context "context" fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - types1 "github.com/cometbft/cometbft/abci/types" crypto "github.com/cometbft/cometbft/proto/tendermint/crypto" _ "github.com/cosmos/cosmos-proto" @@ -22,6 +18,9 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/interchaintxs/types/genesis.pb.go b/x/interchaintxs/types/genesis.pb.go index 85e6a2c74..25770ae3c 100644 --- a/x/interchaintxs/types/genesis.pb.go +++ b/x/interchaintxs/types/genesis.pb.go @@ -5,12 +5,11 @@ package types import ( fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" - - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/interchaintxs/types/params.pb.go b/x/interchaintxs/types/params.pb.go index 3012954b6..e2f86cfc9 100644 --- a/x/interchaintxs/types/params.pb.go +++ b/x/interchaintxs/types/params.pb.go @@ -5,13 +5,12 @@ package types import ( fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/interchaintxs/types/query.pb.go b/x/interchaintxs/types/query.pb.go index 1518bda64..5f71e842b 100644 --- a/x/interchaintxs/types/query.pb.go +++ b/x/interchaintxs/types/query.pb.go @@ -6,10 +6,6 @@ package types import ( context "context" fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - _ "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" @@ -18,6 +14,9 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/interchaintxs/types/tx.pb.go b/x/interchaintxs/types/tx.pb.go index 9f5693111..8b7fb7755 100644 --- a/x/interchaintxs/types/tx.pb.go +++ b/x/interchaintxs/types/tx.pb.go @@ -6,10 +6,6 @@ package types import ( context "context" fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - _ "github.com/cosmos/cosmos-proto" types1 "github.com/cosmos/cosmos-sdk/codec/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" @@ -19,12 +15,14 @@ import ( _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" + types2 "github.com/neutron-org/neutron/v4/x/feerefunder/types" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" - - types2 "github.com/neutron-org/neutron/v4/x/feerefunder/types" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/tokenfactory/keeper/msg_server_test.go b/x/tokenfactory/keeper/msg_server_test.go index 5130f266b..30edda04c 100644 --- a/x/tokenfactory/keeper/msg_server_test.go +++ b/x/tokenfactory/keeper/msg_server_test.go @@ -869,24 +869,36 @@ func TestMsgUpdateParamsValidate(t *testing.T) { "authority is invalid", }, { - "empty fee_collector_address", + "empty fee_collector_address with denom_creation_fee", types.MsgUpdateParams{ Authority: testutil.TestOwnerAddress, Params: types.Params{ FeeCollectorAddress: "", + DenomCreationFee: sdktypes.NewCoins(sdktypes.NewCoin("untrn", math.OneInt())), }, }, - "fee_collector_address is invalid", + "DenomCreationFee and FeeCollectorAddr must be both set or both unset", + }, + { + "fee_collector_address empty denom_creation_fee", + types.MsgUpdateParams{ + Authority: testutil.TestOwnerAddress, + Params: types.Params{ + FeeCollectorAddress: testAddress, + }, + }, + "DenomCreationFee and FeeCollectorAddr must be both set or both unset", }, { "invalid fee_collector_address", types.MsgUpdateParams{ Authority: testutil.TestOwnerAddress, Params: types.Params{ + DenomCreationFee: sdktypes.NewCoins(sdktypes.NewCoin("untrn", math.OneInt())), FeeCollectorAddress: "invalid fee_collector_address", }, }, - "fee_collector_address is invalid", + "failed to validate FeeCollectorAddress", }, } @@ -899,3 +911,70 @@ func TestMsgUpdateParamsValidate(t *testing.T) { }) } } + +func TestMsgUpdateParamsWhitelistedHooks(t *testing.T) { + k, ctx := testkeeper.TokenFactoryKeeper(t, nil, nil, nil) + + tests := []struct { + name string + params types.Params + error string + }{ + { + "success", + types.Params{ + WhitelistedHooks: []*types.WhitelistedHook{{DenomCreator: testAddress, CodeID: 1}}, + }, + "", + }, + { + "success multiple ", + types.Params{ + WhitelistedHooks: []*types.WhitelistedHook{ + {DenomCreator: testAddress, CodeID: 1}, + {DenomCreator: testAddress, CodeID: 2}, + }, + }, + "", + }, + { + "invalid denom creator", + types.Params{ + WhitelistedHooks: []*types.WhitelistedHook{ + {DenomCreator: "bad_address", CodeID: 1}, + }, + }, + "invalid denom creator", + }, + { + "duplicate hooks", + types.Params{ + WhitelistedHooks: []*types.WhitelistedHook{ + {DenomCreator: testAddress, CodeID: 1}, + {DenomCreator: testAddress, CodeID: 1}, + }, + }, + "duplicate whitelisted hook", + }, + } + + for _, tt := range tests { + tt := tt + t.Run(tt.name, func(t *testing.T) { + msg := &types.MsgUpdateParams{ + Authority: testutil.TestOwnerAddress, + Params: tt.params, + } + resp, err := k.UpdateParams(ctx, msg) + if len(tt.error) > 0 { + require.ErrorContains(t, err, tt.error) + require.Nil(t, resp) + + } else { + require.NoError(t, err) + newParams := k.GetParams(ctx) + require.Equal(t, tt.params, newParams) + } + }) + } +} diff --git a/x/tokenfactory/types/authorityMetadata.pb.go b/x/tokenfactory/types/authorityMetadata.pb.go index 3d12d5ed5..ad2ace108 100644 --- a/x/tokenfactory/types/authorityMetadata.pb.go +++ b/x/tokenfactory/types/authorityMetadata.pb.go @@ -5,13 +5,12 @@ package types import ( fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - _ "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/tokenfactory/types/genesis.pb.go b/x/tokenfactory/types/genesis.pb.go index cd03eb3bb..3415f1e6c 100644 --- a/x/tokenfactory/types/genesis.pb.go +++ b/x/tokenfactory/types/genesis.pb.go @@ -5,12 +5,11 @@ package types import ( fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" - - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/tokenfactory/types/params.pb.go b/x/tokenfactory/types/params.pb.go index 48cfdb88f..a5b112b5a 100644 --- a/x/tokenfactory/types/params.pb.go +++ b/x/tokenfactory/types/params.pb.go @@ -5,15 +5,14 @@ package types import ( fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/tokenfactory/types/query.pb.go b/x/tokenfactory/types/query.pb.go index 3d6b122ff..5e6fb2b06 100644 --- a/x/tokenfactory/types/query.pb.go +++ b/x/tokenfactory/types/query.pb.go @@ -6,10 +6,6 @@ package types import ( context "context" fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -17,6 +13,9 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/tokenfactory/types/tx.go b/x/tokenfactory/types/tx.go index 8b908d852..3925b0b5a 100644 --- a/x/tokenfactory/types/tx.go +++ b/x/tokenfactory/types/tx.go @@ -32,11 +32,5 @@ func (msg *MsgUpdateParams) Validate() error { return errorsmod.Wrap(err, "authority is invalid") } - // TODO: This is inconsistent. Per Params.Validate() an empty creator address is valid as long as - // DenomCreationFee is nil. But This check fails if FeeCollectorAddress is unset. - if _, err := sdk.AccAddressFromBech32(msg.Params.FeeCollectorAddress); err != nil { - return errorsmod.Wrap(err, "fee_collector_address is invalid") - } - return msg.Params.Validate() } diff --git a/x/tokenfactory/types/tx.pb.go b/x/tokenfactory/types/tx.pb.go index 236c58ed4..e20ba1f2c 100644 --- a/x/tokenfactory/types/tx.pb.go +++ b/x/tokenfactory/types/tx.pb.go @@ -6,10 +6,6 @@ package types import ( context "context" fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - _ "github.com/cosmos/cosmos-proto" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/msgservice" @@ -21,6 +17,9 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/tokenfactory/types/v1beta1/params.pb.go b/x/tokenfactory/types/v1beta1/params.pb.go index 2cf60f11d..cf863a97c 100644 --- a/x/tokenfactory/types/v1beta1/params.pb.go +++ b/x/tokenfactory/types/v1beta1/params.pb.go @@ -5,15 +5,14 @@ package v1beta1 import ( fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/transfer/types/query.pb.go b/x/transfer/types/query.pb.go index 499576586..4d562d622 100644 --- a/x/transfer/types/query.pb.go +++ b/x/transfer/types/query.pb.go @@ -6,8 +6,6 @@ package types import ( context "context" fmt "fmt" - math "math" - grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" types "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" @@ -15,6 +13,7 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + math "math" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/transfer/types/tx.pb.go b/x/transfer/types/tx.pb.go index 5f1c663ba..94361dafa 100644 --- a/x/transfer/types/tx.pb.go +++ b/x/transfer/types/tx.pb.go @@ -6,10 +6,6 @@ package types import ( context "context" fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/gogoproto/gogoproto" @@ -17,11 +13,13 @@ import ( proto "github.com/cosmos/gogoproto/proto" types3 "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" types1 "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" + types2 "github.com/neutron-org/neutron/v4/x/feerefunder/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" - - types2 "github.com/neutron-org/neutron/v4/x/feerefunder/types" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used.