utils

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 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.PtnHeaderType, chainID string, cis *peer.PtnChaincodeInvocationSpec, creator []byte) (*peer.PtnProposal, 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.PtnHeaderType, chainID string, cis *peer.PtnChaincodeInvocationSpec, creator []byte, transientMap map[string][]byte) (*peer.PtnProposal, 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.PtnHeaderType, chainID string, cis *peer.PtnChaincodeInvocationSpec, nonce, creator []byte, transientMap map[string][]byte) (*peer.PtnProposal, string, error)

CreateChaincodeProposalWithTxIDNonceAndTransient creates a proposal from given input

func CreateProposalFromCISAndTxid

func CreateProposalFromCISAndTxid(txid string, typ common.PtnHeaderType, chainID string, cis *peer.PtnChaincodeInvocationSpec, creator []byte) (*peer.PtnProposal, string, error)

CreateProposalFromCIS returns a proposal given a serialized identity and a ChaincodeInvocationSpec

func GetBytesChaincodeEvent

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

GetBytesChaincodeEvent gets the bytes of ChaincodeEvent

func GetBytesChaincodeProposalPayload

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

GetBytesChaincodeProposalPayload gets the chaincode proposal payload

func GetBytesHeader

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

GetBytesHeader get the bytes of Header from the message

func GetBytesProposal

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

GetBytesProposal returns the bytes of a proposal message

func GetBytesProposalResponse

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

GetBytesProposalResponse gets proposal bytes response

func GetBytesProposalResponsePayload

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

GetBytesProposalResponsePayload gets proposal response payload

func GetBytesResponse

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

GetBytesResponse gets the bytes of Response

func GetBytesSignatureHeader

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

GetBytesSignatureHeader get the bytes of SignatureHeader from the message

func GetChaincodeAction

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

GetChaincodeAction gets the ChaincodeAction given chaicnode action bytes

func GetChaincodeDeploymentSpec

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

GetChaincodeDeploymentSpec returns a ChaincodeDeploymentSpec given args

func GetChaincodeEvents

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

GetChaincodeEvents gets the ChaincodeEvents given chaincode event bytes

func GetChaincodeHeaderExtension

func GetChaincodeHeaderExtension(hdr *common.PtnHeader) (*peer.PtnChaincodeHeaderExtension, error)

GetChaincodeHeaderExtension get chaincode header extension given header

func GetChaincodeInvocationSpec

func GetChaincodeInvocationSpec(prop *peer.PtnProposal) (*peer.PtnChaincodeInvocationSpec, error)

GetChaincodeInvocationSpec get the ChaincodeInvocationSpec from the proposal

func GetChaincodeProposalContext

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

GetChaincodeProposalContext returns creator and transient

func GetChaincodeProposalPayload

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

GetChaincodeProposalPayload Get ChaincodeProposalPayload from bytes

func GetHeader

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

GetHeader Get Header from bytes

func GetNonce

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

GetNonce returns the nonce used in Proposal

func GetPayload

func GetPayload(e *common.PtnEnvelope) (*common.PtnPayload, error)

GetPayload Get Payload from Envelope message

func GetProposal

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

GetProposal returns a Proposal message from its bytes

func GetProposalResponse

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

GetProposalResponse given proposal in bytes

func GetProposalResponsePayload

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

GetProposalResponsePayload gets the proposal response payload

func GetResponse

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

GetResponse gets the Response given response bytes

func GetSignatureHeader

func GetSignatureHeader(bytes []byte) (*common.PtnSignatureHeader, 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.PtnChannelHeader, 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