cosmos-sdk/docs/sdk/sdk-by-examples/simple-governance/module-wire.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

655 B

Wire

File: x/simple_governance/wire.go

The wire.go file allows developers to register the concrete message types of their module into the codec. In our case, we have two messages to declare:

func RegisterWire(cdc *wire.Codec) {
    cdc.RegisterConcrete(SubmitProposalMsg{}, "simple_governance/SubmitProposalMsg", nil)
    cdc.RegisterConcrete(VoteMsg{}, "simple_governance/VoteMsg", nil)
}

Don't forget to call this function in app.go (see Application - Bridging it all together) for more).