neoneo-go/pkg/core/transaction/state.go
Anthony De Meulemeester 52fa41a12a
Persist transactions (#51)
* added account_state + changed ECPoint to PublicKey

* account state persist

* in depth test for existing accounts.

* implemented GetTransaction.

* added enrollment TX

* added persist of accounts and unspent coins

* bumped version -> 0.32.0
2018-03-21 17:11:04 +01:00

29 lines
607 B
Go

package transaction
import (
"io"
"github.com/CityOfZion/neo-go/pkg/util"
)
// StateTX represents a state transaction.
type StateTX struct {
Descriptors []*StateDescriptor
}
// DecodeBinary implements the Payload interface.
func (tx *StateTX) DecodeBinary(r io.Reader) error {
lenDesc := util.ReadVarUint(r)
for i := 0; i < int(lenDesc); i++ {
tx.Descriptors[i] = &StateDescriptor{}
if err := tx.Descriptors[i].DecodeBinary(r); err != nil {
return err
}
}
return nil
}
// EncodeBinary implements the Payload interface.
func (tx *StateTX) EncodeBinary(w io.Writer) error {
return nil
}