github.com/nspcc-dev/neo-go@v0.105.2-0.20240517133400-6be757af3eba/pkg/core/transaction/reserved.go (about)

     1  package transaction
     2  
     3  import (
     4  	"github.com/nspcc-dev/neo-go/pkg/io"
     5  )
     6  
     7  // Reserved represents an attribute for experimental or private usage.
     8  type Reserved struct {
     9  	Value []byte
    10  }
    11  
    12  // DecodeBinary implements the io.Serializable interface.
    13  func (e *Reserved) DecodeBinary(br *io.BinReader) {
    14  	e.Value = br.ReadVarBytes()
    15  }
    16  
    17  // EncodeBinary implements the io.Serializable interface.
    18  func (e *Reserved) EncodeBinary(w *io.BinWriter) {
    19  	w.WriteVarBytes(e.Value)
    20  }
    21  
    22  func (e *Reserved) toJSONMap(m map[string]any) {
    23  	m["value"] = e.Value
    24  }
    25  
    26  // Copy implements the AttrValue interface.
    27  func (e *Reserved) Copy() AttrValue {
    28  	return &Reserved{
    29  		Value: e.Value,
    30  	}
    31  }