Categorygithub.com/davidkhala/protoutil
modulepackage
0.0.2
Repository: https://github.com/davidkhala/protoutil.git
Documentation: pkg.go.dev

# README

fabric-protoutil

fork of github.com/hyperledger/fabric/protoutil

# Packages

No description provided by the author
Code generated by counterfeiter.
Code generated by counterfeiter.

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ChannelHeader returns the *common.ChannelHeader for a given *common.Envelope.
ChannelID returns the Channel ID for a given *common.Envelope.
CheckTxID checks that txid is equal to the Hash computed over the concatenation of nonce and creator.
No description provided by the author
ComputeTxID computes TxID as the Hash computed over the concatenation of nonce and creator.
ConfigUpdateEnvelopeAsSignedData returns the set of signatures for the ConfigUpdateEnvelope as SignedData or an error indicating why this was not possible.
CopyBlockMetadata copies metadata from one block into another.
CreateChaincodeProposal creates a proposal from given input.
CreateChaincodeProposalWithTransient creates a proposal from given input It returns the proposal and the transaction id associated to the proposal.
CreateChaincodeProposalWithTxIDAndTransient creates a proposal from given input.
CreateChaincodeProposalWithTxIDNonceAndTransient creates a proposal from given input.
CreateDeployProposalFromCDS returns a deploy proposal given a serialized identity and a ChaincodeDeploymentSpec.
CreateGetChaincodesProposal returns a GETCHAINCODES proposal given a serialized identity.
CreateGetInstalledChaincodesProposal returns a GETINSTALLEDCHAINCODES proposal given a serialized identity.
CreateInstallProposalFromCDS returns a install proposal given a serialized identity and a ChaincodeDeploymentSpec.
CreateNonce generates a nonce using the common/crypto package.
CreateNonceOrPanic generates a nonce using the common/crypto package and panics if this operation fails.
CreateProposalFromCIS returns a proposal given a serialized identity and a ChaincodeInvocationSpec.
CreateProposalFromCISAndTxid returns a proposal given a serialized identity and a ChaincodeInvocationSpec.
CreateProposalResponse creates a proposal response.
CreateProposalResponseFailure creates a proposal response for cases where endorsement proposal fails either due to a endorsement failure or a chaincode failure (chaincode response status >= shim.ERRORTHRESHOLD).
CreateSignedEnvelope creates a signed envelope of the desired type, with marshaled dataMsg and signs it.
CreateSignedEnvelopeWithTLSBinding creates a signed envelope of the desired type, with marshaled dataMsg and signs it.
CreateSignedTx assembles an Envelope message from proposal, endorsements, and a signer.
CreateUpgradeProposalFromCDS returns a upgrade proposal given a serialized identity and a ChaincodeDeploymentSpec.
EnvelopeAsSignedData returns the signatures for the Envelope as SignedData slice of length 1 or an error indicating why this was not possible.
EnvelopeToConfigUpdate is used to extract a ConfigUpdateEnvelope from an envelope of type CONFIG_UPDATE.
ExtractEnvelope retrieves the requested envelope from a given block and unmarshals it.
ExtractEnvelopeOrPanic retrieves the requested envelope from a given block and unmarshals it -- it panics if either of these operations fail.
GetActionFromEnvelope extracts a ChaincodeAction message from a serialized Envelope TODO: fix function name as per FAB-11831.
No description provided by the author
GetBytesChaincodeActionPayload get the bytes of ChaincodeActionPayload from the message.
GetBytesChaincodeEvent gets the bytes of ChaincodeEvent.
GetBytesChaincodeProposalPayload gets the chaincode proposal payload.
GetBytesEnvelope get the bytes of Envelope from the message.
GetBytesHeader get the bytes of Header from the message.
GetBytesPayload get the bytes of Payload from the message.
GetBytesProposalPayloadForTx takes a ChaincodeProposalPayload and returns its serialized version according to the visibility field.
GetBytesProposalResponse gets proposal bytes response.
GetBytesProposalResponsePayload gets proposal response payload.
GetBytesResponse gets the bytes of Response.
GetBytesSignatureHeader get the bytes of SignatureHeader from the message.
GetBytesTransaction get the bytes of Transaction from the message.
GetChannelIDFromBlock returns channel ID in the block.
GetChannelIDFromBlockBytes returns channel ID given byte array which represents the block.
GetConsenterMetadataFromBlock attempts to retrieve consenter metadata from the value stored in block metadata at index SIGNATURES (first field).
GetEnvelopeFromBlock gets an envelope from a block's Data field.
GetLastConfigIndexFromBlock retrieves the index of the last config block as encoded in the block metadata.
GetLastConfigIndexFromBlockOrPanic retrieves the index of the last config block as encoded in the block metadata, or panics on error.
GetMetadataFromBlock retrieves metadata at the specified index.
GetMetadataFromBlockOrPanic retrieves metadata at the specified index, or panics on error.
GetOrComputeTxIDFromEnvelope gets the txID present in a given transaction envelope.
GetPayloads gets the underlying payload objects in a TransactionAction.
GetProposalHash1 gets the proposal hash bytes after sanitizing the chaincode proposal payload according to the rules of visibility.
GetProposalHash2 gets the proposal hash - this version is called by the committer where the visibility policy has already been enforced and so we already get what we have to get in ccPropPayl.
GetSignedProposal returns a signed proposal given a Proposal message and a signing identity.
No description provided by the author
InitBlockMetadata initializes metadata structure.
InvokedChaincodeName takes the proposal bytes of a SignedProposal, and unpacks it all the way down, until either an error is encountered, or the chaincode name is found.
IsConfigBlock validates whenever given block contains configuration update transaction.
No description provided by the author
No description provided by the author
LogMessageForSerializedIdentity returns a string with seriealized identity information, or a string indicating why the serialized identity information cannot be returned.
MakeChannelHeader creates a ChannelHeader.
MakePayloadHeader creates a Payload Header.
MakeSignatureHeader creates a SignatureHeader.
Marshal serializes a protobuf message.
MarshalOrPanic serializes a protobuf message and panics if this operation fails.
No description provided by the author
MockSignedEndorserProposalOrPanic creates a SignedProposal with the passed arguments.
NewBlock constructs a block with no data and no metadata.
No description provided by the author
NewSignatureHeader returns a SignatureHeader with a valid nonce.
NewSignatureHeaderOrPanic returns a signature header and panics on error.
SetTxID generates a transaction id based on the provided signature header and sets the TxId field in the channel header.
SignOrPanic signs a message and panics on error.
UnmarshalBlock unmarshal bytes to a Block.
UnmarshalBlockOrPanic unmarshal bytes to an Block or panics on error.
UnmarshalChaincodeAction unmarshal bytes to a ChaincodeAction.
UnmarshalChaincodeActionPayload unmarshal bytes to a ChaincodeActionPayload.
UnmarshalChaincodeDeploymentSpec unmarshal bytes to a ChaincodeDeploymentSpec.
UnmarshalChaincodeEvents unmarshal bytes to a ChaincodeEvent.
UnmarshalChaincodeHeaderExtension unmarshal bytes to a ChaincodeHeaderExtension.
UnmarshalChaincodeID unmarshal bytes to a ChaincodeID.
UnmarshalChaincodeInvocationSpec unmarshal bytes to a ChaincodeInvocationSpec.
UnmarshalChaincodeProposalPayload unmarshal bytes to a ChaincodeProposalPayload.
UnmarshalChannelHeader unmarshal bytes to a ChannelHeader.
UnmarshalChannelHeaderOrPanic unmarshal bytes to a ChannelHeader or panics on error.
UnmarshalConfigEnvelope unmarshal bytes to a ConfigEnvelope.
UnmarshalEnvelope unmarshal bytes to a Envelope.
UnmarshalEnvelopeOfType unmarshal an envelope of the specified type, including unmarshalling the payload data.
UnmarshalEnvelopeOrPanic unmarshal bytes to an Envelope structure or panics on error.
UnmarshalHashedRWSet unmarshal bytes to a HashedRWSet.
UnmarshalHeader unmarshal bytes to a Header.
UnmarshalIdentifierHeader unmarshal bytes to an IdentifierHeader.
UnmarshalKVRWSet unmarshal bytes to a KVRWSet.
UnmarshalPayload unmarshal bytes to a Payload.
UnmarshalPayloadOrPanic unmarshal bytes to a Payload structure or panics on error.
UnmarshalProposal unmarshal bytes to a Proposal.
UnmarshalProposalResponse unmarshal bytes to a ProposalResponse.
UnmarshalProposalResponsePayload unmarshal bytes to a ProposalResponsePayload.
UnmarshalResponse unmarshal bytes to a Response.
No description provided by the author
UnmarshalSignatureHeader unmarshal bytes to a SignatureHeader.
UnmarshalSignatureHeaderOrPanic unmarshal bytes to a SignatureHeader or panics on error.
UnmarshalSignaturePolicy unmarshal bytes to a SignaturePolicyEnvelope.
UnmarshalTransaction unmarshal bytes to a Transaction.
No description provided by the author
UnmarshalTxReadWriteSet unmarshal bytes to a TxReadWriteSet.
No description provided by the author

# Structs

SignedData is used to represent the general triplet required to verify a signature This is intended to be generic across crypto schemes, while most crypto schemes will include the signing identity and a nonce within the Data, this is left to the crypto implementation.

# Interfaces

Signer is the interface needed to sign a transaction.

# Type aliases

No description provided by the author
No description provided by the author