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

     1  package transaction
     2  
     3  import (
     4  	"github.com/nspcc-dev/neo-go/pkg/io"
     5  )
     6  
     7  // NotaryAssisted represents attribute for notary service transactions.
     8  type NotaryAssisted struct {
     9  	NKeys uint8 `json:"nkeys"`
    10  }
    11  
    12  // DecodeBinary implements the io.Serializable interface.
    13  func (n *NotaryAssisted) DecodeBinary(br *io.BinReader) {
    14  	n.NKeys = br.ReadB()
    15  }
    16  
    17  // EncodeBinary implements the io.Serializable interface.
    18  func (n *NotaryAssisted) EncodeBinary(w *io.BinWriter) {
    19  	w.WriteB(n.NKeys)
    20  }
    21  
    22  func (n *NotaryAssisted) toJSONMap(m map[string]any) {
    23  	m["nkeys"] = n.NKeys
    24  }
    25  
    26  // Copy implements the AttrValue interface.
    27  func (n *NotaryAssisted) Copy() AttrValue {
    28  	return &NotaryAssisted{
    29  		NKeys: n.NKeys,
    30  	}
    31  }