-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Enable proto tx by default and add test_amino build flag. * Enable proto TxDecoder * update makefile * fix conflicts * Revert AminoCodec change * Make test-unit-amino default for now * Make test-unit-amino default for now Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: sahith-narahari <sahithnarahari@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
ee04dd7
commit 0a498d8
Showing
5 changed files
with
39 additions
and
8 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// +build test_proto | ||
|
||
// TODO switch to !test_amino build flag once proto Tx's are ready | ||
package params | ||
|
||
import ( | ||
"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" | ||
) | ||
|
||
// MakeEncodingConfig creates an EncodingConfig for an amino based test configuration. | ||
func MakeEncodingConfig() EncodingConfig { | ||
cdc := codec.New() | ||
interfaceRegistry := types.NewInterfaceRegistry() | ||
marshaler := codec.NewHybridCodec(cdc, interfaceRegistry) | ||
txGen := tx.NewTxConfig(marshaler, std.DefaultPublicKeyCodec{}, tx.DefaultSignModeHandler()) | ||
|
||
return EncodingConfig{ | ||
InterfaceRegistry: interfaceRegistry, | ||
Marshaler: marshaler, | ||
TxConfig: txGen, | ||
Amino: cdc, | ||
} | ||
} |