@@ -87,7 +87,7 @@ type ChainExtension interface {
8787 SignPayload (payload []byte ) (* SignedEnvelope , error )
8888 BroadcastEnvelope (envelope * SignedEnvelope ) ([]* TransactionResponse , error )
8989
90- // TODO: This should go somewhere else?
90+ // TODO: This should go somewhere else - see TransactionProposal.GetBytes(). - deprecated
9191 GetProposalBytes (tp * TransactionProposal ) ([]byte , error )
9292}
9393
@@ -109,6 +109,11 @@ type TransactionProposal struct {
109109 proposal * pb.Proposal
110110}
111111
112+ // GetBytes returns the serialized bytes of this proposal
113+ func (tp * TransactionProposal ) GetBytes () ([]byte , error ) {
114+ return proto .Marshal (tp .signedProposal )
115+ }
116+
112117// TransactionProposalResponse ...
113118/**
114119 * The TransactionProposalResponse result object returned from endorsers.
@@ -122,14 +127,22 @@ type TransactionProposalResponse struct {
122127 proposalResponse * pb.ProposalResponse
123128}
124129
125- // GetResponsePayload returns the response payload
130+ // GetResponsePayload returns the response object payload
126131func (tpr * TransactionProposalResponse ) GetResponsePayload () []byte {
127132 if tpr == nil || tpr .proposalResponse == nil {
128133 return nil
129134 }
130135 return tpr .proposalResponse .GetResponse ().Payload
131136}
132137
138+ // GetPayload returns the response payload
139+ func (tpr * TransactionProposalResponse ) GetPayload () []byte {
140+ if tpr == nil || tpr .proposalResponse == nil {
141+ return nil
142+ }
143+ return tpr .proposalResponse .Payload
144+ }
145+
133146// The Transaction object created from an endorsed proposal
134147type Transaction struct {
135148 proposal * TransactionProposal
0 commit comments