Remove absent validators from sdk.NewContext

This commit is contained in:
Christopher Goes
2018-05-29 02:26:17 +02:00
parent f4f8cc66d9
commit aed5d94b1c
16 changed files with 30 additions and 31 deletions
+2 -3
View File
@@ -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
}
+2 -2
View File
@@ -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
}
+1 -1
View File
@@ -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
}