Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: bump up cosmos sdk v0.50.x and cometbft v0.38.0 #2

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
d231c75
feat: update go.mod
dudong2 Nov 13, 2023
f6e0bfd
build: go mod tidy
dudong2 Nov 13, 2023
4e7b8e9
build: fix build errors
dudong2 Nov 13, 2023
5f71660
test: fix tests
dudong2 Nov 14, 2023
5b35e32
test: fix lint
dudong2 Nov 15, 2023
d190c74
feat: cherry-pick crypto-org-chain/ethermint v47 integration pr
dudong2 Nov 15, 2023
bb69d1b
feat: apply cosmos-sdk v0.47.x upgrade docs
dudong2 Nov 15, 2023
04f032b
docs: update gomod2nix.toml
dudong2 Nov 15, 2023
caf3d78
Problem: localhost client param is not migrated (#306)
mmsqe Aug 14, 2023
2ac0e19
Problem: recent version of SetPreBlocker is not used (#326)
mmsqe Sep 5, 2023
1533fc1
feat: support blocking list of addresses in mempool and disable vesti…
mmsqe Sep 6, 2023
6a8ad57
Revert blocking list feature from "feat: support blocking list of add…
dudong2 Nov 15, 2023
f0c4147
Problem: performance regression because of un-cached sender recovery …
yihuang Sep 14, 2023
14d731b
Revert antehandler ordering from "Problem: performance regression bec…
dudong2 Nov 15, 2023
15326be
fix negative dynamic fee (#351)
yihuang Sep 15, 2023
a1390fc
test: fix lint
dudong2 Nov 15, 2023
95047e7
feat: update go.mod
dudong2 Nov 15, 2023
9dcb497
build: fix build
dudong2 Nov 20, 2023
8f588a0
test: fix tests
dudong2 Nov 28, 2023
77d8f0f
test: fix lint
dudong2 Nov 29, 2023
71c8a78
build: bump up golang ver to 1.21
dudong2 Nov 29, 2023
a9803b2
test: update nix go ver to 1.21
dudong2 Nov 29, 2023
eb8e32e
Revert "test: update nix go ver to 1.21"
dudong2 Nov 29, 2023
693e2ad
Revert "build: bump up golang ver to 1.21"
dudong2 Nov 29, 2023
c05ad8f
test: fix test-import
dudong2 Nov 29, 2023
85e716d
test: bump up golang ver to 1.21
dudong2 Nov 29, 2023
91c9611
test: fix deploy-contract, lint checker
dudong2 Nov 29, 2023
d72d2b5
test: debug go ver for deploy-contract, fix lint checker
dudong2 Nov 29, 2023
75b76a5
test: debug go ver for deploy-contract
dudong2 Nov 29, 2023
0fac401
test: go version order change
dudong2 Nov 29, 2023
b1ada74
test: change go version from makefile-release, fix lint
dudong2 Nov 29, 2023
0249796
chore: remove todo comments
dudong2 Nov 29, 2023
57b520b
feat: fix add prefix, replace test-contract to test-solidity
dudong2 Nov 30, 2023
7add7e7
feat: fix genesis doc type error
dudong2 Nov 30, 2023
4e27a51
test: fix test-rpc
dudong2 Nov 30, 2023
56d646e
test: fix test-solidity
dudong2 Nov 30, 2023
0016b23
test: fix test-solidity re-add export gopath, path
dudong2 Nov 30, 2023
bdf18f1
test: fix test-solidity replace goroot too
dudong2 Nov 30, 2023
1a38933
test: fix test-solidity add debug go env
dudong2 Nov 30, 2023
81c9aa3
test: fix test-solidity remove debug test, add go version command
dudong2 Dec 1, 2023
cc02280
test: fix test-solidity, split tools and test
dudong2 Dec 1, 2023
3f750f0
test: fix test-solidity, add go version debug
dudong2 Dec 1, 2023
e9241e5
test: fix test-solidity, add go env, remove sudo
dudong2 Dec 1, 2023
70a085b
test: fix test-solidity, add -E option to sudo
dudong2 Dec 1, 2023
99774fa
test: fix test-solidity, add env path
dudong2 Dec 1, 2023
547ac13
test: fix test-solidity, remove debug lines, add path
dudong2 Dec 1, 2023
1d48007
bug: fix tx, query commands
dudong2 Dec 4, 2023
aa436e8
feat: match app.go with original code(cosmos-sdk v0.50.1)
dudong2 Dec 5, 2023
59e77ef
test: fix lint
dudong2 Dec 5, 2023
471829b
test: fix lint
dudong2 Dec 5, 2023
2efe580
test: fix lint
dudong2 Dec 5, 2023
b04d930
test: fix lint
dudong2 Dec 5, 2023
c432160
test: fix lint
dudong2 Dec 5, 2023
1b29dbd
chore: re-enable resetta
dudong2 Dec 7, 2023
8fa6a73
test: update nix
dudong2 Dec 7, 2023
092150e
test: update nix
dudong2 Dec 7, 2023
3edd6e1
test: update nix go ver to 1.21
dudong2 Dec 7, 2023
3e98488
test: revert nix changes
dudong2 Dec 7, 2023
6a8d995
test: update nix go ver to 1.21
dudong2 Dec 7, 2023
a45f9c9
test: update gomod2nix.toml, add poetry2nix
dudong2 Dec 8, 2023
9e42966
test: fix poetry
dudong2 Dec 8, 2023
88f9af4
test: fix integration test(env, cosmovisor, ...)
dudong2 Dec 8, 2023
726aa6f
test: fix tests(finalize block, commit)
dudong2 Dec 16, 2023
ae8fb22
test: fix consensus-params-block-max_gas path in json
dudong2 Dec 19, 2023
2d37695
test: fix integration test(broken test - patch file, SyncInfo -> sync…
dudong2 Dec 20, 2023
4fb85b4
test: fix integration test - test_account
dudong2 Dec 20, 2023
3c9ca0e
test: fix test_account.py lint
dudong2 Dec 21, 2023
6d26495
test: fix warning
dudong2 Dec 21, 2023
d0facf3
test: fix integration test - remove tx priority test
dudong2 Jan 2, 2024
702808d
test: fix integration test - comment test_priority.py
dudong2 Jan 2, 2024
ad3c976
test: fix integration test lint
dudong2 Jan 3, 2024
915ed04
test: fix base fee test
dudong2 Jan 8, 2024
5bbc773
chore: uncomment or fix necessary parts
dudong2 Jan 15, 2024
a2ebdd2
chore: change migrate funcs
dudong2 Jan 15, 2024
aa5a061
chore: fix migration tests
dudong2 Jan 15, 2024
36d050f
feat: remove handler.go
dudong2 Jan 15, 2024
aa20167
test: fix lint
dudong2 Jan 15, 2024
f7059a0
chore: fix get proof and signmode
dudong2 Jan 15, 2024
56597b2
chore: remove double-quote from go ver
dudong2 Jan 15, 2024
d2d56aa
chore: rename log and import
dudong2 Jan 15, 2024
a99c931
refactor: get signers from msg v2
dudong2 Jan 15, 2024
79ac551
test: revert changed num
dudong2 Jan 15, 2024
999e93e
chore: update upgrades.go
dudong2 Jan 16, 2024
47b2ad5
chore: refactor testutil/network codes
dudong2 Jan 16, 2024
6d0df18
refactor: split cmd/root.go to cmd/commands.go and cmd/root.go
dudong2 Jan 17, 2024
9395e7d
test: fix lint
dudong2 Jan 17, 2024
c4ccd6c
chore: remove nil check of consensusparam.abci, fix eip1559 base fee …
dudong2 Jan 22, 2024
a91d782
refactor: testutil/network codes
dudong2 Jan 22, 2024
6fd2e54
refactor: server/start file
dudong2 Jan 22, 2024
455d651
chore: remove gitleaksignore
dudong2 Jan 22, 2024
10f4c55
test: fix lint
dudong2 Jan 22, 2024
4ac4d0f
test: fix integration test purned node error message
dudong2 Jan 22, 2024
d654db4
chore: modify comments
dudong2 Jan 23, 2024
3a770ab
chore: fix python lint
dudong2 Jan 23, 2024
8bdca1a
chore: add config, purning, snapshot commands
dudong2 Jan 26, 2024
31b1409
test: fix python lint, gomod2nix
dudong2 Jan 26, 2024
9ad5d16
chore: apply simple reviews
dudong2 Jan 30, 2024
4ec1412
feat: apply autocli.go
dudong2 Feb 3, 2024
e3b2a47
feat: set ibc fee keeper in app.go
dudong2 Feb 4, 2024
11d7b33
fix: evm query store, code use custom query args
dudong2 Feb 4, 2024
f996886
chore: fix ethereum rpc PUblicFilterAPI.NewHeads
dudong2 Feb 4, 2024
6cade60
chore: change EnhanceCusomCommand from false to true to restore Param…
dudong2 Feb 5, 2024
e1c4108
test: revert test_account.py
dudong2 Feb 5, 2024
e35b6b2
chore: remove x/nft, x/group, x/circuit
dudong2 Feb 7, 2024
ff3ff70
feat: fix subscribeNewHeads to use baseFee of block event
dudong2 Feb 7, 2024
f34d6fa
fix: testnet keyring option
dudong2 Feb 7, 2024
7c4fb92
test: restore multi send test
dudong2 Feb 7, 2024
fcaf830
test: debug trace
dudong2 Feb 7, 2024
550365d
chore: apply zsystem comments
dudong2 Feb 7, 2024
4ae15fe
feat: bump up cosmos-sdk v0.50.5
dudong2 Mar 26, 2024
b156e23
feat: Move ValidateBasic logic from method func of msg to msg handler
dudong2 Apr 26, 2024
fadfc6b
feat: remove ibcfee module
dudong2 May 10, 2024
28113eb
feat: add new vesting account msg to disabled authz msgs
dudong2 May 10, 2024
788a6d8
feat: enable gov module to receive external tokens
dudong2 May 10, 2024
b7b8b91
chore: bump cosmos-sdk v0.50.6
dudong2 May 10, 2024
1568452
chore: update gomod2nix.toml
dudong2 May 10, 2024
2e522a4
chore: update gomod2nix.toml for cosmos-sdk v0.50.6
dudong2 May 10, 2024
2bfcbf4
test: fix lint
dudong2 May 10, 2024
0f395e7
chore: Remove RegisterRESTRoutes from module.go
dudong2 May 12, 2024
1346a66
feat: bump ibc-go up from v8.0.0 to v8.2.1
dudong2 May 21, 2024
c1afd13
fix: Upgrade handler bug fix
dudong2 May 21, 2024
141696a
docs: changelog
dudong2 May 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ import (
_ "github.com/evmos/ethermint/client/docs/statik"

evmv1 "github.com/evmos/ethermint/api/ethermint/evm/v1"
feemarketv1 "github.com/evmos/ethermint/api/ethermint/feemarket/v1"
"github.com/evmos/ethermint/app/ante"
enccodec "github.com/evmos/ethermint/encoding/codec"
"github.com/evmos/ethermint/ethereum/eip712"
Expand Down Expand Up @@ -267,10 +266,8 @@ func NewEthermintApp(
},
}

// evm/MsgEthereumTx, evm/MsgUpdateParams, feemarket/MsgUpdateParams
// evm/MsgEthereumTx
signingOptions.DefineCustomGetSigners(protov2.MessageName(&evmv1.MsgEthereumTx{}), evmtypes.GetSignersFromMsgEthereumTxV2)
signingOptions.DefineCustomGetSigners(protov2.MessageName(&evmv1.MsgUpdateParams{}), evmtypes.GetSignersFromMsgUpdateParamsV2)
signingOptions.DefineCustomGetSigners(protov2.MessageName(&feemarketv1.MsgUpdateParams{}), feemarkettypes.GetSignersFromMsgUpdateParamsV2)

interfaceRegistry, _ := types.NewInterfaceRegistryWithOptions(types.InterfaceRegistryOptions{
ProtoFiles: proto.HybridResolver,
Expand Down
6 changes: 1 addition & 5 deletions encoding/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@ import (
protov2 "google.golang.org/protobuf/proto"

evmv1 "github.com/evmos/ethermint/api/ethermint/evm/v1"
feemarketv1 "github.com/evmos/ethermint/api/ethermint/feemarket/v1"
enccodec "github.com/evmos/ethermint/encoding/codec"
evmtypes "github.com/evmos/ethermint/x/evm/types"
feemarkettypes "github.com/evmos/ethermint/x/feemarket/types"
)

// MakeTestEncodingConfig creates an EncodingConfig for testing
Expand All @@ -43,10 +41,8 @@ func MakeTestEncodingConfig(modules ...module.AppModuleBasic) params.EncodingCon
ValidatorAddressCodec: address.Bech32Codec{Bech32Prefix: sdk.GetConfig().GetBech32ValidatorAddrPrefix()},
}

// evm/MsgEthereumTx, evm/MsgUpdateParams, feemarket/MsgUpdateParams
// evm/MsgEthereumTx
signingOptions.DefineCustomGetSigners(protov2.MessageName(&evmv1.MsgEthereumTx{}), evmtypes.GetSignersFromMsgEthereumTxV2)
signingOptions.DefineCustomGetSigners(protov2.MessageName(&evmv1.MsgUpdateParams{}), evmtypes.GetSignersFromMsgUpdateParamsV2)
signingOptions.DefineCustomGetSigners(protov2.MessageName(&feemarketv1.MsgUpdateParams{}), feemarkettypes.GetSignersFromMsgUpdateParamsV2)

interfaceRegistry, _ := types.NewInterfaceRegistryWithOptions(types.InterfaceRegistryOptions{
ProtoFiles: proto.HybridResolver,
Expand Down
4 changes: 2 additions & 2 deletions rpc/backend/tx_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ func (b *Backend) GetTxByEthHash(hash common.Hash) (*ethermint.TxResult, error)
}

// fallback to tendermint tx indexer
query := fmt.Sprintf("%s.%s='%s'", evmtypes.TypeMsgEthereumTx, evmtypes.AttributeKeyEthereumTxHash, hash.Hex())
query := fmt.Sprintf("%s.%s='%s'", evmtypes.EventTypeEthereumTx, evmtypes.AttributeKeyEthereumTxHash, hash.Hex())
txResult, err := b.queryTendermintTxIndexer(query, func(txs *rpctypes.ParsedTxs) *rpctypes.ParsedTx {
return txs.GetTxByHash(hash)
})
Expand All @@ -335,7 +335,7 @@ func (b *Backend) GetTxByTxIndex(height int64, index uint) (*ethermint.TxResult,

// fallback to tendermint tx indexer
query := fmt.Sprintf("tx.height=%d AND %s.%s=%d",
height, evmtypes.TypeMsgEthereumTx,
height, evmtypes.EventTypeEthereumTx,
evmtypes.AttributeKeyTxIndex, index,
)
txResult, err := b.queryTendermintTxIndexer(query, func(txs *rpctypes.ParsedTxs) *rpctypes.ParsedTx {
Expand Down
2 changes: 1 addition & 1 deletion rpc/backend/tx_info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func (suite *BackendTestSuite) TestGetTxByEthHash() {
func() {
suite.backend.indexer = nil
client := suite.backend.clientCtx.Client.(*mocks.Client)
query := fmt.Sprintf("%s.%s='%s'", evmtypes.TypeMsgEthereumTx, evmtypes.AttributeKeyEthereumTxHash, common.HexToHash(msgEthereumTx.Hash).Hex())
query := fmt.Sprintf("%s.%s='%s'", evmtypes.EventTypeEthereumTx, evmtypes.AttributeKeyEthereumTxHash, common.HexToHash(msgEthereumTx.Hash).Hex())
RegisterTxSearch(client, query, bz)
},
msgEthereumTx,
Expand Down
2 changes: 1 addition & 1 deletion rpc/namespaces/ethereum/eth/filters/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ func (api *PublicFilterAPI) Logs(ctx context.Context, crit filters.FilterCriteri
}

// filter only events from EVM module txs
_, isMsgEthereumTx := ev.Events[evmtypes.TypeMsgEthereumTx]
_, isMsgEthereumTx := ev.Events[evmtypes.EventTypeEthereumTx]

if !isMsgEthereumTx {
// ignore transaction as it's not from the evm module
Expand Down
8 changes: 8 additions & 0 deletions x/evm/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,18 @@ func (k *Keeper) EthereumTx(goCtx context.Context, msg *types.MsgEthereumTx) (*t
// performed if the requested authority is the Cosmos SDK governance module
// account.
func (k *Keeper) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) {
if _, err := sdk.AccAddressFromBech32(req.Authority); err != nil {
return nil, errorsmod.Wrap(err, "invalid authority address")
}

if k.authority.String() != req.Authority {
return nil, errorsmod.Wrapf(govtypes.ErrInvalidSigner, "invalid authority, expected %s, got %s", k.authority.String(), req.Authority)
}

if err := req.Params.Validate(); err != nil {
return nil, err
}

ctx := sdk.UnwrapSDKContext(goCtx)
if err := k.SetParams(ctx, req.Params); err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion x/evm/types/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package types

// Evm module events
const (
EventTypeEthereumTx = TypeMsgEthereumTx
EventTypeEthereumTx = "ethereum_tx"
EventTypeBlockBloom = "block_bloom"
EventTypeTxLog = "tx_log"

Expand Down
60 changes: 0 additions & 60 deletions x/evm/types/msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ var (
_ codectypes.UnpackInterfacesMessage = MsgEthereumTx{}
)

// message type and route constants
const (
// TypeMsgEthereumTx defines the type string of an Ethereum transaction
TypeMsgEthereumTx = "ethereum_tx"
)

// NewTx returns a reference to a new Ethereum transaction message.
func NewTx(
chainID *big.Int, nonce uint64, to *common.Address, amount *big.Int,
Expand Down Expand Up @@ -176,12 +170,6 @@ func (msg *MsgEthereumTx) FromEthereumTx(tx *ethtypes.Transaction) error {
return nil
}

// Route returns the route value of an MsgEthereumTx.
func (msg MsgEthereumTx) Route() string { return RouterKey }

// Type returns the type value of an MsgEthereumTx.
func (msg MsgEthereumTx) Type() string { return TypeMsgEthereumTx }

dongsam marked this conversation as resolved.
Show resolved Hide resolved
// ValidateBasic implements the sdk.Msg interface. It performs basic validation
// checks of a Transaction. If returns an error if validation fails.
func (msg MsgEthereumTx) ValidateBasic() error {
Expand Down Expand Up @@ -448,27 +436,6 @@ func (msg *MsgEthereumTx) BuildTx(b client.TxBuilder, evmDenom string) (authsign
return tx, nil
}

// GetSigners returns the expected signers for a MsgUpdateParams message.
func (m MsgUpdateParams) GetSigners() []sdk.AccAddress {
//#nosec G703 -- gosec raises a warning about a non-handled error which we deliberately ignore here
addr, _ := sdk.AccAddressFromBech32(m.Authority)
return []sdk.AccAddress{addr}
}

// ValidateBasic does a sanity check of the provided data
func (m *MsgUpdateParams) ValidateBasic() error {
if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil {
return errorsmod.Wrap(err, "invalid authority address")
}

return m.Params.Validate()
}

// GetSignBytes implements the LegacyMsg interface.
func (m MsgUpdateParams) GetSignBytes() []byte {
return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&m))
}

func GetSignersFromMsgEthereumTxV2(msg protov2.Message) ([][]byte, error) {
msgv1, err := GetMsgEthereumTxFromMsgV2(msg)
if err != nil {
Expand Down Expand Up @@ -518,30 +485,3 @@ func GetMsgEthereumTxFromMsgV2(msg protov2.Message) (MsgEthereumTx, error) {
msgv1.Hash = msgv1.AsTransaction().Hash().Hex()
return msgv1, nil
}

func GetSignersFromMsgUpdateParamsV2(msg protov2.Message) ([][]byte, error) {
msgv1, err := GetMsgUpdateParamsFromMsgV2(msg)
if err != nil {
return nil, err
}

signers := [][]byte{}
for _, signer := range msgv1.GetSigners() {
signers = append(signers, signer.Bytes())
}

return signers, nil
}

func GetMsgUpdateParamsFromMsgV2(msg protov2.Message) (MsgUpdateParams, error) {
msgv2, ok := msg.(*evmapi.MsgUpdateParams)
if !ok {
return MsgUpdateParams{}, fmt.Errorf("invalid x/evm/MsgUpdateParams msg v2: %v", msg)
}

msgv1 := MsgUpdateParams{
Authority: msgv2.Authority,
}

return msgv1, nil
}
3 changes: 1 addition & 2 deletions x/evm/types/msg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ func (suite *MsgsTestSuite) TestMsgEthereumTx_Constructor() {
msg := types.NewTx(nil, 0, &suite.to, nil, 100000, nil, nil, nil, []byte("test"), nil)

// suite.Require().Equal(msg.Data.To, suite.to.Hex())
suite.Require().Equal(msg.Route(), types.RouterKey)
suite.Require().Equal(msg.Type(), types.TypeMsgEthereumTx)
suite.Require().Equal(sdk.MsgTypeURL(msg), "/ethermint.evm.v1.MsgEthereumTx")
// suite.Require().NotNil(msg.To())
suite.Require().Equal(msg.GetMsgs(), []sdk.Msg{msg})
suite.Require().Panics(func() { msg.GetSigners() })
Expand Down
8 changes: 8 additions & 0 deletions x/feemarket/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@ import (
// performed if the requested authority is the Cosmos SDK governance module
// account.
func (k *Keeper) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) {
if _, err := sdk.AccAddressFromBech32(req.Authority); err != nil {
return nil, errorsmod.Wrap(err, "invalid authority address")
}

if k.authority.String() != req.Authority {
return nil, errorsmod.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", k.authority.String(), req.Authority)
}

if err := req.Params.Validate(); err != nil {
return nil, err
}

ctx := sdk.UnwrapSDKContext(goCtx)
if err := k.SetParams(ctx, req.Params); err != nil {
return nil, err
Expand Down
57 changes: 1 addition & 56 deletions x/feemarket/types/msg.go
Original file line number Diff line number Diff line change
@@ -1,60 +1,5 @@
package types

import (
"fmt"

protov2 "google.golang.org/protobuf/proto"

errorsmod "cosmossdk.io/errors"
sdk "github.com/cosmos/cosmos-sdk/types"
feemarketapi "github.com/evmos/ethermint/api/ethermint/feemarket/v1"
)
import sdk "github.com/cosmos/cosmos-sdk/types"

var _ sdk.Msg = &MsgUpdateParams{}

// GetSigners returns the expected signers for a MsgUpdateParams message.
func (m *MsgUpdateParams) GetSigners() []sdk.AccAddress {
addr := sdk.MustAccAddressFromBech32(m.Authority)
return []sdk.AccAddress{addr}
}

// ValidateBasic does a sanity check of the provided data
func (m *MsgUpdateParams) ValidateBasic() error {
if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil {
return errorsmod.Wrap(err, "invalid authority address")
}

return m.Params.Validate()
}

// GetSignBytes implements the LegacyMsg interface.
func (m MsgUpdateParams) GetSignBytes() []byte {
return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&m))
}

func GetSignersFromMsgUpdateParamsV2(msg protov2.Message) ([][]byte, error) {
msgv1, err := GetMsgUpdateParamsFromMsgV2(msg)
if err != nil {
return nil, err
}

signers := [][]byte{}
for _, signer := range msgv1.GetSigners() {
signers = append(signers, signer.Bytes())
}

return signers, nil
}

func GetMsgUpdateParamsFromMsgV2(msg protov2.Message) (MsgUpdateParams, error) {
msgv2, ok := msg.(*feemarketapi.MsgUpdateParams)
if !ok {
return MsgUpdateParams{}, fmt.Errorf("invalid x/feemarket/MsgUpdateParams msg v2: %v", msg)
}

msgv1 := MsgUpdateParams{
Authority: msgv2.Authority,
}

return msgv1, nil
}
53 changes: 0 additions & 53 deletions x/feemarket/types/msg_test.go

This file was deleted.

Loading