Skip to content

Commit

Permalink
fix: implement custom EncodingConfigBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
RiccardoM committed Jun 7, 2023
1 parent 0baa103 commit b2e2d10
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions cmd/parse/types/types.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package types

import (
"cosmossdk.io/simapp/params"
"cosmossdk.io/simapp"
simappparams "cosmossdk.io/simapp/params"
"github.com/cosmos/cosmos-sdk/std"

"github.com/forbole/juno/v5/logging"
"github.com/forbole/juno/v5/types/config"
Expand Down Expand Up @@ -63,7 +65,14 @@ func (cfg *Config) WithEncodingConfigBuilder(b EncodingConfigBuilder) *Config {
// GetEncodingConfigBuilder returns the encoding config builder to be used
func (cfg *Config) GetEncodingConfigBuilder() EncodingConfigBuilder {
if cfg.encodingConfigBuilder == nil {
return params.MakeTestEncodingConfig
return func() simappparams.EncodingConfig {
encodingConfig := simappparams.MakeTestEncodingConfig()
std.RegisterLegacyAminoCodec(encodingConfig.Amino)
std.RegisterInterfaces(encodingConfig.InterfaceRegistry)
simapp.ModuleBasics.RegisterLegacyAminoCodec(encodingConfig.Amino)
simapp.ModuleBasics.RegisterInterfaces(encodingConfig.InterfaceRegistry)
return encodingConfig
}
}
return cfg.encodingConfigBuilder
}
Expand Down

0 comments on commit b2e2d10

Please sign in to comment.