Skip to content

Commit

Permalink
Merge pull request #891 from nklincoln/chaincode-to-contract
Browse files Browse the repository at this point in the history
Global change of chaincode -> contract
  • Loading branch information
aklenik committed Jun 30, 2020
2 parents 78888de + 807b463 commit 46bbd0d
Show file tree
Hide file tree
Showing 45 changed files with 817 additions and 1,050 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# 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
Expand Down
26 changes: 0 additions & 26 deletions packages/caliper-burrow/.editorconfig

This file was deleted.

26 changes: 0 additions & 26 deletions packages/caliper-cli/.editorconfig

This file was deleted.

26 changes: 0 additions & 26 deletions packages/caliper-core/.editorconfig

This file was deleted.

6 changes: 3 additions & 3 deletions packages/caliper-core/lib/common/config/Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ const keys = {
SleepAfter: {
CreateChannel: 'caliper-fabric-sleepafter-createchannel',
JoinChannel: 'caliper-fabric-sleepafter-joinchannel',
InstantiateChaincode: 'caliper-fabric-sleepafter-instantiatechaincode',
InstantiateContract: 'caliper-fabric-sleepafter-instantiatecontract',
},
Verify: {
ProposalResponse: 'caliper-fabric-verify-proposalresponse',
ReadWriteSets: 'caliper-fabric-verify-readwritesets',
},
Timeout: {
ChaincodeInstantiate: 'caliper-fabric-timeout-chaincodeinstantiate',
ChaincodeInstantiateEvent: 'caliper-fabric-timeout-chaincodeinstantiateevent',
ContractInstantiate: 'caliper-fabric-timeout-contractinstantiate',
ContractInstantiateEvent: 'caliper-fabric-timeout-contractinstantiateevent',
InvokeOrQuery: 'caliper-fabric-timeout-invokeorquery',
},
LoadBalancing: 'caliper-fabric-loadbalancing',
Expand Down
12 changes: 6 additions & 6 deletions packages/caliper-core/lib/common/config/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ caliper:
createchannel: 5000
# The time in milliseconds to sleep after joining the channels (if joined channels at all)
joinchannel: 5000
# The time in milliseconds to sleep after instantiated the chaincodes (if instantiated chaincodes at all)
instantiatechaincode: 5000
# The time in milliseconds to sleep after instantiated the contracts (if instantiated contracts at all)
instantiatecontract: 5000
# Enables extra verification steps during the transaction proposal phase
verify:
# Indicates whether to verify the identity of the endorsers and their signatures for each proposal response after endorsing a transaction.
Expand All @@ -169,10 +169,10 @@ caliper:
readwritesets: true
# Contains client-side timeouts related to the initialization part of the adapter
timeout:
# Timeout in milliseconds for the endorsement part of a chaincode instantiation
chaincodeinstantiate: 300000
# Timeout in milliseconds for receiving the event about the result of a chaincode instantiation
chaincodeinstantiateevent: 100000
# Timeout in milliseconds for the endorsement part of a contract instantiation
contractinstantiate: 300000
# Timeout in milliseconds for receiving the event about the result of a contract instantiation
contractinstantiateevent: 100000
# The default timeout in milliseconds to use for invoking or querying transactions (applied for the entire life-cycle)
invokeorquery: 60000
# Determines how automatic load balancing is applied if the client callback module doesn’t provide explicit targets.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class BlockchainConnector {
* @param {String} contractID identity of the contract
* @param {String} contractVer version of the contract
* @param {String} key lookup key
* @param {String=} [fcn] The chaincode query function name
* @param {String=} [fcn] The contract query function name
*/
async queryState(context, contractID, contractVer, key, fcn) {
throw new Error('queryState is not implemented for this blockchain connector');
Expand Down
26 changes: 0 additions & 26 deletions packages/caliper-ethereum/.editorconfig

This file was deleted.

26 changes: 0 additions & 26 deletions packages/caliper-fabric/.editorconfig

This file was deleted.

8 changes: 4 additions & 4 deletions packages/caliper-fabric/lib/configValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class ConfigValidator {
for (const channel of channels) {
try {
ConfigValidator.validateChannel(config.channels[channel], orderers, peers, mspIds, takenContractIds, flowOptions, discovery);
takenContractIds.push(config.channels[channel].chaincodes.map(cc => cc.contractID || cc.id));
takenContractIds.push(config.channels[channel].contracts.map(cc => cc.contractID || cc.id));
} catch (err) {
throw new Error(`Invalid "${channel}" channel configuration: ${err.message}`);
}
Expand Down Expand Up @@ -316,7 +316,7 @@ class ConfigValidator {
peers: j.object().keys(createPeersSchema())[peerModif](),

// leave this embedded, so the validation error messages are more meaningful
chaincodes: j.array().sparse(false).items(j.object().keys({
contracts: j.array().sparse(false).items(j.object().keys({
id: j.string().min(1).required(),
version: j.string().min(1).required(),
contractID: j.string().min(1).disallow(takenContractIds).optional(),
Expand All @@ -333,7 +333,7 @@ class ConfigValidator {

'endorsement-policy': createEndorsementPolicySchema().optional(),
targetPeers: j.array().sparse(false).min(1).unique().items(j.string().valid(validPeers)).optional()
}) // constraints for the chaincode properties
}) // constraints for the contract properties
.with('metadataPath', 'path') // if metadataPath is provided, installation needs the path
.with('path', 'language') // if path is provided, installation needs the language
// the following properties indicate instantiation, which needs the language property
Expand All @@ -342,7 +342,7 @@ class ConfigValidator {
.with('initTransientMap', 'language')
.with('collections-config', 'language')
.with('endorsement-policy', 'language')
).unique(contractIdComparator).required() // for the chaincodes collection
).unique(contractIdComparator).required() // for the contracts collection
});

if (needXor) {
Expand Down
Loading

0 comments on commit 46bbd0d

Please sign in to comment.