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

DRY up pkg/config envelope creation #1098

Merged
merged 1 commit into from
Apr 16, 2020
Merged

Conversation

wlahti
Copy link
Contributor

@wlahti wlahti commented Apr 15, 2020

Type of change

  • Improvement (improvement to code, performance, etc)

Description

Reuse newEnvelope() when creating a signed envelope.

Related issues

FAB-17741

@wlahti wlahti requested a review from a team as a code owner April 15, 2020 17:04
@wlahti
Copy link
Contributor Author

wlahti commented Apr 15, 2020

/ci-run

@github-actions
Copy link

AZP build triggered!

// cb.ConfigGroupEnvelope proto message.
// newEnvelope creates an unsigned envelope of the desired type containing
// a payload Header and the marshaled proto message as the payload Data.
// message
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you forget to delete this line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yep, didn't even notice it for a while after reading your comment. :) Removed.

@wlahti
Copy link
Contributor Author

wlahti commented Apr 16, 2020

/ci-run

@github-actions
Copy link

AZP build triggered!

FAB-17741

Signed-off-by: Will Lahti <wtlahti@us.ibm.com>

signatureHeader, err := s.signatureHeader()
// newSignedEnvelope creates a signed envelope of the desired type and signs it.
func (s *SigningIdentity) newSignedEnvelope(txType cb.HeaderType, channelID string, dataMsg proto.Message) (*cb.Envelope, error) {
Copy link

Choose a reason for hiding this comment

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

could maybe even call this just signedEnvelope and just drop the new since that seems to be the pattern we're moving towards

Copy link

Choose a reason for hiding this comment

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

I'm indifferent either way. I'll let you decide which you prefer, let me know if you want to merge as is or if you want to change it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I say we keep it as-is for now. We can do another pass to make sure we're consistent in our naming of functions after the current set of tasks are merged in.

@caod123 caod123 merged commit b86eadb into hyperledger:master Apr 16, 2020
@wlahti wlahti deleted the fab-17741 branch September 25, 2020 15:46
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