utils

package
v1.0.5-hotfix1 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2020 License: GPL-3.0, GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeProposalTxID

func ComputeProposalTxID(nonce, creator []byte) (string, error)

ComputeProposalTxID computes TxID as the Hash computed over the concatenation of nonce and creator.

func CreateChaincodeProposal

func CreateChaincodeProposal(typ common.HeaderType, chainID string, cis *peer.ChaincodeInvocationSpec, creator []byte) (*peer.Proposal, string, error)

CreateChaincodeProposal creates a proposal from given input. It returns the proposal and the transaction id associated to the proposal

func CreateChaincodeProposalWithTransient

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

CreateChaincodeProposalWithTransient creates a proposal from given input It returns the proposal and the transaction id associated to the proposal

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 CreateProposalFromCISAndTxid

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

CreateProposalFromCIS returns a proposal given a serialized identity and a ChaincodeInvocationSpec

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 GetBytesHeader

func GetBytesHeader(hdr *common.Header) ([]byte, error)

GetBytesHeader get the bytes of Header from the message

func GetBytesProposal

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

GetBytesProposal returns the bytes of a proposal message

func GetBytesProposalResponse

func GetBytesProposalResponse(pr *peer.ProposalResponse) ([]byte, error)

GetBytesProposalResponse gets proposal bytes response

func GetBytesProposalResponsePayload

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

GetBytesProposalResponsePayload gets proposal response payload

func GetBytesResponse

func GetBytesResponse(res *peer.Response) ([]byte, error)

GetBytesResponse gets the bytes of Response

func GetBytesSignatureHeader

func GetBytesSignatureHeader(hdr *common.SignatureHeader) ([]byte, error)

GetBytesSignatureHeader get the bytes of SignatureHeader from the message

func GetChaincodeAction

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

GetChaincodeAction gets the ChaincodeAction given chaicnode action bytes

func GetChaincodeDeploymentSpec

func GetChaincodeDeploymentSpec(code []byte) (*peer.ChaincodeDeploymentSpec, error)

GetChaincodeDeploymentSpec returns a ChaincodeDeploymentSpec given args

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 GetChaincodeInvocationSpec

func GetChaincodeInvocationSpec(prop *peer.Proposal) (*peer.ChaincodeInvocationSpec, error)

GetChaincodeInvocationSpec get the ChaincodeInvocationSpec from the proposal

func GetChaincodeProposalContext

func GetChaincodeProposalContext(prop *peer.Proposal) ([]byte, map[string][]byte, error)

GetChaincodeProposalContext returns creator and transient

func GetChaincodeProposalPayload

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

GetChaincodeProposalPayload Get ChaincodeProposalPayload from bytes

func GetHeader

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

GetHeader Get Header from bytes

func GetNonce

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

GetNonce returns the nonce used in Proposal

func GetPayload

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

GetPayload Get Payload from Envelope message

func GetProposal

func GetProposal(propBytes []byte) (*peer.Proposal, error)

GetProposal returns a Proposal message from its bytes

func GetProposalResponse

func GetProposalResponse(prBytes []byte) (*peer.ProposalResponse, error)

GetProposalResponse given proposal in bytes

func GetProposalResponsePayload

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

GetProposalResponsePayload gets the proposal response payload

func GetResponse

func GetResponse(resBytes []byte) (*peer.Response, error)

GetResponse gets the Response given response bytes

func GetSignatureHeader

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

GetSignatureHeader Get SignatureHeader from bytes

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