-
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.
[FAB-1523] Populate block metadata LastConfig
https://jira.hyperledger.org/browse/FAB-1523 This changeset adds new data types for Metadata and for LastConfiguration which is the second field of the block metadata. The Metadata type is intended to accomodate the other metadata fields as well, but is currently only utilized for the LastConfiguration. This changeset also populates the LastConfiguration field of the block metadata with this new data structure. Change-Id: I36e72f4c27b67dd7455aae2f423b4b14e54f9413 Signed-off-by: Jason Yellick <jyellick@us.ibm.com>
- Loading branch information
Jason Yellick
committed
Jan 10, 2017
1 parent
f806802
commit 75909aa
Showing
22 changed files
with
363 additions
and
131 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
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
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,49 @@ | ||
/* | ||
Copyright IBM Corp. 2017 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 configtx | ||
|
||
import cb "github.com/hyperledger/fabric/protos/common" | ||
|
||
// Manager is a mock implementation of configtx.Manager | ||
type Manager struct { | ||
// ChainIDVal is returned as the result of ChainID() | ||
ChainIDVal string | ||
|
||
// SequenceVal is returned as the result of Sequence() | ||
SequenceVal uint64 | ||
} | ||
|
||
// ConsensusType returns the ConsensusTypeVal | ||
func (cm *Manager) ChainID() string { | ||
return cm.ChainIDVal | ||
} | ||
|
||
// BatchSize returns the BatchSizeVal | ||
func (cm *Manager) Sequence() uint64 { | ||
return cm.SequenceVal | ||
} | ||
|
||
// Apply panics | ||
func (cm *Manager) Apply(configtx *cb.ConfigurationEnvelope) error { | ||
panic("Unimplemented") | ||
} | ||
|
||
// Validate panics | ||
func (cm *Manager) Validate(configtx *cb.ConfigurationEnvelope) error { | ||
panic("Unimplemented") | ||
|
||
} |
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. 2017 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 configtx | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/hyperledger/fabric/common/configtx" | ||
) | ||
|
||
func TestConfigtxManagerInterface(t *testing.T) { | ||
_ = configtx.Manager(&Manager{}) | ||
} |
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
Oops, something went wrong.