cosmos-sdk/core/app/app.go
Matt Kocubinski 9f42137462
refactor: move baseapp/AppVersionModifer -> core/app (#20361)
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2024-05-13 14:53:11 +00:00

77 lines
1.6 KiB
Go

package app
import (
"context"
"time"
appmodulev2 "cosmossdk.io/core/appmodule/v2"
"cosmossdk.io/core/event"
"cosmossdk.io/core/transaction"
)
type QueryRequest struct {
Height int64
Path string
Data []byte
}
type QueryResponse struct {
Height int64
Value []byte
}
type BlockRequest[T any] struct {
Height uint64
Time time.Time
Hash []byte
ChainId string
AppHash []byte
Txs []T
ConsensusMessages []transaction.Msg
}
type BlockResponse struct {
Apphash []byte
ConsensusMessagesResponse []transaction.Msg
ValidatorUpdates []appmodulev2.ValidatorUpdate
PreBlockEvents []event.Event
BeginBlockEvents []event.Event
TxResults []TxResult
EndBlockEvents []event.Event
}
type RequestInitChain struct {
Time time.Time
ChainId string
Validators []appmodulev2.ValidatorUpdate
AppStateBytes []byte
InitialHeight int64
}
type ResponseInitChain struct {
Validators []appmodulev2.ValidatorUpdate
AppHash []byte
}
type TxResult struct {
Events []event.Event
Resp []transaction.Msg
Error error
Code uint32
Data []byte
Log string
Info string
GasWanted uint64
GasUsed uint64
Codespace string
}
// VersionModifier defines the interface fulfilled by BaseApp
// which allows getting and setting it's appVersion field. This
// in turn updates the consensus params that are sent to the
// consensus engine in EndBlock
type VersionModifier interface {
SetAppVersion(context.Context, uint64) error
AppVersion(context.Context) (uint64, error)
}