Skip to content

Commit

Permalink
feat: rename Marshaler to Codec (#3658)
Browse files Browse the repository at this point in the history
* Rename Marshaler to Codec

* Upgrade golangci to latest version

* Update changelog

* Rename Marshaler field in other places

* Revert "Upgrade golangci to latest version"

This reverts commit 7e4f23a.

---------

Co-authored-by: Danilo Pantani <[email protected]>
  • Loading branch information
Ehsan-saradar and Pantani committed Sep 26, 2023
1 parent f2d9a5f commit b0f75fa
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- [#3559](https://github.com/ignite/cli/pull/3559) Bump network plugin version to `v0.1.1`
- [#3522](https://github.com/ignite/cli/pull/3522) Remove indentation from `chain serve` output
- [#3601](https://github.com/ignite/cli/pull/3601) Update ts-relayer version to `0.10.0`
- [#3658](https://github.com/ignite/cli/pull/3658) Rename Marshaler to Codec in EncodingConfig
- [#3653](https://github.com/ignite/cli/pull/3653) Add "app" extension to plugin binaries
- [#3656](https://github.com/ignite/cli/pull/3656) Disable Go toolchain download

Expand Down
6 changes: 3 additions & 3 deletions ignite/templates/app/files/app/encoding.go.plush
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import (
func makeEncodingConfig() params.EncodingConfig {
amino := codec.NewLegacyAmino()
interfaceRegistry := types.NewInterfaceRegistry()
marshaler := codec.NewProtoCodec(interfaceRegistry)
txCfg := tx.NewTxConfig(marshaler, tx.DefaultSignModes)
cdc := codec.NewProtoCodec(interfaceRegistry)
txCfg := tx.NewTxConfig(cdc, tx.DefaultSignModes)

return params.EncodingConfig{
InterfaceRegistry: interfaceRegistry,
Marshaler: marshaler,
Codec: cdc,
TxConfig: txCfg,
Amino: amino,
}
Expand Down
2 changes: 1 addition & 1 deletion ignite/templates/app/files/app/params/encoding.go.plush
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
// This is provided for compatibility between protobuf and amino implementations.
type EncodingConfig struct {
InterfaceRegistry types.InterfaceRegistry
Marshaler codec.Codec
Codec codec.Codec
TxConfig client.TxConfig
Amino *codec.LegacyAmino
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import (
func NewRootCmd() (*cobra.Command, appparams.EncodingConfig) {
encodingConfig := app.MakeEncodingConfig()
initClientCtx := client.Context{}.
WithCodec(encodingConfig.Marshaler).
WithCodec(encodingConfig.Codec).
WithInterfaceRegistry(encodingConfig.InterfaceRegistry).
WithTxConfig(encodingConfig.TxConfig).
WithLegacyAmino(encodingConfig.Amino).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func DefaultConfig() network.Config {
chainID = "chain-" + tmrand.NewRand().Str(6)
)
return network.Config{
Codec: encoding.Marshaler,
Codec: encoding.Codec,
TxConfig: encoding.TxConfig,
LegacyAmino: encoding.Amino,
InterfaceRegistry: encoding.InterfaceRegistry,
Expand All @@ -71,7 +71,7 @@ func DefaultConfig() network.Config {
baseapp.SetChainID(chainID),
)
},
GenesisState: app.ModuleBasics.DefaultGenesis(encoding.Marshaler),
GenesisState: app.ModuleBasics.DefaultGenesis(encoding.Codec),
TimeoutCommit: 2 * time.Second,
ChainID: chainID,
NumValidators: 1,
Expand Down

0 comments on commit b0f75fa

Please sign in to comment.