Passed
Pull Request — master (#3)
by Timothy
06:14
created

ChaincodeHeaderExtension   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 100
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 1
Metric Value
c 1
b 1
f 1
dl 0
loc 100
rs 10
wmc 5
1
<?php
2
# Generated by the protocol buffer compiler.  DO NOT EDIT!
3
# source: peer/proposal.proto
4
5
namespace Hyperledger\Fabric\Protos\Peer;
6
7
use Google\Protobuf\Internal\GPBType;
8
use Google\Protobuf\Internal\RepeatedField;
9
use Google\Protobuf\Internal\GPBUtil;
10
11
/**
12
 * ChaincodeHeaderExtension is the Header's extentions message to be used when
13
 * the Header's type is CHAINCODE.  This extensions is used to specify which
14
 * chaincode to invoke and what should appear on the ledger.
15
 *
16
 * Generated from protobuf message <code>protos.ChaincodeHeaderExtension</code>
17
 */
18
class ChaincodeHeaderExtension extends \Google\Protobuf\Internal\Message
19
{
20
    /**
21
     * The PayloadVisibility field controls to what extent the Proposal's payload
22
     * (recall that for the type CHAINCODE, it is ChaincodeProposalPayload
23
     * message) field will be visible in the final transaction and in the ledger.
24
     * Ideally, it would be configurable, supporting at least 3 main visibility
25
     * modes:
26
     * 1. all bytes of the payload are visible;
27
     * 2. only a hash of the payload is visible;
28
     * 3. nothing is visible.
29
     * Notice that the visibility function may be potentially part of the ESCC.
30
     * In that case it overrides PayloadVisibility field.  Finally notice that
31
     * this field impacts the content of ProposalResponsePayload.proposalHash.
32
     *
33
     * Generated from protobuf field <code>bytes payload_visibility = 1;</code>
34
     */
35
    private $payload_visibility = '';
36
    /**
37
     * The ID of the chaincode to target.
38
     *
39
     * Generated from protobuf field <code>.protos.ChaincodeID chaincode_id = 2;</code>
40
     */
41
    private $chaincode_id = null;
42
43
    public function __construct() {
44
        \GPBMetadata\Peer\Proposal::initOnce();
45
        parent::__construct();
46
    }
47
48
    /**
49
     * The PayloadVisibility field controls to what extent the Proposal's payload
50
     * (recall that for the type CHAINCODE, it is ChaincodeProposalPayload
51
     * message) field will be visible in the final transaction and in the ledger.
52
     * Ideally, it would be configurable, supporting at least 3 main visibility
53
     * modes:
54
     * 1. all bytes of the payload are visible;
55
     * 2. only a hash of the payload is visible;
56
     * 3. nothing is visible.
57
     * Notice that the visibility function may be potentially part of the ESCC.
58
     * In that case it overrides PayloadVisibility field.  Finally notice that
59
     * this field impacts the content of ProposalResponsePayload.proposalHash.
60
     *
61
     * Generated from protobuf field <code>bytes payload_visibility = 1;</code>
62
     * @return string
63
     */
64
    public function getPayloadVisibility()
65
    {
66
        return $this->payload_visibility;
67
    }
68
69
    /**
70
     * The PayloadVisibility field controls to what extent the Proposal's payload
71
     * (recall that for the type CHAINCODE, it is ChaincodeProposalPayload
72
     * message) field will be visible in the final transaction and in the ledger.
73
     * Ideally, it would be configurable, supporting at least 3 main visibility
74
     * modes:
75
     * 1. all bytes of the payload are visible;
76
     * 2. only a hash of the payload is visible;
77
     * 3. nothing is visible.
78
     * Notice that the visibility function may be potentially part of the ESCC.
79
     * In that case it overrides PayloadVisibility field.  Finally notice that
80
     * this field impacts the content of ProposalResponsePayload.proposalHash.
81
     *
82
     * Generated from protobuf field <code>bytes payload_visibility = 1;</code>
83
     * @param string $var
84
     * @return $this
85
     */
86
    public function setPayloadVisibility($var)
87
    {
88
        GPBUtil::checkString($var, False);
89
        $this->payload_visibility = $var;
90
91
        return $this;
92
    }
93
94
    /**
95
     * The ID of the chaincode to target.
96
     *
97
     * Generated from protobuf field <code>.protos.ChaincodeID chaincode_id = 2;</code>
98
     * @return \Hyperledger\Fabric\Protos\Peer\ChaincodeID
99
     */
100
    public function getChaincodeId()
101
    {
102
        return $this->chaincode_id;
103
    }
104
105
    /**
106
     * The ID of the chaincode to target.
107
     *
108
     * Generated from protobuf field <code>.protos.ChaincodeID chaincode_id = 2;</code>
109
     * @param \Hyperledger\Fabric\Protos\Peer\ChaincodeID $var
110
     * @return $this
111
     */
112
    public function setChaincodeId($var)
113
    {
114
        GPBUtil::checkMessage($var, \Hyperledger\Fabric\Protos\Peer\ChaincodeID::class);
115
        $this->chaincode_id = $var;
116
117
        return $this;
118
    }
119
120
}
121
122