@@ -33,8 +33,6 @@ import (
33
33
ab "github.com/hyperledger/fabric/protos/orderer"
34
34
"github.com/hyperledger/fabric/protos/utils"
35
35
36
- "errors"
37
-
38
36
mmsp "github.com/hyperledger/fabric/common/mocks/msp"
39
37
logging "github.com/op/go-logging"
40
38
"github.com/stretchr/testify/assert"
@@ -63,18 +61,6 @@ func (mch mockCryptoHelper) VerifySignature(sd *cb.SignedData) error {
63
61
return nil
64
62
}
65
63
66
- func mockCryptoRejector () * mockCryptoRejectorHelper {
67
- return & mockCryptoRejectorHelper {LocalSigner : mockcrypto .FakeLocalSigner }
68
- }
69
-
70
- type mockCryptoRejectorHelper struct {
71
- * mockcrypto.LocalSigner
72
- }
73
-
74
- func (mch mockCryptoRejectorHelper ) VerifySignature (sd * cb.SignedData ) error {
75
- return errors .New ("Nope" )
76
- }
77
-
78
64
func NewRAMLedgerAndFactory (maxSize int ) (ledger.Factory , ledger.ReadWriter ) {
79
65
rlf := ramledger .New (10 )
80
66
rl , err := rlf .GetOrCreate (provisional .TestChainID )
@@ -213,45 +199,6 @@ func TestManagerImpl(t *testing.T) {
213
199
}
214
200
}
215
201
216
- /*
217
- // This test makes sure that the signature filter works
218
- func TestSignatureFilter(t *testing.T) {
219
- lf, rl := NewRAMLedgerAndFactory(10)
220
-
221
- consenters := make(map[string]Consenter)
222
- consenters[conf.Orderer.OrdererType] = &mockConsenter{}
223
-
224
- manager := NewManagerImpl(lf, consenters, mockCryptoRejector())
225
-
226
- cs, ok := manager.GetChain(provisional.TestChainID)
227
-
228
- if !ok {
229
- t.Fatalf("Should have gotten chain which was initialized by ramledger")
230
- }
231
-
232
- messages := make([]*cb.Envelope, conf.Orderer.BatchSize.MaxMessageCount)
233
- for i := 0; i < int(conf.Orderer.BatchSize.MaxMessageCount); i++ {
234
- messages[i] = makeSignaturelessTx(provisional.TestChainID, i)
235
- }
236
-
237
- for _, message := range messages {
238
- cs.Enqueue(message)
239
- }
240
-
241
- // Causes the consenter thread to exit after it processes all messages
242
- close(cs.(*chainSupport).chain.(*mockChain).queue)
243
-
244
- it, _ := rl.Iterator(&ab.SeekPosition{Type: &ab.SeekPosition_Specified{Specified: &ab.SeekSpecified{Number: 1}}})
245
- select {
246
- case <-it.ReadyChan():
247
- // Will unblock if a block is created
248
- t.Fatalf("Block 1 should not have been created")
249
- case <-cs.(*chainSupport).chain.(*mockChain).done:
250
- // Will unblock once the consenter thread has exited
251
- }
252
- }
253
- */
254
-
255
202
// This test brings up the entire system, with the mock consenter, including the broadcasters etc. and creates a new chain
256
203
func TestNewChain (t * testing.T ) {
257
204
expectedLastConfigBlockNumber := uint64 (0 )
0 commit comments