utils

package
v1.0.0-alpha5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateChaincodeProposalWithTxIDNonceAndTransient

func CreateChaincodeProposalWithTxIDNonceAndTransient(txid string, typ common.HeaderType, chainID string, cis *peer.ChaincodeInvocationSpec, nonce, creator []byte, transientMap map[string][]byte) (*peer.Proposal, string, error)

CreateChaincodeProposalWithTxIDNonceAndTransient creates a proposal from given input

func ExtractEnvelope

func ExtractEnvelope(block *cb.Block, index int) (*cb.Envelope, error)

ExtractEnvelope retrieves the requested envelope from a given block and unmarshals it

func ExtractEnvelopeOrPanic

func ExtractEnvelopeOrPanic(block *cb.Block, index int) *cb.Envelope

ExtractEnvelopeOrPanic retrieves the requested envelope from a given block and unmarshals it -- it panics if either of these operations fail

func ExtractPayload

func ExtractPayload(envelope *cb.Envelope) (*cb.Payload, error)

ExtractPayload retrieves the payload of a given envelope and unmarshals it.

func ExtractPayloadOrPanic

func ExtractPayloadOrPanic(envelope *cb.Envelope) *cb.Payload

ExtractPayloadOrPanic retrieves the payload of a given envelope and unmarshals it -- it panics if either of these operations fail

func GetBytesChaincodeActionPayload

func GetBytesChaincodeActionPayload(cap *peer.ChaincodeActionPayload) ([]byte, error)

GetBytesChaincodeActionPayload get the bytes of ChaincodeActionPayload from the message

func GetBytesChaincodeEvent

func GetBytesChaincodeEvent(event *peer.ChaincodeEvent) ([]byte, error)

GetBytesChaincodeEvent gets the bytes of ChaincodeEvent

func GetBytesChaincodeProposalPayload

func GetBytesChaincodeProposalPayload(cpp *peer.ChaincodeProposalPayload) ([]byte, error)

GetBytesChaincodeProposalPayload gets the chaincode proposal payload

func GetBytesEnvelope

func GetBytesEnvelope(env *common.Envelope) ([]byte, error)

GetBytesEnvelope get the bytes of Envelope from the message

func GetBytesPayload

func GetBytesPayload(payl *common.Payload) ([]byte, error)

GetBytesPayload get the bytes of Payload from the message

func GetBytesProposal

func GetBytesProposal(prop *peer.Proposal) ([]byte, error)

GetBytesProposal returns the bytes of a proposal message

func GetBytesProposalPayloadForTx

func GetBytesProposalPayloadForTx(payload *peer.ChaincodeProposalPayload, visibility []byte) ([]byte, error)

GetBytesProposalPayloadForTx takes a ChaincodeProposalPayload and returns its serialized version according to the visibility field

func GetBytesProposalResponsePayload

func GetBytesProposalResponsePayload(hash []byte, response *peer.Response, result []byte, event []byte, ccid *peer.ChaincodeID) ([]byte, error)

GetBytesProposalResponsePayload gets proposal response payload

func GetBytesTransaction

func GetBytesTransaction(tx *peer.Transaction) ([]byte, error)

GetBytesTransaction get the bytes of Transaction from the message

func GetChaincodeAction

func GetChaincodeAction(caBytes []byte) (*peer.ChaincodeAction, error)

GetChaincodeAction gets the ChaincodeAction given chaicnode action bytes

func GetChaincodeActionPayload

func GetChaincodeActionPayload(capBytes []byte) (*peer.ChaincodeActionPayload, error)

GetChaincodeActionPayload Get ChaincodeActionPayload from bytes

func GetChaincodeEvents

func GetChaincodeEvents(eBytes []byte) (*peer.ChaincodeEvent, error)

GetChaincodeEvents gets the ChaincodeEvents given chaincode event bytes

func GetChaincodeHeaderExtension

func GetChaincodeHeaderExtension(hdr *common.Header) (*peer.ChaincodeHeaderExtension, error)

GetChaincodeHeaderExtension get chaincode header extension given header

func GetChaincodeProposalPayload

func GetChaincodeProposalPayload(bytes []byte) (*peer.ChaincodeProposalPayload, error)

GetChaincodeProposalPayload Get ChaincodeProposalPayload from bytes

func GetEnvelopeFromBlock

func GetEnvelopeFromBlock(data []byte) (*common.Envelope, error)

GetEnvelopeFromBlock gets an envelope from a block's Data field.

func GetHeader

func GetHeader(bytes []byte) (*common.Header, error)

GetHeader Get Header from bytes

func GetPayload

func GetPayload(e *common.Envelope) (*common.Payload, error)

GetPayload Get Payload from Envelope message

func GetPayloads

GetPayloads gets the underlying payload objects in a TransactionAction

func GetProposalResponsePayload

func GetProposalResponsePayload(prpBytes []byte) (*peer.ProposalResponsePayload, error)

GetProposalResponsePayload gets the proposal response payload

func GetSignatureHeader

func GetSignatureHeader(bytes []byte) (*common.SignatureHeader, error)

GetSignatureHeader Get SignatureHeader from bytes

func GetTransaction

func GetTransaction(txBytes []byte) (*peer.Transaction, error)

GetTransaction Get Transaction from bytes

func MakeChannelHeader

func MakeChannelHeader(headerType cb.HeaderType, version int32, chainID string, epoch uint64) *cb.ChannelHeader

MakeChannelHeader creates a ChannelHeader.

func MakePayloadHeader

func MakePayloadHeader(ch *cb.ChannelHeader, sh *cb.SignatureHeader) *cb.Header

MakePayloadHeader creates a Payload Header.

func Marshal

func Marshal(pb proto.Message) ([]byte, error)

Marshal serializes a protobuf message.

func MarshalOrPanic

func MarshalOrPanic(pb proto.Message) []byte

MarshalOrPanic serializes a protobuf message and panics if this operation fails

func UnmarshalChannelHeader

func UnmarshalChannelHeader(bytes []byte) (*cb.ChannelHeader, error)

UnmarshalChannelHeader returns a ChannelHeader from bytes

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL