cosmos-sdk: github.com/cosmos/cosmos-sdk/x/upgrade/types Index | Files

package types

import "github.com/cosmos/cosmos-sdk/x/upgrade/types"

Index

Package Files

codec.go handler.go keys.go plan.go proposal.go querier.go query.pb.go storeloader.go upgrade.pb.go

Constants

const (
    // ModuleName is the name of this module
    ModuleName = "upgrade"

    // RouterKey is used to route governance proposals
    RouterKey = ModuleName

    // StoreKey is the prefix under which we store this module's data
    StoreKey = ModuleName

    // QuerierKey is used to handle abci_query requests
    QuerierKey = ModuleName
)
const (
    // PlanByte specifies the Byte under which a pending upgrade plan is stored in the store
    PlanByte = 0x0
    // DoneByte is a prefix for to look up completed upgrade plan by name
    DoneByte = 0x1
)
const (
    ProposalTypeSoftwareUpgrade       string = "SoftwareUpgrade"
    ProposalTypeCancelSoftwareUpgrade string = "CancelSoftwareUpgrade"
)
const (
    QueryCurrent = "current"
    QueryApplied = "applied"
)

query endpoints supported by the upgrade Querier

Variables

var (
    ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
    ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)
var (
    ErrInvalidLengthUpgrade        = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowUpgrade          = fmt.Errorf("proto: integer overflow")
    ErrUnexpectedEndOfGroupUpgrade = fmt.Errorf("proto: unexpected end of group")
)

func NewCancelSoftwareUpgradeProposal Uses

func NewCancelSoftwareUpgradeProposal(title, description string) gov.Content

func NewSoftwareUpgradeProposal Uses

func NewSoftwareUpgradeProposal(title, description string, plan Plan) gov.Content

func PlanKey Uses

func PlanKey() []byte

PlanKey is the key under which the current plan is saved We store PlanByte as a const to keep it immutable (unlike a []byte)

func RegisterCodec Uses

func RegisterCodec(cdc *codec.LegacyAmino)

RegisterCodec registers concrete types on the Amino codec

func RegisterInterfaces Uses

func RegisterInterfaces(registry types.InterfaceRegistry)

func RegisterQueryServer Uses

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

func UpgradeStoreLoader Uses

func UpgradeStoreLoader(upgradeHeight int64, storeUpgrades *store.StoreUpgrades) baseapp.StoreLoader

UpgradeStoreLoader is used to prepare baseapp with a fixed StoreLoader pattern. This is useful for custom upgrade loading logic.

type CancelSoftwareUpgradeProposal Uses

type CancelSoftwareUpgradeProposal struct {
    Title       string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
    Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
}

CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software upgrade

func (*CancelSoftwareUpgradeProposal) Descriptor Uses

func (*CancelSoftwareUpgradeProposal) Descriptor() ([]byte, []int)

func (*CancelSoftwareUpgradeProposal) Equal Uses

func (this *CancelSoftwareUpgradeProposal) Equal(that interface{}) bool

func (*CancelSoftwareUpgradeProposal) GetDescription Uses

func (sup *CancelSoftwareUpgradeProposal) GetDescription() string

func (*CancelSoftwareUpgradeProposal) GetTitle Uses

func (sup *CancelSoftwareUpgradeProposal) GetTitle() string

func (*CancelSoftwareUpgradeProposal) Marshal Uses

func (m *CancelSoftwareUpgradeProposal) Marshal() (dAtA []byte, err error)

func (*CancelSoftwareUpgradeProposal) MarshalTo Uses

func (m *CancelSoftwareUpgradeProposal) MarshalTo(dAtA []byte) (int, error)

func (*CancelSoftwareUpgradeProposal) MarshalToSizedBuffer Uses

func (m *CancelSoftwareUpgradeProposal) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*CancelSoftwareUpgradeProposal) ProposalRoute Uses

func (sup *CancelSoftwareUpgradeProposal) ProposalRoute() string

func (*CancelSoftwareUpgradeProposal) ProposalType Uses

func (sup *CancelSoftwareUpgradeProposal) ProposalType() string

func (*CancelSoftwareUpgradeProposal) ProtoMessage Uses

func (*CancelSoftwareUpgradeProposal) ProtoMessage()

func (*CancelSoftwareUpgradeProposal) Reset Uses

func (m *CancelSoftwareUpgradeProposal) Reset()

func (*CancelSoftwareUpgradeProposal) Size Uses

