-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch blockcutter to always use sharedconfig
There was a XXX in the multichain manager to push the blockcutter batchSize into the blockcutter via sharedconfig, rather than to pass it at construction time. This is necessary to be able to dynamically change the value of the batch size after genesis. This changeset also introduces a sharedconfig mock structure in the orderer/mocks package as it will likely be more broadly useful to other tests going forward. Change-Id: I1af47c3ca62a545236efa1e03280203ec5e75a76 Signed-off-by: Jason Yellick <jyellick@us.ibm.com>
- v3.0.0
- v3.0.0-rc1
- v3.0.0-preview
- v3.0.0-beta
- v2.5.10
- v2.5.9
- v2.5.8
- v2.5.7
- v2.5.6
- v2.5.5
- v2.5.4
- v2.5.3
- v2.5.2
- v2.5.1
- v2.5.0
- v2.5.0-beta2
- v2.5.0-beta
- v2.5.0-alpha3
- v2.5.0-alpha2
- v2.5.0-alpha1
- v2.4.9
- v2.4.8
- v2.4.7
- v2.4.6
- v2.4.5
- v2.4.4
- v2.4.3
- v2.4.2
- v2.4.1
- v2.4.0
- v2.4.0-beta
- v2.4.0-alpha
- v2.3.3
- v2.3.2
- v2.3.1
- v2.3.0
- v2.2.15
- v2.2.14
- v2.2.13
- v2.2.12
- v2.2.11
- v2.2.10
- v2.2.9
- v2.2.8
- v2.2.7
- v2.2.6
- v2.2.5
- v2.2.4
- v2.2.3
- v2.2.2
- v2.2.1
- v2.2.0
- v2.1.1
- v2.1.0
- v2.0.1
- v2.0.0
- v2.0.0-beta
- v2.0.0-alpha
- v1.4.12
- v1.4.11
- v1.4.10
- v1.4.9
- v1.4.8
- v1.4.7
- v1.4.6
- v1.4.5
- v1.4.4
- v1.4.3
- v1.4.2
- v1.4.1
- v1.4.1-rc1
- v1.4.0
- v1.4.0-rc2
- v1.4.0-rc1
- v1.3.0
- v1.3.0-rc1
- v1.2.1
- v1.2.0
- v1.2.0-rc1
- v1.1.1
- v1.1.0
- v1.1.0-rc1
- v1.1.0-preview
- v1.1.0-alpha
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- v1.0.0-rc1
- v1.0.0-beta
- v1.0.0-alpha2
- v1.0.0-alpha
Jason Yellick
committed
Dec 12, 2016
1 parent
1093492
commit fcd00a1
Showing
5 changed files
with
87 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
Copyright IBM Corp. 2016 All Rights Reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package mocks | ||
|
||
// MockSharedConfigManager is a mock implementation of sharedconfig.Manager | ||
type SharedConfigManager struct { | ||
// ConsensusTypeVal is returned as the result of ConsensusType() | ||
ConsensusTypeVal string | ||
// BatchSizeVal is returned as the result of BatchSize() | ||
BatchSizeVal int | ||
// ChainCreatorsVal is returned as the result of ChainCreators() | ||
ChainCreatorsVal []string | ||
} | ||
|
||
// ConsensusType returns the configured consensus type | ||
func (scm *SharedConfigManager) ConsensusType() string { | ||
return scm.ConsensusTypeVal | ||
} | ||
|
||
// BatchSize returns the maximum number of messages to include in a block | ||
func (scm *SharedConfigManager) BatchSize() int { | ||
return scm.BatchSizeVal | ||
} | ||
|
||
// ChainCreators returns the policy names which are allowed for chain creation | ||
// This field is only set for the system ordering chain | ||
func (scm *SharedConfigManager) ChainCreators() []string { | ||
return scm.ChainCreatorsVal | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
Copyright IBM Corp. 2016 All Rights Reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package mocks | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/hyperledger/fabric/orderer/common/sharedconfig" | ||
) | ||
|
||
func TestSharedConfigInterface(t *testing.T) { | ||
_ = sharedconfig.Manager(&SharedConfigManager{}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters