-
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.
This change-set does the following: 1. Refactors the mcs package to simplify mocking; 2. Implements the method VerifyBlock of the MessageCryptoService interface. 3. Tests This change-set should be merged together with https://gerrit.hyperledger.org/r/#/c/6321/ Change-Id: Ia4a1d92ee5ede55caaffe9a9b53afb2552308e2d Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
- Loading branch information
Showing
14 changed files
with
499 additions
and
127 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,55 @@ | ||
/* | ||
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 mgmt | ||
|
||
import ( | ||
"github.com/hyperledger/fabric/msp" | ||
) | ||
|
||
// DeserializersManager is a support interface to | ||
// access the local and channel deserializers | ||
type DeserializersManager interface { | ||
|
||
// GetLocalMSPIdentifier returns the local MSP identifier | ||
GetLocalMSPIdentifier() string | ||
|
||
// GetLocalDeserializer returns the local identity deserializer | ||
GetLocalDeserializer() msp.IdentityDeserializer | ||
|
||
// GetChannelDeserializers returns a map of the channel deserializers | ||
GetChannelDeserializers() map[string]msp.IdentityDeserializer | ||
} | ||
|
||
// DeserializersManager returns a new instance of DeserializersManager | ||
func NewDeserializersManager() DeserializersManager { | ||
return &mspDeserializersManager{} | ||
} | ||
|
||
type mspDeserializersManager struct{} | ||
|
||
func (m *mspDeserializersManager) GetLocalMSPIdentifier() string { | ||
id, _ := GetLocalMSP().GetIdentifier() | ||
return id | ||
} | ||
|
||
func (m *mspDeserializersManager) GetLocalDeserializer() msp.IdentityDeserializer { | ||
return GetLocalMSP() | ||
} | ||
|
||
func (m *mspDeserializersManager) GetChannelDeserializers() map[string]msp.IdentityDeserializer { | ||
return GetDeserializers() | ||
} |
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.