Remove absent validators from sdk.NewContext
This commit is contained in:
+2
-3
@@ -30,8 +30,7 @@ type Context struct {
|
||||
}
|
||||
|
||||
// create a new context
|
||||
func NewContext(ms MultiStore, header abci.Header, isCheckTx bool,
|
||||
txBytes []byte, logger log.Logger, absentValidators [][]byte) Context {
|
||||
func NewContext(ms MultiStore, header abci.Header, isCheckTx bool, txBytes []byte, logger log.Logger) Context {
|
||||
|
||||
c := Context{
|
||||
Context: context.Background(),
|
||||
@@ -45,7 +44,7 @@ func NewContext(ms MultiStore, header abci.Header, isCheckTx bool,
|
||||
c = c.WithIsCheckTx(isCheckTx)
|
||||
c = c.WithTxBytes(txBytes)
|
||||
c = c.WithLogger(logger)
|
||||
c = c.WithAbsentValidators(absentValidators)
|
||||
c = c.WithAbsentValidators(nil)
|
||||
c = c.WithGasMeter(NewInfiniteGasMeter())
|
||||
return c
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ func (l MockLogger) With(kvs ...interface{}) log.Logger {
|
||||
|
||||
func TestContextGetOpShouldNeverPanic(t *testing.T) {
|
||||
var ms types.MultiStore
|
||||
ctx := types.NewContext(ms, abci.Header{}, false, nil, log.NewNopLogger(), nil)
|
||||
ctx := types.NewContext(ms, abci.Header{}, false, nil, log.NewNopLogger())
|
||||
indices := []int64{
|
||||
-10, 1, 0, 10, 20,
|
||||
}
|
||||
@@ -58,7 +58,7 @@ func defaultContext(key types.StoreKey) types.Context {
|
||||
cms := store.NewCommitMultiStore(db)
|
||||
cms.MountStoreWithDB(key, types.StoreTypeIAVL, db)
|
||||
cms.LoadLatestVersion()
|
||||
ctx := types.NewContext(cms, abci.Header{}, false, nil, log.NewNopLogger(), nil)
|
||||
ctx := types.NewContext(cms, abci.Header{}, false, nil, log.NewNopLogger())
|
||||
return ctx
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ func defaultComponents(key sdk.StoreKey) (sdk.Context, *wire.Codec) {
|
||||
cms := store.NewCommitMultiStore(db)
|
||||
cms.MountStoreWithDB(key, sdk.StoreTypeIAVL, db)
|
||||
cms.LoadLatestVersion()
|
||||
ctx := sdk.NewContext(cms, abci.Header{}, false, nil, log.NewNopLogger(), nil)
|
||||
ctx := sdk.NewContext(cms, abci.Header{}, false, nil, log.NewNopLogger())
|
||||
cdc := wire.NewCodec()
|
||||
return ctx, cdc
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user