2020-08-11 17:58:56 +00:00
|
|
|
package transaction
|
|
|
|
|
2020-09-16 11:50:31 +00:00
|
|
|
//go:generate stringer -type=AttrType -linecomment
|
2020-08-11 17:58:56 +00:00
|
|
|
|
|
|
|
// AttrType represents the purpose of the attribute.
|
|
|
|
type AttrType uint8
|
|
|
|
|
2020-10-15 10:06:22 +00:00
|
|
|
const (
|
2021-05-12 20:17:03 +00:00
|
|
|
// ReservedLowerBound is the lower bound of reserved attribute types.
|
2020-10-15 10:06:22 +00:00
|
|
|
ReservedLowerBound = 0xe0
|
2021-05-12 20:17:03 +00:00
|
|
|
// ReservedUpperBound is the upper bound of reserved attribute types.
|
2020-10-15 10:06:22 +00:00
|
|
|
ReservedUpperBound = 0xff
|
|
|
|
)
|
|
|
|
|
2020-08-19 13:20:48 +00:00
|
|
|
// List of valid attribute types.
|
|
|
|
const (
|
2020-09-16 11:50:31 +00:00
|
|
|
HighPriority AttrType = 1
|
2022-05-24 10:30:41 +00:00
|
|
|
OracleResponseT AttrType = 0x11 // OracleResponse
|
|
|
|
NotValidBeforeT AttrType = 0x20 // NotValidBefore
|
|
|
|
ConflictsT AttrType = 0x21 // Conflicts
|
|
|
|
NotaryAssistedT AttrType = 0x22 // NotaryAssisted
|
2020-08-19 13:20:48 +00:00
|
|
|
)
|
2020-09-16 11:50:31 +00:00
|
|
|
|
|
|
|
func (a AttrType) allowMultiple() bool {
|
2020-10-15 11:45:29 +00:00
|
|
|
switch a {
|
|
|
|
case ConflictsT:
|
|
|
|
return true
|
|
|
|
default:
|
|
|
|
return false
|
|
|
|
}
|
2020-09-16 11:50:31 +00:00
|
|
|
}
|