forked from cosmos/cosmos-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge PR cosmos#5600: Migrate x/staking to Protobuf
- Loading branch information
1 parent
ae9af02
commit ca483bf
Showing
2 changed files
with
44 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package simapp | ||
|
||
import ( | ||
"github.com/cosmos/cosmos-sdk/codec" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/cosmos-sdk/x/auth/vesting" | ||
"github.com/cosmos/cosmos-sdk/x/staking" | ||
) | ||
|
||
// AppCodec defines the application-level codec. This codec contains all the | ||
// required module-specific codecs that are to be provided upon initialization. | ||
type AppCodec struct { | ||
amino *codec.Codec | ||
|
||
Staking *staking.Codec | ||
} | ||
|
||
func NewAppCodec() *AppCodec { | ||
amino := MakeCodec() | ||
|
||
return &AppCodec{ | ||
amino: amino, | ||
Staking: staking.NewCodec(amino), | ||
} | ||
} | ||
|
||
// MakeCodec creates and returns a reference to an Amino codec that has all the | ||
// necessary types and interfaces registered. This codec is provided to all the | ||
// modules the application depends on. | ||
// | ||
// NOTE: This codec will be deprecated in favor of AppCodec once all modules are | ||
// migrated. | ||
func MakeCodec() *codec.Codec { | ||
var cdc = codec.New() | ||
ModuleBasics.RegisterCodec(cdc) | ||
vesting.RegisterCodec(cdc) | ||
sdk.RegisterCodec(cdc) | ||
codec.RegisterCrypto(cdc) | ||
return cdc | ||
} |