remove hack db key

This commit is contained in:
William Banfield
2022-05-20 17:50:50 -04:00
parent fe3340db4a
commit e69047305a

View File

@@ -2,7 +2,6 @@ package state
import (
"bytes"
"encoding/binary"
"errors"
"fmt"
@@ -60,7 +59,6 @@ func abciResponsesKey(height int64) []byte {
// stateKey should never change after being set in init()
var stateKey []byte
var tmpABCIKey []byte
func init() {
var err error
@@ -68,12 +66,6 @@ func init() {
if err != nil {
panic(err)
}
// temporary extra key before consensus param protos are regenerated
// TODO(wbanfield) remove in next PR
tmpABCIKey, err = orderedcode.Append(nil, int64(10000))
if err != nil {
panic(err)
}
}
//----------------------
@@ -145,13 +137,6 @@ func (store dbStore) loadState(key []byte) (state State, err error) {
if err != nil {
return state, err
}
buf, err = store.db.Get(tmpABCIKey)
if err != nil {
return state, err
}
h, _ := binary.Varint(buf)
sm.ConsensusParams.ABCI.VoteExtensionsEnableHeight = h
return *sm, nil
}
@@ -195,11 +180,6 @@ func (store dbStore) save(state State, key []byte) error {
if err := batch.Set(key, stateBz); err != nil {
return err
}
bz := make([]byte, 5)
binary.PutVarint(bz, state.ConsensusParams.ABCI.VoteExtensionsEnableHeight)
if err := batch.Set(tmpABCIKey, bz); err != nil {
return err
}
return batch.WriteSync()
}