Co-authored-by: Julián Toledano <JulianToledano@users.noreply.github.com>
This commit is contained in:
parent
fbfb6e59c9
commit
a2e1cd0193
@ -38,6 +38,8 @@ const (
|
||||
QueryPathBroadcastTx = "/cosmos.tx.v1beta1.Service/BroadcastTx"
|
||||
)
|
||||
|
||||
// InitChain implements the ABCI interface. It initializes the application's state
|
||||
// and sets up the initial validator set.
|
||||
func (app *BaseApp) InitChain(req *abci.InitChainRequest) (*abci.InitChainResponse, error) {
|
||||
if req.ChainId != app.chainID {
|
||||
return nil, fmt.Errorf("invalid chain-id on InitChain; expected: %s, got: %s", app.chainID, req.ChainId)
|
||||
@ -135,6 +137,7 @@ func (app *BaseApp) InitChain(req *abci.InitChainRequest) (*abci.InitChainRespon
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Info implements the ABCI interface. It returns information about the application.
|
||||
func (app *BaseApp) Info(_ *abci.InfoRequest) (*abci.InfoResponse, error) {
|
||||
lastCommitID := app.cms.LastCommitID()
|
||||
appVersion := InitialAppVersion
|
||||
|
||||
@ -23,7 +23,7 @@ import (
|
||||
)
|
||||
|
||||
type (
|
||||
// ValidatorStore defines the interface contract require for verifying vote
|
||||
// ValidatorStore defines the interface contract required for verifying vote
|
||||
// extension signatures. Typically, this will be implemented by the x/staking
|
||||
// module, which has knowledge of the CometBFT public key.
|
||||
ValidatorStore interface {
|
||||
@ -84,7 +84,7 @@ func ValidateVoteExtensions(
|
||||
totalVP += vote.Validator.Power
|
||||
|
||||
// Only check + include power if the vote is a commit vote. There must be super-majority, otherwise the
|
||||
// previous block (the block vote is for) could not have been committed.
|
||||
// previous block (the block the vote is for) could not have been committed.
|
||||
if vote.BlockIdFlag != cmtproto.BlockIDFlagCommit {
|
||||
continue
|
||||
}
|
||||
|
||||
@ -419,7 +419,7 @@ func (s *ABCIUtilsTestSuite) TestValidateVoteExtensionsIncorrectVotingPower() {
|
||||
s.Require().Error(baseapp.ValidateVoteExtensions(s.ctx, s.valStore, llc))
|
||||
}
|
||||
|
||||
func (s *ABCIUtilsTestSuite) TestValidateVoteExtensionsIncorrecOrder() {
|
||||
func (s *ABCIUtilsTestSuite) TestValidateVoteExtensionsIncorrectOrder() {
|
||||
ext := []byte("vote-extension")
|
||||
cve := cmtproto.CanonicalVoteExtension{
|
||||
Extension: ext,
|
||||
|
||||
@ -6,9 +6,9 @@ import (
|
||||
"github.com/cometbft/cometbft/abci/types"
|
||||
)
|
||||
|
||||
// ExecuteGenesis implements a genesis TxHandler used to execute a genTxs (from genutil).
|
||||
func (ba *BaseApp) ExecuteGenesisTx(tx []byte) error {
|
||||
res := ba.deliverTx(tx)
|
||||
// ExecuteGenesisTx implements a genesis TxHandler used to execute a genTxs (from genutil).
|
||||
func (app *BaseApp) ExecuteGenesisTx(tx []byte) error {
|
||||
res := app.deliverTx(tx)
|
||||
|
||||
if res.Code != types.CodeTypeOK {
|
||||
return errors.New(res.Log)
|
||||
|
||||
@ -43,9 +43,8 @@ func MakeHybridHandler(cdc codec.BinaryCodec, sd *grpc.ServiceDesc, method grpc.
|
||||
}
|
||||
if isProtov2Handler {
|
||||
return makeProtoV2HybridHandler(methodDesc, cdc, method, handler)
|
||||
} else {
|
||||
return makeGogoHybridHandler(methodDesc, cdc, method, handler)
|
||||
}
|
||||
return makeGogoHybridHandler(methodDesc, cdc, method, handler)
|
||||
}
|
||||
|
||||
// makeProtoV2HybridHandler returns a handler that can handle both gogo and protov2 messages.
|
||||
|
||||
@ -47,7 +47,6 @@ func NewMsgServiceRouter() *MsgServiceRouter {
|
||||
routes: map[string]MsgServiceHandler{},
|
||||
hybridHandlers: map[string]func(ctx context.Context, req, resp protoiface.MessageV1) error{},
|
||||
responseByMsgName: map[string]string{},
|
||||
circuitBreaker: nil,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -9,6 +9,7 @@ import (
|
||||
abci "github.com/cometbft/cometbft/api/cometbft/abci/v1"
|
||||
"github.com/spf13/cast"
|
||||
|
||||
"cosmossdk.io/log"
|
||||
"cosmossdk.io/schema"
|
||||
"cosmossdk.io/schema/appdata"
|
||||
"cosmossdk.io/schema/decoding"
|
||||
@ -36,7 +37,7 @@ func (app *BaseApp) EnableIndexer(indexerOpts interface{}, keys map[string]*stor
|
||||
Config: indexerOpts,
|
||||
Resolver: decoding.ModuleSetDecoderResolver(appModules),
|
||||
SyncSource: nil,
|
||||
Logger: app.logger.With("module", "indexer"),
|
||||
Logger: app.logger.With(log.ModuleKey, "indexer"),
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@ -41,7 +41,7 @@ func (app *BaseApp) SimDeliver(txEncoder sdk.TxEncoder, tx sdk.Tx) (sdk.GasInfo,
|
||||
}
|
||||
|
||||
// SimWriteState is an entrypoint for simulations only. They are not executed during the normal ABCI finalize
|
||||
// block step but later. Therefore an extra call to the root multi-store (app.cms) is required to write the changes.
|
||||
// block step but later. Therefore, an extra call to the root multi-store (app.cms) is required to write the changes.
|
||||
func (app *BaseApp) SimWriteState() {
|
||||
app.finalizeBlockState.ms.Write()
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user