-
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-187] VSCC uses policies specified upon deploy
This change-set provides support for endorsement policies. At chaincode deploy time, the deployer can specify the endorsement policy it requires from command line. The cc deploy tx is sent to lccc which stores the policy. Later, the validator can extract the policy and send it to VSCC. Change-Id: Ic1bc0e492a9070a355cfba83dfa56d121902c543 Signed-off-by: Alessandro Sorniotti <ale.linux@sopit.net>
- Loading branch information
Showing
15 changed files
with
380 additions
and
102 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
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 sysccprovider | ||
|
||
// SystemChaincodeProvider provides an abstraction layer that is | ||
// used for different packages to interact with code in the | ||
// system chaincode package without importing it; more methods | ||
// should be added below if necessary | ||
type SystemChaincodeProvider interface { | ||
// IsSysCC returns true if the supplied chaincode is a system chaincode | ||
IsSysCC(name string) bool | ||
} | ||
|
||
var sccFactory SystemChaincodeProviderFactory | ||
|
||
// SystemChaincodeProviderFactory defines a factory interface so | ||
// that the actual implementation can be injected | ||
type SystemChaincodeProviderFactory interface { | ||
NewSystemChaincodeProvider() SystemChaincodeProvider | ||
} | ||
|
||
// RegisterSystemChaincodeProviderFactory is to be called once to set | ||
// the factory that will be used to obtain instances of ChaincodeProvider | ||
func RegisterSystemChaincodeProviderFactory(sccfact SystemChaincodeProviderFactory) { | ||
sccFactory = sccfact | ||
} | ||
|
||
// GetSystemChaincodeProvider returns instances of SystemChaincodeProvider; | ||
// the actual implementation is controlled by the factory that | ||
// is registered via RegisterSystemChaincodeProviderFactory | ||
func GetSystemChaincodeProvider() SystemChaincodeProvider { | ||
if sccFactory == nil { | ||
panic("The factory must be set first via RegisterSystemChaincodeProviderFactory") | ||
} | ||
return sccFactory.NewSystemChaincodeProvider() | ||
} |
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.