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: deprecate x/params usage in x/mint #12363

Merged
merged 35 commits into from
Jul 4, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
555779b
init commit
alexanderbez Jun 27, 2022
caa213b
updates
alexanderbez Jun 27, 2022
db9e622
updates
alexanderbez Jun 27, 2022
e6c571e
updates
alexanderbez Jun 27, 2022
44465dc
updates
alexanderbez Jun 27, 2022
b0a507c
updates
alexanderbez Jun 27, 2022
ad3c887
updates
alexanderbez Jun 27, 2022
4165e1f
Update proto/cosmos/mint/v1beta1/tx.proto
alexanderbez Jun 27, 2022
63263b7
Merge branch 'main' into bez/x-mint-migrate-params-12286
alexanderbez Jun 27, 2022
b1333e5
updates
alexanderbez Jun 27, 2022
4760fc7
Merge branch 'bez/x-mint-migrate-params-12286' of github.com:cosmos/c…
alexanderbez Jun 27, 2022
b10bb34
updates
alexanderbez Jun 28, 2022
a732e8d
updates
alexanderbez Jun 28, 2022
e0c21c2
updates
alexanderbez Jun 28, 2022
e59470a
updates
alexanderbez Jun 28, 2022
9f4522a
Merge branch 'main' into bez/x-mint-migrate-params-12286
alexanderbez Jun 28, 2022
d66c71f
updates
alexanderbez Jun 29, 2022
27a71a5
updates
alexanderbez Jun 30, 2022
7d8de6d
Merge branch 'main' into bez/x-mint-migrate-params-12286
alexanderbez Jun 30, 2022
6b87e08
updates
alexanderbez Jun 30, 2022
2b54f1b
updates
alexanderbez Jun 30, 2022
b8579ad
Merge branch 'main' into bez/x-mint-migrate-params-12286
alexanderbez Jun 30, 2022
e4c7242
Merge branch 'main' into bez/x-mint-migrate-params-12286
alexanderbez Jun 30, 2022
36a9f70
Merge branch 'main' into bez/x-mint-migrate-params-12286
alexanderbez Jun 30, 2022
f513347
Merge branch 'main' into bez/x-mint-migrate-params-12286
alexanderbez Jun 30, 2022
ba334c8
updates
alexanderbez Jun 30, 2022
2c3ac46
updates
alexanderbez Jun 30, 2022
de279d0
updates
alexanderbez Jun 30, 2022
3ff1bfe
updates
alexanderbez Jun 30, 2022
9b12c39
Merge branch 'main' into bez/x-mint-migrate-params-12286
alexanderbez Jul 1, 2022
c772baa
Merge branch 'main' into bez/x-mint-migrate-params-12286
alexanderbez Jul 1, 2022
b41cd38
updates
alexanderbez Jul 1, 2022
729a80d
Merge branch 'main' into bez/x-mint-migrate-params-12286
alexanderbez Jul 1, 2022
8c707e0
Merge branch 'main' into bez/x-mint-migrate-params-12286
julienrbrt Jul 3, 2022
828fcf2
Merge branch 'main' into bez/x-mint-migrate-params-12286
alexanderbez Jul 4, 2022
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
Prev Previous commit
Next Next commit
updates
  • Loading branch information
alexanderbez committed Jun 27, 2022
commit ad3c88779af099dd8afdc743f0da39b7ad89ad21
33 changes: 31 additions & 2 deletions x/mint/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,41 @@ package types

import (
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/codec/legacy"
"github.com/cosmos/cosmos-sdk/codec/types"
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/msgservice"
authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec"
)

var amino = codec.NewLegacyAmino()
var (
amino = codec.NewLegacyAmino()
ModuleCdc = codec.NewAminoCodec(amino)
)

func init() {
RegisterLegacyAminoCodec(amino)
cryptocodec.RegisterCrypto(amino)
amino.Seal()
sdk.RegisterLegacyAminoCodec(amino)

// Register all Amino interfaces and concrete types on the authz Amino codec
// so that this can later be used to properly serialize MsgGrant and MsgExec
// instances.
RegisterLegacyAminoCodec(authzcodec.Amino)
}

// RegisterLegacyAminoCodec registers concrete types on the LegacyAmino codec
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the reasoning for supporting legacy amino?

cdc.RegisterConcrete(Params{}, "cosmos-sdk/x/mint/Params", nil)
legacy.RegisterAminoMsg(cdc, &MsgUpdateParams{}, "cosmos-sdk/x/mint/MsgUpdateParams")
}

func RegisterInterfaces(registry types.InterfaceRegistry) {
registry.RegisterImplementations(
(*sdk.Msg)(nil),
&MsgUpdateParams{},
)

msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
}
5 changes: 5 additions & 0 deletions x/mint/types/msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ import (

var _ sdk.Msg = &MsgUpdateParams{}

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

// GetSigners returns the expected signers for a MsgUpdateParams message.
func (m *MsgUpdateParams) GetSigners() []sdk.AccAddress {
addr, _ := sdk.AccAddressFromBech32(m.Authority)
Expand Down
5 changes: 3 additions & 2 deletions x/upgrade/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ func init() {
cryptocodec.RegisterCrypto(amino)
sdk.RegisterLegacyAminoCodec(amino)

// Register all Amino interfaces and concrete types on the authz Amino codec so that this can later be
// used to properly serialize MsgGrant and MsgExec instances
// Register all Amino interfaces and concrete types on the authz Amino codec
// so that this can later be used to properly serialize MsgGrant and MsgExec
// instances.
RegisterLegacyAminoCodec(authzcodec.Amino)
}