github.com/nspcc-dev/neo-go@v0.105.2-0.20240517133400-6be757af3eba/pkg/core/transaction/not_valid_before.go (about) 1 package transaction 2 3 import ( 4 "github.com/nspcc-dev/neo-go/pkg/io" 5 ) 6 7 // NotValidBefore represents attribute with the height transaction is not valid before. 8 type NotValidBefore struct { 9 Height uint32 `json:"height"` 10 } 11 12 // DecodeBinary implements the io.Serializable interface. 13 func (n *NotValidBefore) DecodeBinary(br *io.BinReader) { 14 n.Height = br.ReadU32LE() 15 } 16 17 // EncodeBinary implements the io.Serializable interface. 18 func (n *NotValidBefore) EncodeBinary(w *io.BinWriter) { 19 w.WriteU32LE(n.Height) 20 } 21 22 func (n *NotValidBefore) toJSONMap(m map[string]any) { 23 m["height"] = n.Height 24 } 25 26 // Copy implements the AttrValue interface. 27 func (n *NotValidBefore) Copy() AttrValue { 28 return &NotValidBefore{ 29 Height: n.Height, 30 } 31 }