-
Notifications
You must be signed in to change notification settings - Fork 7
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 #28 from bze-alphateam/feature/v6.1
v6.1
- Loading branch information
Showing
19 changed files
with
2,072 additions
and
4,430 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package app | ||
|
||
import ( | ||
"github.com/cosmos/cosmos-sdk/client" | ||
"github.com/cosmos/cosmos-sdk/codec" | ||
codectypes "github.com/cosmos/cosmos-sdk/codec/types" | ||
"github.com/cosmos/cosmos-sdk/std" | ||
"github.com/cosmos/cosmos-sdk/x/auth/tx" | ||
) | ||
|
||
// 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 codectypes.InterfaceRegistry | ||
Marshaler codec.Codec | ||
TxConfig client.TxConfig | ||
Amino *codec.LegacyAmino | ||
} | ||
|
||
// MakeEncodingConfig creates an EncodingConfig instance | ||
func NewEncodingConfig() EncodingConfig { | ||
amino := codec.NewLegacyAmino() | ||
interfaceRegistry := codectypes.NewInterfaceRegistry() | ||
marshaler := codec.NewProtoCodec(interfaceRegistry) | ||
txCfg := tx.NewTxConfig(marshaler, tx.DefaultSignModes) | ||
|
||
encodingConfig := EncodingConfig{ | ||
InterfaceRegistry: interfaceRegistry, | ||
Marshaler: marshaler, | ||
TxConfig: txCfg, | ||
Amino: amino, | ||
} | ||
|
||
return encodingConfig | ||
} | ||
|
||
// MakeEncodingConfig creates an EncodingConfig instance; registers types with codec and interface | ||
// registry | ||
func MakeEncodingConfig() EncodingConfig { | ||
encodingConfig := NewEncodingConfig() | ||
|
||
std.RegisterLegacyAminoCodec(encodingConfig.Amino) | ||
std.RegisterInterfaces(encodingConfig.InterfaceRegistry) | ||
ModuleBasics.RegisterLegacyAminoCodec(encodingConfig.Amino) | ||
ModuleBasics.RegisterInterfaces(encodingConfig.InterfaceRegistry) | ||
|
||
return encodingConfig | ||
} |
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,16 @@ | ||
package v610 | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/cosmos-sdk/types/module" | ||
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" | ||
) | ||
|
||
const UpgradeName = "v6.1.0" | ||
|
||
func CreateUpgradeHandler() upgradetypes.UpgradeHandler { | ||
return func(ctx sdk.Context, _plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { | ||
// nothing to do | ||
return vm, nil | ||
} | ||
} |
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,18 @@ | ||
package main | ||
|
||
import sdk "github.com/cosmos/cosmos-sdk/types" | ||
|
||
// Define prefixes for addresses and public keys | ||
func setAddressPrefixes(accountAddressPrefix string) { | ||
accountPubKeyPrefix := accountAddressPrefix + "pub" | ||
validatorAddressPrefix := accountAddressPrefix + "valoper" | ||
validatorPubKeyPrefix := accountAddressPrefix + "valoperpub" | ||
consNodeAddressPrefix := accountAddressPrefix + "valcons" | ||
consNodePubKeyPrefix := accountAddressPrefix + "valconspub" | ||
|
||
config := sdk.GetConfig() | ||
config.SetBech32PrefixForAccount(accountAddressPrefix, accountPubKeyPrefix) | ||
config.SetBech32PrefixForValidator(validatorAddressPrefix, validatorPubKeyPrefix) | ||
config.SetBech32PrefixForConsensusNode(consNodeAddressPrefix, consNodePubKeyPrefix) | ||
config.Seal() | ||
} |
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,21 @@ | ||
package main | ||
|
||
import serverconfig "github.com/cosmos/cosmos-sdk/server/config" | ||
|
||
// Generate contents for `app.toml`. Take the default template and config, append custom parameters | ||
func initAppConfig() (string, interface{}) { | ||
template := serverconfig.DefaultConfigTemplate | ||
cfg := serverconfig.DefaultConfig() | ||
|
||
// The SDK's default minimum gas price is set to "" (empty value) inside app.toml. If left empty | ||
// by validators, the node will halt on startup. However, the chain developer can set a default | ||
// app.toml value for their validators here. | ||
// | ||
// In summary: | ||
// - if you leave srvCfg.MinGasPrices = "", all validators MUST tweak their own app.toml config, | ||
// - if you set srvCfg.MinGasPrices non-empty, validators CAN tweak their own app.toml to override, | ||
// or use this default value. | ||
cfg.MinGasPrices = "0ubze" | ||
|
||
return template, cfg | ||
} |
Oops, something went wrong.