core: adjust types of NVB, Conflicts and NotaryAssisted attributes

This commit is contained in:
Anna Shaleva 2022-05-24 13:30:41 +03:00
parent c4f3a92485
commit 1b80215415
2 changed files with 9 additions and 9 deletions

View file

@ -15,10 +15,10 @@ const (
// List of valid attribute types. // List of valid attribute types.
const ( const (
HighPriority AttrType = 1 HighPriority AttrType = 1
OracleResponseT AttrType = 0x11 // OracleResponse OracleResponseT AttrType = 0x11 // OracleResponse
NotValidBeforeT AttrType = ReservedLowerBound // NotValidBefore NotValidBeforeT AttrType = 0x20 // NotValidBefore
ConflictsT AttrType = ReservedLowerBound + 1 // Conflicts ConflictsT AttrType = 0x21 // Conflicts
NotaryAssistedT AttrType = ReservedLowerBound + 2 // NotaryAssisted NotaryAssistedT AttrType = 0x22 // NotaryAssisted
) )
func (a AttrType) allowMultiple() bool { func (a AttrType) allowMultiple() bool {

View file

@ -10,9 +10,9 @@ func _() {
var x [1]struct{} var x [1]struct{}
_ = x[HighPriority-1] _ = x[HighPriority-1]
_ = x[OracleResponseT-17] _ = x[OracleResponseT-17]
_ = x[NotValidBeforeT-224] _ = x[NotValidBeforeT-32]
_ = x[ConflictsT-225] _ = x[ConflictsT-33]
_ = x[NotaryAssistedT-226] _ = x[NotaryAssistedT-34]
} }
const ( const (
@ -31,8 +31,8 @@ func (i AttrType) String() string {
return _AttrType_name_0 return _AttrType_name_0
case i == 17: case i == 17:
return _AttrType_name_1 return _AttrType_name_1
case 224 <= i && i <= 226: case 32 <= i && i <= 34:
i -= 224 i -= 32
return _AttrType_name_2[_AttrType_index_2[i]:_AttrType_index_2[i+1]] return _AttrType_name_2[_AttrType_index_2[i]:_AttrType_index_2[i+1]]
default: default:
return "AttrType(" + strconv.FormatInt(int64(i), 10) + ")" return "AttrType(" + strconv.FormatInt(int64(i), 10) + ")"