Documentation ¶
Index ¶
Constants ¶
const ( MochaChainID = "mocha" ArabicaChainID = "arabica-4" BlockspaceraceChainID = "blockspacerace-0" MainnetChainID = "celestia-1" )
const (
CustomVersionConfigKey = "custom-version-config"
)
Variables ¶
This section is empty.
Functions ¶
func EndBlocker ¶
func EndBlocker(ctx sdk.Context, keeper Keeper, resp abci.ResponseEndBlock) abci.ResponseEndBlock
EndBlocker will modify the app version if the current height is equal to a predefined height at which the app version should be changed.
func StandardChainVersions ¶
func StandardChainVersions() map[string]ChainVersionConfig
StandardChainVersions returns a map of chain IDs to their respective ChainVersionConfig. Each hardfork should be added to this map.
Types ¶
type ChainVersionConfig ¶
type ChainVersionConfig struct {
Ranges []HeightRange
}
ChainVersionConfig stores a set of version ranges and provides a method to retrieve the correct version for a given height.
func NewChainVersionConfig ¶
func NewChainVersionConfig(versions map[uint64]int64) ChainVersionConfig
NewChainVersionConfig creates a new ChainVersionConfig from a map of app versions to starting heights.
func (ChainVersionConfig) GetVersion ¶
func (v ChainVersionConfig) GetVersion(height int64) (appVersion uint64)
GetVersion returns the app version for a given height.
type HeightRange ¶
HeightRange is a range of heights that a version is valid for. It is an internal struct used to search for the correct version given a height, and should only be created using the createRange function. Heights are non-overlapping and inclusive, meaning that the version is valid for all heights >= Start and <= End.
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper(versionSetter exported.ProtocolVersionSetter, nonStandardVersions map[string]ChainVersionConfig) Keeper