Skip to content
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

Extended session #447

Merged
merged 2 commits into from
Jun 13, 2023
Merged

Extended session #447

merged 2 commits into from
Jun 13, 2023

Conversation

smallhive
Copy link
Contributor

No description provided.

@smallhive smallhive marked this pull request as ready for review June 9, 2023 10:49
Copy link
Member

@roman-khimov roman-khimov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't lose coverage at the same time, so some tests are needed as well.

session/common.go Outdated Show resolved Hide resolved
session/common.go Outdated Show resolved Hide resolved
@@ -166,6 +166,11 @@ func (x *Object) Sign(signer neofscrypto.Signer) error {
return x.sign(signer, x.writeContext)
}

// SignedData returnes actual payload which would be signed, if you call [Object.Sign] method.
func (x *Object) SignedData() []byte {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i can offer a pretty indicative scenario for unit test:

  1. fill token
  2. call SignedData
  3. calculate signature manually
  4. call Sign with static signer
  5. assert Verify passes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -166,6 +166,11 @@ func (x *Object) Sign(signer neofscrypto.Signer) error {
return x.sign(signer, x.writeContext)
}

// SignedData returnes actual payload which would be signed, if you call [Object.Sign] method.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// SignedData returnes actual payload which would be signed, if you call [Object.Sign] method.
// SignedData returns actual payload which would be signed, if you call [Object.Sign] method.

i'd also paraphrase comment to make it closer to Sign and add cross-reference b/w them: this can make it easier to understand the relationship and differences between the methods

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, hand trembled

Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
session/common.go Outdated Show resolved Hide resolved
@smallhive smallhive force-pushed the extended-session branch 2 times, most recently from 86112bb to 88f556b Compare June 13, 2023 04:20
session/common.go Outdated Show resolved Hide resolved
Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
@roman-khimov roman-khimov merged commit f34116b into master Jun 13, 2023
@roman-khimov roman-khimov deleted the extended-session branch June 13, 2023 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants