Documentation ¶
Index ¶
- Constants
- Variables
- func IsUpgradeMsg(msg []sdk.Msg) (uint64, bool)
- func NewMsgVersionChange(txConfig client.TxConfig, version uint64) ([]byte, error)
- type Keeper
- func (k Keeper) ClearIBCState(ctx sdk.Context, lastHeight int64)
- func (k Keeper) GetUpgradePlan(_ sdk.Context) (plan types.Plan, havePlan bool)
- func (k Keeper) GetUpgradedClient(ctx sdk.Context, height int64) ([]byte, bool)
- func (k Keeper) GetUpgradedConsensusState(ctx sdk.Context, lastHeight int64) ([]byte, bool)
- func (k Keeper) ScheduleUpgrade(_ sdk.Context, _ types.Plan) error
- func (k Keeper) SetUpgradedClient(ctx sdk.Context, planHeight int64, bz []byte) error
- func (k Keeper) SetUpgradedConsensusState(ctx sdk.Context, planHeight int64, bz []byte) error
- func (k Keeper) ShouldUpgrade(height int64) bool
- type MsgVersionChange
- func (*MsgVersionChange) Descriptor() ([]byte, []int)
- func (msg *MsgVersionChange) GetSigners() []sdk.AccAddress
- func (m *MsgVersionChange) GetVersion() uint64
- func (m *MsgVersionChange) Marshal() (dAtA []byte, err error)
- func (m *MsgVersionChange) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgVersionChange) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgVersionChange) ProtoMessage()
- func (m *MsgVersionChange) Reset()
- func (m *MsgVersionChange) Size() (n int)
- func (m *MsgVersionChange) String() string
- func (m *MsgVersionChange) Unmarshal(dAtA []byte) error
- func (msg *MsgVersionChange) ValidateBasic() error
- func (m *MsgVersionChange) XXX_DiscardUnknown()
- func (m *MsgVersionChange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgVersionChange) XXX_Merge(src proto.Message)
- func (m *MsgVersionChange) XXX_Size() int
- func (m *MsgVersionChange) XXX_Unmarshal(b []byte) error
- type TypeRegister
- type VersionSetter
Constants ¶
const ( StoreKey = upgradetypes.StoreKey ModuleName = upgradetypes.ModuleName )
Variables ¶
Functions ¶
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper(storeKey storetypes.StoreKey, upgradeHeight int64) Keeper
NewKeeper constructs an upgrade keeper
func (Keeper) ClearIBCState ¶
ClearIBCState clears any planned IBC state
func (Keeper) GetUpgradePlan ¶
GetUpgradePlan implements the ibc upgrade keeper interface. This is used in BeginBlock to know when to write the upgraded consensus state. The IBC module needs to sign over the next consensus state to ensure a smooth transition for counterparty chains. This is implemented as a noop. Any IBC breaking change would be invoked by this upgrade module in end blocker.
func (Keeper) GetUpgradedClient ¶
GetUpgradedClient gets the expected upgraded client for the next version of this chain
func (Keeper) GetUpgradedConsensusState ¶
GetUpgradedConsensusState get the expected upgraded consensus state for the next version of this chain
func (Keeper) ScheduleUpgrade ¶
ScheduleUpgrade implements the ibc upgrade keeper interface. This is a noop as no other process is allowed to schedule an upgrade but the upgrade keeper itself. This is kept around to support the interface.
func (Keeper) SetUpgradedClient ¶
SetUpgradedClient sets the expected upgraded client for the next version of this chain at the last height the current chain will commit.
func (Keeper) SetUpgradedConsensusState ¶
SetUpgradedConsensusState set the expected upgraded consensus state for the next version of this chain using the last height committed on this chain.
func (Keeper) ShouldUpgrade ¶
ShouldUpgrade returns true if the current height is one before the locally provided upgrade height that is passed as a flag
type MsgVersionChange ¶
type MsgVersionChange struct { // the app version this message proposes upgrading to Version uint64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` }
MsgVersionChange is a message that signals an app version change
func (*MsgVersionChange) Descriptor ¶
func (*MsgVersionChange) Descriptor() ([]byte, []int)
func (*MsgVersionChange) GetSigners ¶
func (msg *MsgVersionChange) GetSigners() []sdk.AccAddress
func (*MsgVersionChange) GetVersion ¶
func (m *MsgVersionChange) GetVersion() uint64
func (*MsgVersionChange) Marshal ¶
func (m *MsgVersionChange) Marshal() (dAtA []byte, err error)
func (*MsgVersionChange) MarshalToSizedBuffer ¶
func (m *MsgVersionChange) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgVersionChange) ProtoMessage ¶
func (*MsgVersionChange) ProtoMessage()
func (*MsgVersionChange) Reset ¶
func (m *MsgVersionChange) Reset()
func (*MsgVersionChange) Size ¶
func (m *MsgVersionChange) Size() (n int)
func (*MsgVersionChange) String ¶
func (m *MsgVersionChange) String() string
func (*MsgVersionChange) Unmarshal ¶
func (m *MsgVersionChange) Unmarshal(dAtA []byte) error
func (*MsgVersionChange) ValidateBasic ¶
func (msg *MsgVersionChange) ValidateBasic() error
func (*MsgVersionChange) XXX_DiscardUnknown ¶
func (m *MsgVersionChange) XXX_DiscardUnknown()
func (*MsgVersionChange) XXX_Marshal ¶
func (m *MsgVersionChange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgVersionChange) XXX_Merge ¶
func (m *MsgVersionChange) XXX_Merge(src proto.Message)
func (*MsgVersionChange) XXX_Size ¶
func (m *MsgVersionChange) XXX_Size() int
func (*MsgVersionChange) XXX_Unmarshal ¶
func (m *MsgVersionChange) XXX_Unmarshal(b []byte) error
type TypeRegister ¶
type TypeRegister struct{}
TypeRegister is used to register the upgrade module's types in the encoding config without defining an entire module.
func (TypeRegister) RegisterInterfaces ¶
func (TypeRegister) RegisterInterfaces(registry codectypes.InterfaceRegistry)
RegisterInterfaces registers the upgrade module types.
func (TypeRegister) RegisterLegacyAminoCodec ¶
func (TypeRegister) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
RegisterLegacyAminoCodec registers the upgrade types on the LegacyAmino codec.
type VersionSetter ¶
type VersionSetter func(version uint64)