@@ -34,7 +34,6 @@ import (
34
34
"google.golang.org/grpc/grpclog"
35
35
"google.golang.org/grpc/metadata"
36
36
37
- "github.com/golang/protobuf/ptypes/timestamp"
38
37
"github.com/hyperledger/fabric/common/ledger/testutil"
39
38
mmsp "github.com/hyperledger/fabric/common/mocks/msp"
40
39
"github.com/hyperledger/fabric/common/util"
@@ -44,7 +43,6 @@ import (
44
43
"github.com/hyperledger/fabric/msp"
45
44
"github.com/hyperledger/fabric/msp/mgmt"
46
45
"github.com/hyperledger/fabric/msp/mgmt/testtools"
47
- "github.com/hyperledger/fabric/protos/common"
48
46
"github.com/hyperledger/fabric/protos/peer"
49
47
ehpb "github.com/hyperledger/fabric/protos/peer"
50
48
"github.com/hyperledger/fabric/protos/utils"
@@ -185,65 +183,7 @@ func TestSignedEvent(t *testing.T) {
185
183
return
186
184
}
187
185
}
188
- func createTestBlock (t * testing.T ) * common.Block {
189
- chdr := & common.ChannelHeader {
190
- Type : int32 (common .HeaderType_ENDORSER_TRANSACTION ),
191
- Version : 1 ,
192
- Timestamp : & timestamp.Timestamp {
193
- Seconds : time .Now ().Unix (),
194
- Nanos : 0 ,
195
- },
196
- ChannelId : "test" }
197
- hdr := & common.Header {ChannelHeader : utils .MarshalOrPanic (chdr )}
198
- payload := & common.Payload {Header : hdr }
199
- cea := & ehpb.ChaincodeEndorsedAction {}
200
- ccaPayload := & ehpb.ChaincodeActionPayload {Action : cea }
201
- env := & common.Envelope {}
202
- taa := & ehpb.TransactionAction {}
203
- taas := make ([]* ehpb.TransactionAction , 1 )
204
- taas [0 ] = taa
205
- tx := & ehpb.Transaction {Actions : taas }
206
- ccid := & ehpb.ChaincodeID {Name : "ccid" , Version : "v1" }
207
-
208
- events := & ehpb.ChaincodeEvent {
209
- ChaincodeId : "ccid" ,
210
- EventName : "EventName" ,
211
- Payload : []byte ("EventPayload" ),
212
- TxId : "TxID" }
213
-
214
- pHashBytes := []byte ("proposal_hash" )
215
- pResponse := & ehpb.Response {Status : 200 }
216
- results := []byte ("results" )
217
- eventBytes , err := utils .GetBytesChaincodeEvent (events )
218
- if err != nil {
219
- t .Fatalf ("Failure while marshalling the ProposalResponsePayload" )
220
- }
221
- ccaPayload .Action .ProposalResponsePayload , err = utils .GetBytesProposalResponsePayload (pHashBytes , pResponse , results , eventBytes , ccid )
222
- if err != nil {
223
- t .Fatalf ("Failure while marshalling the ProposalResponsePayload" )
224
- }
225
- tx .Actions [0 ].Payload , err = utils .GetBytesChaincodeActionPayload (ccaPayload )
226
- if err != nil {
227
- t .Fatalf ("Error marshalling tx action payload for block event: %s" , err )
228
- }
229
- payload .Data , err = utils .GetBytesTransaction (tx )
230
- if err != nil {
231
- t .Fatalf ("Failure while marshalling payload for block event: %s" , err )
232
- }
233
- env .Payload , err = utils .GetBytesPayload (payload )
234
- if err != nil {
235
- t .Fatalf ("Failure while marshalling tx envelope for block event: %s" , err )
236
- }
237
- ebytes , err := utils .GetBytesEnvelope (env )
238
- if err != nil {
239
- t .Fatalf ("Failure while marshalling transaction %s" , err )
240
- }
241
186
242
- block := common .NewBlock (1 , []byte {})
243
- block .Data .Data = append (block .Data .Data , ebytes )
244
- block .Header .DataHash = block .Data .Hash ()
245
- return block
246
- }
247
187
func createTestChaincodeEvent (tid string , typ string ) * ehpb.Event {
248
188
emsg := CreateChaincodeEvent (& ehpb.ChaincodeEvent {ChaincodeId : tid , EventName : typ })
249
189
return emsg
@@ -254,7 +194,6 @@ func TestReceiveMessage(t *testing.T) {
254
194
var err error
255
195
256
196
adapter .count = 1
257
- //emsg := createTestBlock()
258
197
emsg := createTestChaincodeEvent ("0xffffffff" , "event1" )
259
198
if err = Send (emsg ); err != nil {
260
199
t .Fail ()
0 commit comments