func (m *CancelSoftwareUpgradeProposal) Size() (n int)

func (CancelSoftwareUpgradeProposal) String Uses

func (sup CancelSoftwareUpgradeProposal) String() string

func (*CancelSoftwareUpgradeProposal) Unmarshal Uses

func (m *CancelSoftwareUpgradeProposal) Unmarshal(dAtA []byte) error

func (*CancelSoftwareUpgradeProposal) ValidateBasic Uses

func (sup *CancelSoftwareUpgradeProposal) ValidateBasic() error

func (*CancelSoftwareUpgradeProposal) XXX_DiscardUnknown Uses

func (m *CancelSoftwareUpgradeProposal) XXX_DiscardUnknown()

func (*CancelSoftwareUpgradeProposal) XXX_Marshal Uses

func (m *CancelSoftwareUpgradeProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CancelSoftwareUpgradeProposal) XXX_Merge Uses

func (m *CancelSoftwareUpgradeProposal) XXX_Merge(src proto.Message)

func (*CancelSoftwareUpgradeProposal) XXX_Size Uses

func (m *CancelSoftwareUpgradeProposal) XXX_Size() int

func (*CancelSoftwareUpgradeProposal) XXX_Unmarshal Uses

func (m *CancelSoftwareUpgradeProposal) XXX_Unmarshal(b []byte) error

type Plan Uses

type Plan struct {
    // Sets the name for the upgrade. This name will be used by the upgraded version of the software to apply any
    // special "on-upgrade" commands during the first BeginBlock method after the upgrade is applied. It is also used
    // to detect whether a software version can handle a given upgrade. If no upgrade handler with this name has been
    // set in the software, it will be assumed that the software is out-of-date when the upgrade Time or Height
    // is reached and the software will exit.
    Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
    // The time after which the upgrade must be performed.
    // Leave set to its zero value to use a pre-defined Height instead.
    Time time.Time `protobuf:"bytes,2,opt,name=time,proto3,stdtime" json:"time"`
    // The height at which the upgrade must be performed.
    // Only used if Time is not set.
    Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"`
    // Any application specific upgrade info to be included on-chain
    // such as a git commit that validators could automatically upgrade to
    Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"`
}

Plan specifies information about a planned upgrade and when it should occur

func (*Plan) Descriptor Uses

func (*Plan) Descriptor() ([]byte, []int)

func (Plan) DueAt Uses

func (p Plan) DueAt() string

DueAt is a string representation of when this plan is due to be executed

func (*Plan) Equal Uses

func (this *Plan) Equal(that interface{}) bool

func (*Plan) Marshal Uses

func (m *Plan) Marshal() (dAtA []byte, err error)

func (*Plan) MarshalTo Uses

func (m *Plan) MarshalTo(dAtA []byte) (int, error)

func (*Plan) MarshalToSizedBuffer Uses

func (m *Plan) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Plan) ProtoMessage Uses

func (*Plan) ProtoMessage()

func (*Plan) Reset Uses

func (m *Plan) Reset()

func (Plan) ShouldExecute Uses

func (p Plan) ShouldExecute(ctx sdk.Context) bool

ShouldExecute returns true if the Plan is ready to execute given the current context

func (*Plan) Size Uses

func (m *Plan) Size() (n int)

func (Plan) String Uses

func (p Plan) String() string

func (*Plan) Unmarshal Uses

func (m *Plan) Unmarshal(dAtA []byte) error

func (Plan) ValidateBasic Uses

func (p Plan) ValidateBasic() error

ValidateBasic does basic validation of a Plan

func (*Plan) XXX_DiscardUnknown Uses

func (m *Plan) XXX_DiscardUnknown()

func (*Plan) XXX_Marshal Uses

func (m *Plan) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Plan) XXX_Merge Uses

func (m *Plan) XXX_Merge(src proto.Message)

func (*Plan) XXX_Size Uses

func (m *Plan) XXX_Size() int

func (*Plan) XXX_Unmarshal Uses

func (m *Plan) XXX_Unmarshal(b []byte) error

type QueryAppliedPlanRequest Uses

type QueryAppliedPlanRequest struct {
    // name is the name of the applied plan to query for.
    Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
}

QueryCurrentPlanRequest is the request type for the Query/AppliedPlan RPC method.

func (*QueryAppliedPlanRequest) Descriptor Uses

func (*QueryAppliedPlanRequest) Descriptor() ([]byte, []int)

func (*QueryAppliedPlanRequest) GetName Uses

