示例#1
0
func getFilters() *filter.RuleSet {
	return filter.NewRuleSet([]filter.Rule{
		&mockIsolatedFilter{},
		&mockRejectFilter{},
		&mockAcceptFilter{},
	})
}
示例#2
0
// createSystemChainFilters creates the set of filters for the ordering system chain
func createSystemChainFilters(ml *multiLedger, configManager configtx.Manager) *filter.RuleSet {
	return filter.NewRuleSet([]filter.Rule{
		filter.EmptyRejectRule,
		newSystemChainFilter(ml),
		configtx.NewFilter(configManager),
		filter.AcceptRule,
	})
}
示例#3
0
// createStandardFilters creates the set of filters for a normal (non-system) chain
func createStandardFilters(configManager configtx.Manager) *filter.RuleSet {
	return filter.NewRuleSet([]filter.Rule{
		filter.EmptyRejectRule,
		configtx.NewFilter(configManager),
		filter.AcceptRule,
	})

}
示例#4
0
func (mm *mockSupportManager) ProposeChain(configTx *cb.Envelope) cb.Status {
	payload := utils.ExtractPayloadOrPanic(configTx)

	mm.chains[string(payload.Header.ChainHeader.ChainID)] = &mockSupport{
		filters: filter.NewRuleSet([]filter.Rule{
			filter.EmptyRejectRule,
			filter.AcceptRule,
		}),
		queue: make(chan *cb.Envelope),
	}
	return cb.Status_SUCCESS
}
示例#5
0
func getMultichainManager() *mockSupportManager {
	filters := filter.NewRuleSet([]filter.Rule{
		filter.EmptyRejectRule,
		filter.AcceptRule,
	})
	mm := &mockSupportManager{
		chains: make(map[string]*mockSupport),
	}
	mm.chains[string(systemChain)] = &mockSupport{
		filters: filters,
		queue:   make(chan *cb.Envelope),
	}
	return mm
}