core/state: remove IsConst
from StorageItem
This commit is contained in:
parent
df041b8031
commit
fd4174ad31
10 changed files with 10 additions and 86 deletions
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue