Skip to content

Commit

Permalink
clean GetChaincodeHeaderExtension (#341)
Browse files Browse the repository at this point in the history
called but not evaluated function

Signed-off-by: david <[email protected]>
  • Loading branch information
davidkhala authored Dec 24, 2023
1 parent 8cc2ae6 commit e122cb7
Showing 1 changed file with 0 additions and 17 deletions.
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

0 comments on commit e122cb7

Please sign in to comment.