-
Notifications
You must be signed in to change notification settings - Fork 30
/
codec.go
31 lines (27 loc) · 1.17 KB
/
codec.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package stakingplus
import (
"github.com/Finschia/finschia-sdk/codec"
"github.com/Finschia/finschia-sdk/codec/types"
authzcodec "github.com/Finschia/finschia-sdk/x/authz/codec"
"github.com/Finschia/finschia-sdk/x/foundation"
fdncodec "github.com/Finschia/finschia-sdk/x/foundation/codec"
govcodec "github.com/Finschia/finschia-sdk/x/gov/codec"
)
// RegisterLegacyAminoCodec registers the necessary x/authz interfaces and concrete types
// on the provided LegacyAmino codec. These types are used for Amino JSON serialization.
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
cdc.RegisterConcrete(&CreateValidatorAuthorization{}, "lbm-sdk/CreateValidatorAuthorization", nil)
}
func RegisterInterfaces(registry types.InterfaceRegistry) {
registry.RegisterImplementations(
(*foundation.Authorization)(nil),
&CreateValidatorAuthorization{},
)
}
func init() {
// Register all Amino interfaces and concrete types on the authz and gov Amino codec so that this can later be
// used to properly serialize MsgGrant, MsgExec and MsgSubmitProposal instances
RegisterLegacyAminoCodec(authzcodec.Amino)
RegisterLegacyAminoCodec(govcodec.Amino)
RegisterLegacyAminoCodec(fdncodec.Amino)
}