serialization

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateEnvelope

func CreateEnvelope(
	channelID string,
	signer protoutil.Signer,
	protoMsg proto.Message,
) (*common.Envelope, string, error)

CreateEnvelope create an envelope with or without a signature and the corresponding header. An unsigned envelope can only be used with a patched fabric orderer. It's output envelope is different from protoutil.CreateSignedEnvelope:

  • This method adds TxId to the channel's header
  • This method's payload is the given message and not common.Payload

func ParseEnvelope

func ParseEnvelope(envelope *common.Envelope) (*common.Payload, *common.ChannelHeader, error)

ParseEnvelope parse the envelope content.

func UnmarshalTx

func UnmarshalTx(data []byte) (*protoblocktx.Tx, error)

UnmarshalTx unmarshals data bytes to protoblocktx.Tx.

func UnwrapEnvelope

func UnwrapEnvelope(message []byte) ([]byte, *common.ChannelHeader, error)

UnwrapEnvelope deserialize an envelope.

func WrapEnvelope

func WrapEnvelope(data []byte, header *common.Header) []byte

WrapEnvelope serialize envelope.

Types

type NoOpSigner

type NoOpSigner struct{}

NoOpSigner supports unsigned envelopes.

func (*NoOpSigner) Serialize

func (*NoOpSigner) Serialize() ([]byte, error)

Serialize is an empty implementations of the singer API.

func (*NoOpSigner) Sign

func (*NoOpSigner) Sign([]byte) ([]byte, error)

Sign is an empty implementations of the singer API.

Jump to

Keyboard shortcuts

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