neoneo-go/pkg/core/transaction.go

36 lines
862 B
Go
Raw Normal View History

2018-01-30 10:56:36 +00:00
package core
import (
"encoding/binary"
"io"
)
// Transaction is a process recorded in the NEO system.
type Transaction struct {
Type TransactionType
}
// All processes in NEO system are recorded in transactions.
// There are several types of transactions.
const (
MinerTX TransactionType = 0x00
IssueTX = 0x01
ClaimTX = 0x02
EnrollmentTX = 0x20
VotingTX = 0x24
RegisterTX = 0x40
ContractTX = 0x80
AgencyTX = 0xb0
)
// DecodeBinary implements the payload interface.
func (t Transaction) DecodeBinary(r io.Reader) error {
err := binary.Read(r, binary.LittleEndian, &t.Type)
return err
}
// EncodeBinary implements the payload interface.
func (t Transaction) EncodeBinary(w io.Writer) error {
return nil
}