func (m *QueryAppliedPlanRequest) GetName() string

func (*QueryAppliedPlanRequest) Marshal Uses

func (m *QueryAppliedPlanRequest) Marshal() (dAtA []byte, err error)

func (*QueryAppliedPlanRequest) MarshalTo Uses

func (m *QueryAppliedPlanRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryAppliedPlanRequest) MarshalToSizedBuffer Uses

func (m *QueryAppliedPlanRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryAppliedPlanRequest) ProtoMessage Uses

func (*QueryAppliedPlanRequest) ProtoMessage()

func (*QueryAppliedPlanRequest) Reset Uses

func (m *QueryAppliedPlanRequest) Reset()

func (*QueryAppliedPlanRequest) Size Uses

func (m *QueryAppliedPlanRequest) Size() (n int)

func (*QueryAppliedPlanRequest) String Uses

func (m *QueryAppliedPlanRequest) String() string

func (*QueryAppliedPlanRequest) Unmarshal Uses

func (m *QueryAppliedPlanRequest) Unmarshal(dAtA []byte) error

func (*QueryAppliedPlanRequest) XXX_DiscardUnknown Uses

func (m *QueryAppliedPlanRequest) XXX_DiscardUnknown()

func (*QueryAppliedPlanRequest) XXX_Marshal Uses

func (m *QueryAppliedPlanRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryAppliedPlanRequest) XXX_Merge Uses

func (m *QueryAppliedPlanRequest) XXX_Merge(src proto.Message)

func (*QueryAppliedPlanRequest) XXX_Size Uses

func (m *QueryAppliedPlanRequest) XXX_Size() int

func (*QueryAppliedPlanRequest) XXX_Unmarshal Uses

func (m *QueryAppliedPlanRequest) XXX_Unmarshal(b []byte) error

type QueryAppliedPlanResponse Uses

type QueryAppliedPlanResponse struct {
    // height is the block height at which the plan was applied.
    Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
}

QueryAppliedPlanResponse is the response type for the Query/AppliedPlan RPC method.

func (*QueryAppliedPlanResponse) Descriptor Uses

func (*QueryAppliedPlanResponse) Descriptor() ([]byte, []int)

func (*QueryAppliedPlanResponse) GetHeight Uses

func (m *QueryAppliedPlanResponse) GetHeight() int64

func (*QueryAppliedPlanResponse) Marshal Uses

func (m *QueryAppliedPlanResponse) Marshal() (dAtA []byte, err error)

func (*QueryAppliedPlanResponse) MarshalTo Uses

func (m *QueryAppliedPlanResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryAppliedPlanResponse) MarshalToSizedBuffer Uses

func (m *QueryAppliedPlanResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryAppliedPlanResponse) ProtoMessage Uses

func (*QueryAppliedPlanResponse) ProtoMessage()

func (*QueryAppliedPlanResponse) Reset Uses

func (m *QueryAppliedPlanResponse) Reset()

func (*QueryAppliedPlanResponse) Size Uses

func (m *QueryAppliedPlanResponse) Size() (n int)

func (*QueryAppliedPlanResponse) String Uses

func (m *QueryAppliedPlanResponse) String() string

func (*QueryAppliedPlanResponse) Unmarshal Uses

func (m *QueryAppliedPlanResponse) Unmarshal(dAtA []byte) error

func (*QueryAppliedPlanResponse) XXX_DiscardUnknown Uses

func (m *QueryAppliedPlanResponse) XXX_DiscardUnknown()

func (*QueryAppliedPlanResponse) XXX_Marshal Uses

func (m *QueryAppliedPlanResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryAppliedPlanResponse) XXX_Merge Uses

func (m *QueryAppliedPlanResponse) XXX_Merge(src proto.Message)

func (*QueryAppliedPlanResponse) XXX_Size Uses

func (m *QueryAppliedPlanResponse) XXX_Size() int

func (*QueryAppliedPlanResponse) XXX_Unmarshal Uses

func (m *QueryAppliedPlanResponse) XXX_Unmarshal(b []byte) error

type QueryClient Uses

type QueryClient interface {
    // CurrentPlan queries the current upgrade plan.
    CurrentPlan(ctx context.Context, in *QueryCurrentPlanRequest, opts ...grpc.CallOption) (*QueryCurrentPlanResponse, error)
    // AppliedPlan queries a previously applied upgrade plan by its name.
    AppliedPlan(ctx context.Context, in *QueryAppliedPlanRequest, opts ...grpc.CallOption) (*QueryAppliedPlanResponse, error)
}

