-
Notifications
You must be signed in to change notification settings - Fork 396
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #249 from CosmWasm/0.9.1_to_cosmos-stargate_cli_fixes
0.9.1 to cosmos stargate cli fixes
- Loading branch information
Showing
9 changed files
with
62 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,36 @@ | ||
package app | ||
|
||
import ( | ||
"github.com/CosmWasm/wasmd/x/wasm" | ||
"github.com/cosmos/cosmos-sdk/simapp" | ||
simparams "github.com/cosmos/cosmos-sdk/simapp/params" | ||
"github.com/cosmos/cosmos-sdk/client" | ||
"github.com/cosmos/cosmos-sdk/codec" | ||
"github.com/cosmos/cosmos-sdk/codec/types" | ||
"github.com/cosmos/cosmos-sdk/std" | ||
"github.com/cosmos/cosmos-sdk/x/auth/tx" | ||
) | ||
|
||
func MakeEncodingConfig() simparams.EncodingConfig { | ||
encodingConfig := simapp.MakeEncodingConfig() // todo: this is the simapp !!! | ||
wasm.RegisterCodec(encodingConfig.Amino) | ||
wasm.RegisterInterfaces(encodingConfig.InterfaceRegistry) | ||
return encodingConfig | ||
// EncodingConfig specifies the concrete encoding types to use for a given app. | ||
// This is provided for compatibility between protobuf and amino implementations. | ||
type EncodingConfig struct { | ||
InterfaceRegistry types.InterfaceRegistry | ||
Marshaler codec.Marshaler | ||
TxConfig client.TxConfig | ||
Amino *codec.Codec | ||
} | ||
|
||
func MakeEncodingConfig() EncodingConfig { | ||
amino := codec.New() | ||
interfaceRegistry := types.NewInterfaceRegistry() | ||
marshaler := codec.NewHybridCodec(amino, interfaceRegistry) | ||
txGen := tx.NewTxConfig(codec.NewProtoCodec(interfaceRegistry), std.DefaultPublicKeyCodec{}, tx.DefaultSignModes) | ||
|
||
std.RegisterCodec(amino) | ||
std.RegisterInterfaces(interfaceRegistry) | ||
ModuleBasics.RegisterCodec(amino) | ||
ModuleBasics.RegisterInterfaces(interfaceRegistry) | ||
return EncodingConfig{ | ||
InterfaceRegistry: interfaceRegistry, | ||
Marshaler: marshaler, | ||
TxConfig: txGen, | ||
Amino: amino, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters