2018-03-04 13:56:49 +00:00
|
|
|
package transaction
|
|
|
|
|
2018-03-09 15:55:25 +00:00
|
|
|
// TXType is the type of a transaction.
|
|
|
|
type TXType uint8
|
2018-03-04 13:56:49 +00:00
|
|
|
|
|
|
|
// All processes in NEO system are recorded in transactions.
|
2018-03-17 11:53:21 +00:00
|
|
|
// Valid transaction types.
|
2018-03-04 13:56:49 +00:00
|
|
|
const (
|
2018-03-09 15:55:25 +00:00
|
|
|
MinerType TXType = 0x00
|
|
|
|
IssueType TXType = 0x01
|
|
|
|
ClaimType TXType = 0x02
|
|
|
|
EnrollmentType TXType = 0x20
|
|
|
|
VotingType TXType = 0x24
|
|
|
|
RegisterType TXType = 0x40
|
|
|
|
ContractType TXType = 0x80
|
|
|
|
StateType TXType = 0x90
|
|
|
|
AgencyType TXType = 0xb0
|
|
|
|
PublishType TXType = 0xd0
|
|
|
|
InvocationType TXType = 0xd1
|
2018-03-04 13:56:49 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// String implements the stringer interface.
|
2018-03-09 15:55:25 +00:00
|
|
|
func (t TXType) String() string {
|
2018-03-04 13:56:49 +00:00
|
|
|
switch t {
|
|
|
|
case MinerType:
|
2018-03-17 11:53:21 +00:00
|
|
|
return "MinerTransaction"
|
2018-03-04 13:56:49 +00:00
|
|
|
case IssueType:
|
2018-03-17 11:53:21 +00:00
|
|
|
return "IssueTransaction"
|
2018-03-04 13:56:49 +00:00
|
|
|
case ClaimType:
|
2018-03-17 11:53:21 +00:00
|
|
|
return "ClaimTransaction"
|
2018-03-04 13:56:49 +00:00
|
|
|
case EnrollmentType:
|
2018-03-17 11:53:21 +00:00
|
|
|
return "EnrollmentTransaction"
|
2018-03-04 13:56:49 +00:00
|
|
|
case VotingType:
|
2018-03-17 11:53:21 +00:00
|
|
|
return "VotingTransaction"
|
2018-03-04 13:56:49 +00:00
|
|
|
case RegisterType:
|
2018-03-17 11:53:21 +00:00
|
|
|
return "RegisterTransaction"
|
2018-03-04 13:56:49 +00:00
|
|
|
case ContractType:
|
2018-03-17 11:53:21 +00:00
|
|
|
return "ContractTransaction"
|
2018-03-04 13:56:49 +00:00
|
|
|
case StateType:
|
2018-03-17 11:53:21 +00:00
|
|
|
return "StateTransaction"
|
2018-03-04 13:56:49 +00:00
|
|
|
case AgencyType:
|
2018-03-17 11:53:21 +00:00
|
|
|
return "AgencyTransaction"
|
2018-03-04 13:56:49 +00:00
|
|
|
case PublishType:
|
2018-03-17 11:53:21 +00:00
|
|
|
return "PublishTransaction"
|
2018-03-04 13:56:49 +00:00
|
|
|
case InvocationType:
|
2018-03-17 11:53:21 +00:00
|
|
|
return "InvocationTransaction"
|
2018-03-04 13:56:49 +00:00
|
|
|
default:
|
2018-03-17 11:53:21 +00:00
|
|
|
return "UnkownTransaction"
|
2018-03-04 13:56:49 +00:00
|
|
|
}
|
|
|
|
}
|