QueryClient is the client API for Query service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewQueryClient Uses

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryCurrentPlanRequest Uses

type QueryCurrentPlanRequest struct {
}

QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC method.

func (*QueryCurrentPlanRequest) Descriptor Uses

func (*QueryCurrentPlanRequest) Descriptor() ([]byte, []int)

func (*QueryCurrentPlanRequest) Marshal Uses

func (m *QueryCurrentPlanRequest) Marshal() (dAtA []byte, err error)

func (*QueryCurrentPlanRequest) MarshalTo Uses

func (m *QueryCurrentPlanRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryCurrentPlanRequest) MarshalToSizedBuffer Uses

func (m *QueryCurrentPlanRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryCurrentPlanRequest) ProtoMessage Uses

func (*QueryCurrentPlanRequest) ProtoMessage()

func (*QueryCurrentPlanRequest) Reset Uses

func (m *QueryCurrentPlanRequest) Reset()

func (*QueryCurrentPlanRequest) Size Uses

func (m *QueryCurrentPlanRequest) Size() (n int)

func (*QueryCurrentPlanRequest) String Uses

func (m *QueryCurrentPlanRequest) String() string

func (*QueryCurrentPlanRequest) Unmarshal Uses

func (m *QueryCurrentPlanRequest) Unmarshal(dAtA []byte) error

func (*QueryCurrentPlanRequest) XXX_DiscardUnknown Uses

func (m *QueryCurrentPlanRequest) XXX_DiscardUnknown()

func (*QueryCurrentPlanRequest) XXX_Marshal Uses

func (m *QueryCurrentPlanRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryCurrentPlanRequest) XXX_Merge Uses

func (m *QueryCurrentPlanRequest) XXX_Merge(src proto.Message)

func (*QueryCurrentPlanRequest) XXX_Size Uses

func (m *QueryCurrentPlanRequest) XXX_Size() int

func (*QueryCurrentPlanRequest) XXX_Unmarshal Uses

func (m *QueryCurrentPlanRequest) XXX_Unmarshal(b []byte) error

type QueryCurrentPlanResponse Uses

type QueryCurrentPlanResponse struct {
    // plan is the current upgrade plan.
    Plan *Plan `protobuf:"bytes,1,opt,name=plan,proto3" json:"plan,omitempty"`
}

QueryCurrentPlanResponse is the response type for the Query/CurrentPlan RPC method.

func (*QueryCurrentPlanResponse) Descriptor Uses

func (*QueryCurrentPlanResponse) Descriptor() ([]byte, []int)

func (*QueryCurrentPlanResponse) GetPlan Uses

func (m *QueryCurrentPlanResponse) GetPlan() *Plan

func (*QueryCurrentPlanResponse) Marshal Uses

func (m *QueryCurrentPlanResponse) Marshal() (dAtA []byte, err error)

func (*QueryCurrentPlanResponse) MarshalTo Uses

func (m *QueryCurrentPlanResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryCurrentPlanResponse) MarshalToSizedBuffer Uses

func (m *QueryCurrentPlanResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryCurrentPlanResponse) ProtoMessage Uses

func (*QueryCurrentPlanResponse) ProtoMessage()

func (*QueryCurrentPlanResponse) Reset Uses

func (m *QueryCurrentPlanResponse) Reset()

func (*QueryCurrentPlanResponse) Size Uses

func (m *QueryCurrentPlanResponse) Size() (n int)

func (*QueryCurrentPlanResponse) String Uses

func (m *QueryCurrentPlanResponse) String() string

func (*QueryCurrentPlanResponse) Unmarshal Uses

func (m *QueryCurrentPlanResponse) Unmarshal(dAtA []byte) error

func (*QueryCurrentPlanResponse) XXX_DiscardUnknown Uses

func (m *QueryCurrentPlanResponse) XXX_DiscardUnknown()

func (*QueryCurrentPlanResponse) XXX_Marshal Uses

func (m *QueryCurrentPlanResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryCurrentPlanResponse) XXX_Merge Uses

func (m *QueryCurrentPlanResponse) XXX_Merge(src proto.Message)

func (*QueryCurrentPlanResponse) XXX_Size Uses

func (m *QueryCurrentPlanResponse) XXX_Size() int

func (*QueryCurrentPlanResponse) XXX_Unmarshal Uses

