mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-25 13:47:19 +00:00
956fd08adb
Add a method that makes a deep copy of all fields and resets size/hash caches. Close #3288 Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
32 lines
708 B
Go
32 lines
708 B
Go
package transaction
|
|
|
|
import (
|
|
"github.com/nspcc-dev/neo-go/pkg/io"
|
|
"github.com/nspcc-dev/neo-go/pkg/util"
|
|
)
|
|
|
|
// Conflicts represents attribute for conflicting transactions.
|
|
type Conflicts struct {
|
|
Hash util.Uint256 `json:"hash"`
|
|
}
|
|
|
|
// DecodeBinary implements the io.Serializable interface.
|
|
func (c *Conflicts) DecodeBinary(br *io.BinReader) {
|
|
c.Hash.DecodeBinary(br)
|
|
}
|
|
|
|
// EncodeBinary implements the io.Serializable interface.
|
|
func (c *Conflicts) EncodeBinary(w *io.BinWriter) {
|
|
c.Hash.EncodeBinary(w)
|
|
}
|
|
|
|
func (c *Conflicts) toJSONMap(m map[string]any) {
|
|
m["hash"] = c.Hash
|
|
}
|
|
|
|
// Copy implements the AttrValue interface.
|
|
func (c *Conflicts) Copy() AttrValue {
|
|
return &Conflicts{
|
|
Hash: c.Hash,
|
|
}
|
|
}
|