Skip to content

Commit

Permalink
break apart codecs
Browse files Browse the repository at this point in the history
  • Loading branch information
kocubinski committed May 14, 2024
1 parent c38d1a2 commit 4d8aa78
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 6 additions & 2 deletions codec/depinject.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ func ProvideInterfaceRegistry(
return interfaceRegistry, nil
}

func ProvideCodecs(interfaceRegistry types.InterfaceRegistry) (legacy.Amino, *ProtoCodec) {
return NewLegacyAmino(), NewProtoCodec(interfaceRegistry)
func ProvideLegacyAmino() legacy.Amino {
return NewLegacyAmino()
}

func ProvideProtoCodec(interfaceRegistry types.InterfaceRegistry) *ProtoCodec {
return NewProtoCodec(interfaceRegistry)
}
3 changes: 2 additions & 1 deletion runtime/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ func init() {
// to decouple runtime from sdk/codec ProvideInterfaceReistry can be registered from the app
// i.e. in the call to depinject.Inject(...)
codec.ProvideInterfaceRegistry,
codec.ProvideCodecs,
codec.ProvideLegacyAmino,
codec.ProvideProtoCodec,
ProvideKVStoreKey,
ProvideTransientStoreKey,
ProvideMemoryStoreKey,
Expand Down

0 comments on commit 4d8aa78

Please sign in to comment.