Skip to content

Commit 71c82ad

Browse files
author
Hayim.Shaul@ibm.com
committed
validate proposal
Signed-off-by: Hayim.Shaul@ibm.com <hayimsha@fhe3.haifa.ibm.com>
1 parent b4aac87 commit 71c82ad

8 files changed

Lines changed: 605 additions & 57 deletions

File tree

token/services/network/fabric/endorsement/fsc/deps.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,22 @@ type NamespaceTxProcessor interface {
7575
// EnableTxProcessing signals the backend to process all the transactions for the given tms id
7676
EnableTxProcessing(tmsID token.TMSID) error
7777
}
78+
79+
// MSPManager provides MSP-based identity validation and signature verification for a Fabric channel.
80+
// It is used to verify that the proposal creator is known to the network.
81+
//
82+
//go:generate counterfeiter -o mock/msp_manager.go -fake-name MSPManager . MSPManager
83+
type MSPManager interface {
84+
// IsValid checks that the identity is valid (i.e., known to the network via MSP)
85+
IsValid(identity view.Identity) error
86+
// GetVerifier returns a verifier for the given identity, which can be used to verify signatures
87+
GetVerifier(identity view.Identity) (driver.Verifier, error)
88+
}
89+
90+
// ChannelProvider provides access to the MSP manager for a given Fabric network and channel.
91+
//
92+
//go:generate counterfeiter -o mock/channel_provider.go -fake-name ChannelProvider . ChannelProvider
93+
type ChannelProvider interface {
94+
// GetMSPManager returns the MSP manager for the given network and channel
95+
GetMSPManager(network, channel string) (MSPManager, error)
96+
}

token/services/network/fabric/endorsement/fsc/mock/channel_provider.go

Lines changed: 118 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

token/services/network/fabric/endorsement/fsc/mock/msp_manager.go

Lines changed: 192 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)