cosmos-sdk/docs/sdk/sdk-by-examples/simple-governance/app-codec.md
gamarin2 c5fcc9b65f Add SDK_By_Examples to doc (#1795)
* Add simple gov example and sdk-by-example folder

* Add simple gov example

* Add simple gov example and sdk-by-example folder

* Add simple gov example

* fix sectino title

* Jb feedback + Offload some of the content in other docs

* Add what is cosmos back

* platform to framewoork

* Reemove testnet
2018-08-12 03:37:26 -04:00

702 B

Application codec

File: app/app.go

Finally, we need to define the MakeCodec() function and register the concrete types and interface from the various modules.

func MakeCodec() *wire.Codec {
    var cdc = wire.NewCodec()
    wire.RegisterCrypto(cdc) // Register crypto.
    sdk.RegisterWire(cdc)    // Register Msgs
    bank.RegisterWire(cdc)
    simplestake.RegisterWire(cdc)
    simpleGov.RegisterWire(cdc)

    // Register AppAccount
    cdc.RegisterInterface((*auth.Account)(nil), nil)
    cdc.RegisterConcrete(&types.AppAccount{}, "simpleGov/Account", nil)
    return cdc
}