core: move transaction Attribute value to a designated interface

Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
This commit is contained in:
Ekaterina Pavlova 2024-04-26 21:35:57 +05:30
parent 198af7f3ae
commit df2a56908b

View file

@ -8,10 +8,8 @@ import (
"github.com/nspcc-dev/neo-go/pkg/io"
)
// Attribute represents a Transaction attribute.
type Attribute struct {
Type AttrType
Value interface {
// AttrValue represents a Transaction Attribute value.
type AttrValue interface {
io.Serializable
// toJSONMap is used for embedded json struct marshalling.
// Anonymous interface fields are not considered anonymous by
@ -19,6 +17,11 @@ type Attribute struct {
// harder to follow.
toJSONMap(map[string]any)
}
// Attribute represents a Transaction attribute.
type Attribute struct {
Type AttrType
Value AttrValue
}
// attrJSON is used for JSON I/O of Attribute.