mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-26 19:42:23 +00:00
35 lines
862 B
Go
35 lines
862 B
Go
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
|
|
}
|