ad9091d13d
It is done through reflection and panics in every unexpected situation.
20 lines
481 B
Go
20 lines
481 B
Go
package transaction
|
|
|
|
import (
|
|
"github.com/CityOfZion/neo-go/pkg/io"
|
|
)
|
|
|
|
// StateTX represents a state transaction.
|
|
type StateTX struct {
|
|
Descriptors []*StateDescriptor
|
|
}
|
|
|
|
// DecodeBinary implements Serializable interface.
|
|
func (tx *StateTX) DecodeBinary(r *io.BinReader) {
|
|
tx.Descriptors = r.ReadArray(StateDescriptor{}).([]*StateDescriptor)
|
|
}
|
|
|
|
// EncodeBinary implements Serializable interface.
|
|
func (tx *StateTX) EncodeBinary(w *io.BinWriter) {
|
|
w.WriteArray(tx.Descriptors)
|
|
}
|