core/state: remove IsConst from StorageItem

This commit is contained in:
Evgeniy Stratonikov 2021-03-05 15:36:32 +03:00
parent df041b8031
commit fd4174ad31
10 changed files with 10 additions and 86 deletions

View file

@ -6,18 +6,15 @@ import (
// StorageItem is the value to be stored with read-only flag.
type StorageItem struct {
Value []byte
IsConst bool
Value []byte
}
// EncodeBinary implements Serializable interface.
func (si *StorageItem) EncodeBinary(w *io.BinWriter) {
w.WriteVarBytes(si.Value)
w.WriteBool(si.IsConst)
}
// DecodeBinary implements Serializable interface.
func (si *StorageItem) DecodeBinary(r *io.BinReader) {
si.Value = r.ReadVarBytes()
si.IsConst = r.ReadBool()
}

View file

@ -8,8 +8,7 @@ import (
func TestEncodeDecodeStorageItem(t *testing.T) {
storageItem := &StorageItem{
Value: []byte{},
IsConst: false,
Value: []byte{1, 2, 3},
}
testserdes.EncodeDecodeBinary(t, storageItem, new(StorageItem))