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

clean GetChaincodeHeaderExtension #341

Merged
merged 1 commit into from
Dec 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions pkg/infra/trafficGenerator/proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,6 @@ func CreateSignedTx(signedproposal *peer.SignedProposal, signer infra.Crypto, re
return nil, errors.Errorf("signer must be the same as the one referenced in the header")
}

// get header extensions so we have the visibility field
_, err = GetChaincodeHeaderExtension(hdr)
if err != nil {
return nil, err
}

endorsements := make([]*peer.Endorsement, 0)

// ensure that all actions are bitwise equal and that they are successful
Expand Down Expand Up @@ -234,17 +228,6 @@ func GetSignatureHeader(bytes []byte) (*common.SignatureHeader, error) {
return UnmarshalSignatureHeader(bytes)
}

func GetChaincodeHeaderExtension(hdr *common.Header) (*peer.ChaincodeHeaderExtension, error) {
chdr, err := UnmarshalChannelHeader(hdr.ChannelHeader)
if err != nil {
return nil, err
}

chaincodeHdrExt := &peer.ChaincodeHeaderExtension{}
err = proto.Unmarshal(chdr.Extension, chaincodeHdrExt)
return chaincodeHdrExt, errors.Wrap(err, "error unmarshaling ChaincodeHeaderExtension")
}

// UnmarshalChannelHeader returns a ChannelHeader from bytes
func UnmarshalChannelHeader(bytes []byte) (*common.ChannelHeader, error) {
chdr := &common.ChannelHeader{}
Expand Down
Loading