-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(fix) Regenerated all compiled protos. Updated CreateDenom example sc…
…ript. Updated all markets and tokens INI files
- Loading branch information
Showing
59 changed files
with
28,594 additions
and
1,421 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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package types | ||
|
||
import ( | ||
"cosmossdk.io/x/tx/signing" | ||
"github.com/cosmos/cosmos-sdk/client" | ||
"github.com/cosmos/cosmos-sdk/codec" | ||
"github.com/cosmos/cosmos-sdk/codec/address" | ||
"github.com/cosmos/cosmos-sdk/codec/types" | ||
sdktypes "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/cosmos-sdk/x/auth/tx" | ||
"github.com/cosmos/gogoproto/proto" | ||
|
||
injcodec "github.com/InjectiveLabs/sdk-go/chain/codec" | ||
) | ||
|
||
type EncodingConfig struct { | ||
InterfaceRegistry types.InterfaceRegistry | ||
Codec codec.Codec | ||
TxConfig client.TxConfig | ||
Amino *codec.LegacyAmino | ||
} | ||
|
||
// MakeEncodingConfig creates an EncodingConfig for testing | ||
func MakeEncodingConfig() EncodingConfig { | ||
cdc := codec.NewLegacyAmino() | ||
interfaceRegistry := NewInterfaceRegistry() | ||
appCodec := codec.NewProtoCodec(interfaceRegistry) | ||
encodingConfig := EncodingConfig{ | ||
InterfaceRegistry: interfaceRegistry, | ||
Codec: appCodec, | ||
TxConfig: tx.NewTxConfig(appCodec, tx.DefaultSignModes), | ||
Amino: cdc, | ||
} | ||
|
||
injcodec.RegisterInterfaces(encodingConfig.InterfaceRegistry) | ||
injcodec.RegisterLegacyAminoCodec(encodingConfig.Amino) | ||
return encodingConfig | ||
} | ||
|
||
// NewInterfaceRegistry returns a new InterfaceRegistry | ||
func NewInterfaceRegistry() types.InterfaceRegistry { | ||
registry, err := types.NewInterfaceRegistryWithOptions(types.InterfaceRegistryOptions{ | ||
ProtoFiles: proto.HybridResolver, | ||
SigningOptions: signing.Options{ | ||
AddressCodec: address.Bech32Codec{ | ||
Bech32Prefix: sdktypes.GetConfig().GetBech32AccountAddrPrefix(), | ||
}, | ||
ValidatorAddressCodec: address.Bech32Codec{ | ||
Bech32Prefix: sdktypes.GetConfig().GetBech32ValidatorAddrPrefix(), | ||
}, | ||
}, | ||
}) | ||
if err != nil { | ||
panic(err) | ||
} | ||
return registry | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Oops, something went wrong.