/
encoding.go
30 lines (24 loc) · 1.07 KB
/
encoding.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
/*
Copyright [2019] - [2021], PERSISTENCE TECHNOLOGIES PTE. LTD. and the persistenceCore contributors
SPDX-License-Identifier: Apache-2.0
*/
package app
import (
"github.com/cosmos/cosmos-sdk/std"
sdkdistr "github.com/cosmos/cosmos-sdk/x/distribution"
sdkslashing "github.com/cosmos/cosmos-sdk/x/slashing"
sdkstaking "github.com/cosmos/cosmos-sdk/x/staking"
"github.com/persistenceOne/persistenceCore/v10/app/params"
)
// MakeEncodingConfig creates an EncodingConfig for testing
func MakeEncodingConfig() params.EncodingConfig {
encodingConfig := params.MakeEncodingConfig()
std.RegisterLegacyAminoCodec(encodingConfig.Amino)
std.RegisterInterfaces(encodingConfig.InterfaceRegistry)
ModuleBasics.RegisterLegacyAminoCodec(encodingConfig.Amino)
ModuleBasics.RegisterInterfaces(encodingConfig.InterfaceRegistry)
sdkstaking.AppModuleBasic{}.RegisterInterfaces(encodingConfig.InterfaceRegistry)
sdkslashing.AppModuleBasic{}.RegisterInterfaces(encodingConfig.InterfaceRegistry)
sdkdistr.AppModuleBasic{}.RegisterInterfaces(encodingConfig.InterfaceRegistry)
return encodingConfig
}