MCPcopy
hub / github.com/hyperledger/fabric / GetEnvelopeFromBlock

Function GetEnvelopeFromBlock

protoutil/txutils.go:49–58  ·  view source on GitHub ↗

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

(data []byte)

Source from the content-addressed store, hash-verified

47
48// GetEnvelopeFromBlock gets an envelope from a block's Data field.
49func GetEnvelopeFromBlock(data []byte) (*common.Envelope, error) {
50 // Block always begins with an envelope
51 var err error
52 env := &common.Envelope{}
53 if err = proto.Unmarshal(data, env); err != nil {
54 return nil, errors.Wrap(err, "error unmarshalling Envelope")
55 }
56
57 return env, nil
58}
59
60// CreateSignedEnvelope creates a signed envelope of the desired type, with
61// marshaled dataMsg and signs it

Callers 15

config_test.goFile · 0.92
configToGenesisBlockFunction · 0.92
configFromBlockFunction · 0.92
GetConfigFunction · 0.92
assertAnchorPeersFunction · 0.92
TestEnvelopeFunction · 0.92
validateTxMethod · 0.92
validateTxMethod · 0.92
toFilteredBlockFunction · 0.92
TestQueryGeneratedBlockFunction · 0.92

Calls 2

WrapMethod · 0.80
UnmarshalMethod · 0.65

Tested by 14

configToGenesisBlockFunction · 0.74
configFromBlockFunction · 0.74
assertAnchorPeersFunction · 0.74
TestEnvelopeFunction · 0.74
TestQueryGeneratedBlockFunction · 0.74
TestLedgerBackupFunction · 0.74
TestKVLedgerBlockStorageFunction · 0.74
makeUpdateConfigEnvelopeFunction · 0.74
checkBlocksFunction · 0.74