-
Notifications
You must be signed in to change notification settings - Fork 34
IDEN-298 add subject position to claim #425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IDEN-298 add subject position to claim #425
Conversation
claim.go
Outdated
@@ -324,6 +335,18 @@ func (c *Claim) GetSchemaHash() SchemaHash { | |||
return schemaHash | |||
} | |||
|
|||
// GetSubjectPosition return a position where the subject is stored. | |||
func (c *Claim) GetSubjectPosition() (SubjectPosition, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need SubjectPosition
type if we already have Subject
?
I would propose just rename getSubject
to GetSubject
and that's it. Subject already a public type and all values of it are public too. I think we do not need another type. Return one of Subject
constants would be fine.
claim.go
Outdated
case SubjectOtherIdenValue: | ||
return SubjectPositionValue, nil | ||
default: | ||
return "", errors.New("claim without ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you won't agree with my previous comment, then it looks like this error needs more text.
claim.go
Outdated
subjectSelfFlag subjectFlag = iota // 000 | ||
subjectInvalidFlag // 001 | ||
subjectOtherIdenIndexFlag // 010 | ||
subjectOtherIdenValueFlag // 011 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rename these constants like subjectFlagOtherIdenValue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
No description provided.