Skip to content

Commit

Permalink
[FAB-5382] Add a promise return to method's JSDoc
Browse files Browse the repository at this point in the history
The JSDoc for these methods need to state that they return a promise for the
object as opposed to returning the object directly.

BaseClient.js  --  newDefaultKeyValueStore()
Channel.js  -- queryBlock(), queryBlockByHash(), queryInfo(), queryTransaction(), and queryInstantiatedChaincodes()

Change-Id: Ibdcfb15bc347e09ff2001498a10d73ca146c0c47
Signed-off-by: Eric Vaughn <eric.vaughn@blocledger.com>
  • Loading branch information
ericmvaughn committed Jul 19, 2017
1 parent cc5356b commit 326d0b1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion fabric-client/lib/BaseClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ var BaseClient = class {
*
* @param {Object} options Specific to the implementation, for initializing the instance. For the built-in
* file-based implementation, this requires a single property <code>path</code> to the top-level folder for the store
* @returns {module:api.KeyValueStore} An instance of the KeyValueStore implementation
* @returns {Promise} A Promise for a {@link module:api.KeyValueStore} instance of the KeyValueStore implementation
*/
static newDefaultKeyValueStore(options) {
return sdkUtils.newKeyValueStore(options);
Expand Down
11 changes: 6 additions & 5 deletions fabric-client/lib/Channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,8 @@ var Channel = class {
*
* @param {Peer} target - Optional. The peer that is the target for this query. If no target is passed,
* the query will use the first peer that was added to the channel object.
* @returns {BlockchainInfo} With blockchain height, current block hash and previous block hash.
* @returns {Promise} A Promise for a {@link BlockchainInfo} object with blockchain height,
* current block hash and previous block hash.
*/
queryInfo(target) {
logger.debug('queryInfo - start');
Expand Down Expand Up @@ -819,7 +820,7 @@ var Channel = class {
* @param {byte[]} block hash of the Block in question.
* @param {Peer} target - Optional. The peer to send the query to. If no target is passed,
* the query is sent to the first peer that was added to the channel object.
* @returns {Block} The block matching the hash, fully decoded into an object.
* @returns {Promise} A Promise for a {@link Block} matching the hash, fully decoded into an object.
*/
queryBlockByHash(blockHash, target) {
logger.debug('queryBlockByHash - start');
Expand Down Expand Up @@ -881,7 +882,7 @@ var Channel = class {
* @param {number} blockNumber - The number of the Block in question.
* @param {Peer} target - Optional. The peer to send this query to. If no target is passed,
* the query is sent to the first peer that was added to the channel object.
* @returns {Block} The block at the blockNumber slot in the ledger, fully decoded into an object.
* @returns {Promise} A Promise for a {@link Block} at the blockNumber slot in the ledger, fully decoded into an object.
*/
queryBlock(blockNumber, target) {
logger.debug('queryBlock - start blockNumber %s',blockNumber);
Expand Down Expand Up @@ -945,7 +946,7 @@ var Channel = class {
* @param {string} tx_id - The id of the transaction
* @param {Peer} target - Optional. The peer to send this query to. If no target is passed,
* the query is sent to the first peer that was added to the channel object.
* @returns {ProcessedTransaction} The fully decoded ProcessedTransaction object.
* @returns {Promise} A Promise for a fully decoded {@link ProcessedTransaction} object.
*/
queryTransaction(tx_id, target) {
logger.debug('queryTransaction - start transactionID %s',tx_id);
Expand Down Expand Up @@ -1007,7 +1008,7 @@ var Channel = class {
*
* @param {Peer} target - Optional. The peer to send this query to. If no target is passed,
* the query is sent to the first peer that was added to the channel object.
* @returns {ChaincodeQueryResponse} A fully decoded ChaincodeQueryResponse object
* @returns {Promise} A Promise for a fully decoded {@link ChaincodeQueryResponse} object.
*/
queryInstantiatedChaincodes(target) {
logger.debug('queryInstantiatedChaincodes - start');
Expand Down

0 comments on commit 326d0b1

Please sign in to comment.