func (m *QueryCurrentPlanResponse) XXX_Unmarshal(b []byte) error

type QueryServer Uses

type QueryServer interface {
    // CurrentPlan queries the current upgrade plan.
    CurrentPlan(context.Context, *QueryCurrentPlanRequest) (*QueryCurrentPlanResponse, error)
    // AppliedPlan queries a previously applied upgrade plan by its name.
    AppliedPlan(context.Context, *QueryAppliedPlanRequest) (*QueryAppliedPlanResponse, error)
}

QueryServer is the server API for Query service.

type SoftwareUpgradeProposal Uses

type SoftwareUpgradeProposal struct {
    Title       string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
    Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
    Plan        Plan   `protobuf:"bytes,3,opt,name=plan,proto3" json:"plan"`
}

SoftwareUpgradeProposal is a gov Content type for initiating a software upgrade

func (*SoftwareUpgradeProposal) Descriptor Uses

func (*SoftwareUpgradeProposal) Descriptor() ([]byte, []int)

func (*SoftwareUpgradeProposal) Equal Uses

func (this *SoftwareUpgradeProposal) Equal(that interface{}) bool

func (*SoftwareUpgradeProposal) GetDescription Uses

func (sup *SoftwareUpgradeProposal) GetDescription() string

func (*SoftwareUpgradeProposal) GetTitle Uses

func (sup *SoftwareUpgradeProposal) GetTitle() string

func (*SoftwareUpgradeProposal) Marshal Uses

func (m *SoftwareUpgradeProposal) Marshal() (dAtA []byte, err error)

func (*SoftwareUpgradeProposal) MarshalTo Uses

func (m *SoftwareUpgradeProposal) MarshalTo(dAtA []byte) (int, error)

func (*SoftwareUpgradeProposal) MarshalToSizedBuffer Uses

func (m *SoftwareUpgradeProposal) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SoftwareUpgradeProposal) ProposalRoute Uses

func (sup *SoftwareUpgradeProposal) ProposalRoute() string

func (*SoftwareUpgradeProposal) ProposalType Uses

func (sup *SoftwareUpgradeProposal) ProposalType() string

func (*SoftwareUpgradeProposal) ProtoMessage Uses

func (*SoftwareUpgradeProposal) ProtoMessage()

func (*SoftwareUpgradeProposal) Reset Uses

func (m *SoftwareUpgradeProposal) Reset()

func (*SoftwareUpgradeProposal) Size Uses

func (m *SoftwareUpgradeProposal) Size() (n int)

func (SoftwareUpgradeProposal) String Uses

func (sup SoftwareUpgradeProposal) String() string

func (*SoftwareUpgradeProposal) Unmarshal Uses

func (m *SoftwareUpgradeProposal) Unmarshal(dAtA []byte) error

func (*SoftwareUpgradeProposal) ValidateBasic Uses

func (sup *SoftwareUpgradeProposal) ValidateBasic() error

func (*SoftwareUpgradeProposal) XXX_DiscardUnknown Uses

func (m *SoftwareUpgradeProposal) XXX_DiscardUnknown()

func (*SoftwareUpgradeProposal) XXX_Marshal Uses

func (m *SoftwareUpgradeProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SoftwareUpgradeProposal) XXX_Merge Uses

func (m *SoftwareUpgradeProposal) XXX_Merge(src proto.Message)

func (*SoftwareUpgradeProposal) XXX_Size Uses

func (m *SoftwareUpgradeProposal) XXX_Size() int

func (*SoftwareUpgradeProposal) XXX_Unmarshal Uses

func (m *SoftwareUpgradeProposal) XXX_Unmarshal(b []byte) error

type UnimplementedQueryServer Uses

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) AppliedPlan Uses

func (*UnimplementedQueryServer) AppliedPlan(ctx context.Context, req *QueryAppliedPlanRequest) (*QueryAppliedPlanResponse, error)

func (*UnimplementedQueryServer) CurrentPlan Uses

func (*UnimplementedQueryServer) CurrentPlan(ctx context.Context, req *QueryCurrentPlanRequest) (*QueryCurrentPlanResponse, error)

type UpgradeHandler Uses

type UpgradeHandler func(ctx sdk.Context, plan Plan)

UpgradeHandler specifies the type of function that is called when an upgrade is applied

Package types imports 22 packages (graph) and is imported by 5 packages. Updated 2020-08-13. Refresh now. Tools for package owners.