Merge PR #1115: Update SDK to ABCI v11
This commit is contained in:
+6
-6
@@ -44,7 +44,7 @@ func NewContext(ms MultiStore, header abci.Header, isCheckTx bool, txBytes []byt
|
||||
c = c.WithIsCheckTx(isCheckTx)
|
||||
c = c.WithTxBytes(txBytes)
|
||||
c = c.WithLogger(logger)
|
||||
c = c.WithAbsentValidators(nil)
|
||||
c = c.WithSigningValidators(nil)
|
||||
c = c.WithGasMeter(NewInfiniteGasMeter())
|
||||
return c
|
||||
}
|
||||
@@ -130,7 +130,7 @@ const (
|
||||
contextKeyIsCheckTx
|
||||
contextKeyTxBytes
|
||||
contextKeyLogger
|
||||
contextKeyAbsentValidators
|
||||
contextKeySigningValidators
|
||||
contextKeyGasMeter
|
||||
)
|
||||
|
||||
@@ -160,8 +160,8 @@ func (c Context) TxBytes() []byte {
|
||||
func (c Context) Logger() log.Logger {
|
||||
return c.Value(contextKeyLogger).(log.Logger)
|
||||
}
|
||||
func (c Context) AbsentValidators() [][]byte {
|
||||
return c.Value(contextKeyAbsentValidators).([][]byte)
|
||||
func (c Context) SigningValidators() []abci.SigningValidator {
|
||||
return c.Value(contextKeySigningValidators).([]abci.SigningValidator)
|
||||
}
|
||||
func (c Context) GasMeter() GasMeter {
|
||||
return c.Value(contextKeyGasMeter).(GasMeter)
|
||||
@@ -188,8 +188,8 @@ func (c Context) WithTxBytes(txBytes []byte) Context {
|
||||
func (c Context) WithLogger(logger log.Logger) Context {
|
||||
return c.withValue(contextKeyLogger, logger)
|
||||
}
|
||||
func (c Context) WithAbsentValidators(AbsentValidators [][]byte) Context {
|
||||
return c.withValue(contextKeyAbsentValidators, AbsentValidators)
|
||||
func (c Context) WithSigningValidators(SigningValidators []abci.SigningValidator) Context {
|
||||
return c.withValue(contextKeySigningValidators, SigningValidators)
|
||||
}
|
||||
func (c Context) WithGasMeter(meter GasMeter) Context {
|
||||
return c.withValue(contextKeyGasMeter, meter)
|
||||
|
||||
+2
-1
@@ -3,6 +3,7 @@ package types
|
||||
import (
|
||||
abci "github.com/tendermint/abci/types"
|
||||
"github.com/tendermint/go-crypto"
|
||||
tmtypes "github.com/tendermint/tendermint/types"
|
||||
)
|
||||
|
||||
// status of a validator
|
||||
@@ -41,7 +42,7 @@ type Validator interface {
|
||||
// validator which fulfills abci validator interface for use in Tendermint
|
||||
func ABCIValidator(v Validator) abci.Validator {
|
||||
return abci.Validator{
|
||||
PubKey: v.GetPubKey().Bytes(),
|
||||
PubKey: tmtypes.TM2PB.PubKey(v.GetPubKey()),
|
||||
Power: v.GetPower().Evaluate(),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user