@theledger/fabric-mock-stub
Advanced tools
Comparing version 1.1.0 to 1.2.0
/// <reference types="@theledger/fabric-shim-types" /> | ||
/// <reference types="node" /> | ||
import { ChaincodeInterface, ChaincodeReponse, Iterators, MockStub, ProposalCreator, SignedProposal, SplitCompositekey } from 'fabric-shim'; | ||
import { ChaincodeInterface, ChaincodeReponse, Iterators, KeyModification, MockStub, ProposalCreator, SignedProposal, SplitCompositekey } from 'fabric-shim'; | ||
import { Timestamp } from 'google-protobuf/google/protobuf/timestamp_pb'; | ||
@@ -18,2 +18,3 @@ /** | ||
event: Map<string, Buffer>; | ||
history: Map<string, KeyModification[]>; | ||
private invokables; | ||
@@ -168,3 +169,4 @@ private signedProposal; | ||
/** | ||
* @todo Implement | ||
* GetHistory for key | ||
* | ||
* @param {string} key | ||
@@ -195,4 +197,4 @@ * @returns {Promise<"fabric-shim".Iterators.HistoryQueryIterator>} | ||
* | ||
* @param {string} key | ||
* @returns {Promise<Buffer>} | ||
* @param name | ||
*/ | ||
@@ -199,0 +201,0 @@ getEvent(name: string): Promise<Buffer>; |
@@ -46,2 +46,4 @@ "use strict"; | ||
var datatransform_1 = require("./utils/datatransform"); | ||
var MockProtoTimestamp_1 = require("./MockProtoTimestamp"); | ||
var MockHistoryQueryIterator_1 = require("./MockHistoryQueryIterator"); | ||
var defaultUserCert = '-----BEGIN CERTIFICATE-----' + | ||
@@ -76,2 +78,3 @@ 'MIIB6TCCAY+gAwIBAgIUHkmY6fRP0ANTvzaBwKCkMZZPUnUwCgYIKoZIzj0EAwIw' + | ||
this.event = new Map(); | ||
this.history = new Map(); | ||
this.logger = helpers_1.Helpers.getLoggerInstance(this.name); | ||
@@ -268,2 +271,11 @@ } | ||
this.state[key] = value; | ||
if (!this.history[key]) { | ||
this.history[key] = []; | ||
} | ||
this.history[key].push({ | ||
is_delete: false, | ||
value: value, | ||
timestamp: new MockProtoTimestamp_1.MockProtoTimestamp(), | ||
tx_id: this.txID | ||
}); | ||
return Promise.resolve(); | ||
@@ -278,2 +290,9 @@ }; | ||
ChaincodeMockStub.prototype.deleteState = function (key) { | ||
var value = this.state[key]; | ||
this.history[key].push({ | ||
is_delete: true, | ||
value: value, | ||
timestamp: new MockProtoTimestamp_1.MockProtoTimestamp(), | ||
tx_id: this.txID | ||
}); | ||
delete this.state[key]; | ||
@@ -390,3 +409,4 @@ return Promise.resolve(); | ||
/** | ||
* @todo Implement | ||
* GetHistory for key | ||
* | ||
* @param {string} key | ||
@@ -396,3 +416,3 @@ * @returns {Promise<"fabric-shim".Iterators.HistoryQueryIterator>} | ||
ChaincodeMockStub.prototype.getHistoryForKey = function (key) { | ||
return undefined; | ||
return Promise.resolve(new MockHistoryQueryIterator_1.MockHistoryQueryIterator(this.history[key])); | ||
}; | ||
@@ -430,4 +450,4 @@ /** | ||
* | ||
* @param {string} key | ||
* @returns {Promise<Buffer>} | ||
* @param name | ||
*/ | ||
@@ -434,0 +454,0 @@ ChaincodeMockStub.prototype.getEvent = function (name) { |
@@ -6,1 +6,7 @@ import { ChaincodeError } from './ChaincodeError'; | ||
export { ChaincodeError, Transform, ChaincodeMockStub, Helpers }; | ||
export interface KeyModificationItem { | ||
is_delete: boolean; | ||
value: Object; | ||
timestamp: number; | ||
tx_id: string; | ||
} |
/// <reference types="@theledger/fabric-shim-types" /> | ||
import { Iterators, KV } from 'fabric-shim'; | ||
import { Iterators, KV, NextResult } from 'fabric-shim'; | ||
/** | ||
@@ -11,7 +11,4 @@ * @hidden | ||
constructor(data: KV[]); | ||
next(): Promise<{ | ||
value: any; | ||
done: boolean; | ||
}>; | ||
next(): Promise<NextResult>; | ||
close(): void; | ||
} |
/// <reference types="node" /> | ||
/// <reference types="@theledger/fabric-shim-types" /> | ||
import { Iterators, KV } from 'fabric-shim'; | ||
import { KeyModificationItem } from '../index'; | ||
/** | ||
@@ -51,2 +52,9 @@ * The Transform class is a helper to provide data transformation to and from the formats required by hyperledger fabric. | ||
/** | ||
* Transform iterator to array of objects | ||
* | ||
* @param {'fabric-shim'.Iterators.HistoryQueryIterator} iterator | ||
* @returns {Promise<Array>} | ||
*/ | ||
static iteratorToHistoryList(iterator: Iterators.HistoryQueryIterator): Promise<KeyModificationItem[]>; | ||
/** | ||
* normalizePayload | ||
@@ -53,0 +61,0 @@ * |
@@ -72,3 +72,4 @@ "use strict"; | ||
} | ||
var bufferString = buffer.toString(); | ||
var bufferString = buffer.toString('utf8'); | ||
console.log(bufferString); | ||
if (bufferString.length <= 0) { | ||
@@ -189,2 +190,49 @@ return; | ||
/** | ||
* Transform iterator to array of objects | ||
* | ||
* @param {'fabric-shim'.Iterators.HistoryQueryIterator} iterator | ||
* @returns {Promise<Array>} | ||
*/ | ||
Transform.iteratorToHistoryList = function (iterator) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var allResults, res, parsedItem; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
allResults = []; | ||
_a.label = 1; | ||
case 1: | ||
if (!(res == null || !res.done)) return [3 /*break*/, 3]; | ||
return [4 /*yield*/, iterator.next()]; | ||
case 2: | ||
res = _a.sent(); | ||
if (res.value && res.value.value.toString()) { | ||
parsedItem = { | ||
is_delete: false, | ||
value: {}, | ||
timestamp: null, | ||
tx_id: '' | ||
}; | ||
try { | ||
parsedItem.value = JSON.parse(res.value.value.toString('utf8')); | ||
} | ||
catch (err) { | ||
parsedItem.value = res.value.value.toString('utf8'); | ||
} | ||
parsedItem.is_delete = res.value.is_delete; | ||
parsedItem.tx_id = res.value.tx_id; | ||
parsedItem.timestamp = res.value.timestamp.getSeconds(); | ||
allResults.push(parsedItem); | ||
} | ||
return [3 /*break*/, 1]; | ||
case 3: return [4 /*yield*/, iterator.close()]; | ||
case 4: | ||
_a.sent(); | ||
return [2 /*return*/, allResults]; | ||
} | ||
}); | ||
}); | ||
}; | ||
; | ||
/** | ||
* normalizePayload | ||
@@ -191,0 +239,0 @@ * |
var typedoc = typedoc || {}; | ||
typedoc.search = typedoc.search || {}; | ||
typedoc.search.data = {"kinds":{"1":"External module","32":"Variable","128":"Class","512":"Constructor","1024":"Property","2048":"Method","262144":"Accessor"},"rows":[{"id":0,"kind":1,"name":"\"ChaincodeError\"","url":"modules/_chaincodeerror_.html","classes":"tsd-kind-external-module"},{"id":1,"kind":128,"name":"ChaincodeError","url":"classes/_chaincodeerror_.chaincodeerror.html","classes":"tsd-kind-class tsd-parent-kind-external-module","parent":"\"ChaincodeError\""},{"id":2,"kind":512,"name":"constructor","url":"classes/_chaincodeerror_.chaincodeerror.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"\"ChaincodeError\".ChaincodeError"},{"id":3,"kind":262144,"name":"serialized","url":"classes/_chaincodeerror_.chaincodeerror.html#serialized","classes":"tsd-kind-get-signature tsd-parent-kind-class","parent":"\"ChaincodeError\".ChaincodeError"},{"id":4,"kind":1024,"name":"name","url":"classes/_chaincodeerror_.chaincodeerror.html#name","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-static","parent":"\"ChaincodeError\".ChaincodeError"},{"id":5,"kind":1024,"name":"message","url":"classes/_chaincodeerror_.chaincodeerror.html#message","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-static","parent":"\"ChaincodeError\".ChaincodeError"},{"id":6,"kind":1024,"name":"stack","url":"classes/_chaincodeerror_.chaincodeerror.html#stack","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-overwrite tsd-is-inherited tsd-is-static","parent":"\"ChaincodeError\".ChaincodeError"},{"id":7,"kind":1024,"name":"Error","url":"classes/_chaincodeerror_.chaincodeerror.html#error","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-static","parent":"\"ChaincodeError\".ChaincodeError"},{"id":8,"kind":1,"name":"\"MockStateQueryIterator\"","url":"modules/_mockstatequeryiterator_.html","classes":"tsd-kind-external-module"},{"id":9,"kind":1,"name":"\"IdBytes\"","url":"modules/_idbytes_.html","classes":"tsd-kind-external-module"},{"id":10,"kind":1,"name":"\"ChaincodeProposalCreator\"","url":"modules/_chaincodeproposalcreator_.html","classes":"tsd-kind-external-module"},{"id":11,"kind":1,"name":"\"CompositeKeys\"","url":"modules/_compositekeys_.html","classes":"tsd-kind-external-module"},{"id":12,"kind":1,"name":"\"utils/helpers\"","url":"modules/_utils_helpers_.html","classes":"tsd-kind-external-module"},{"id":13,"kind":128,"name":"Helpers","url":"classes/_utils_helpers_.helpers.html","classes":"tsd-kind-class tsd-parent-kind-external-module","parent":"\"utils/helpers\""},{"id":14,"kind":2048,"name":"getLoggerInstance","url":"classes/_utils_helpers_.helpers.html#getloggerinstance","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"\"utils/helpers\".Helpers"},{"id":15,"kind":2048,"name":"checkArgs","url":"classes/_utils_helpers_.helpers.html#checkargs","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"\"utils/helpers\".Helpers"},{"id":16,"kind":1,"name":"\"utils/datatransform\"","url":"modules/_utils_datatransform_.html","classes":"tsd-kind-external-module"},{"id":17,"kind":128,"name":"Transform","url":"classes/_utils_datatransform_.transform.html","classes":"tsd-kind-class tsd-parent-kind-external-module","parent":"\"utils/datatransform\""},{"id":18,"kind":2048,"name":"serialize","url":"classes/_utils_datatransform_.transform.html#serialize","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"\"utils/datatransform\".Transform"},{"id":19,"kind":2048,"name":"bufferToObject","url":"classes/_utils_datatransform_.transform.html#buffertoobject","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"\"utils/datatransform\".Transform"},{"id":20,"kind":2048,"name":"bufferToDate","url":"classes/_utils_datatransform_.transform.html#buffertodate","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"\"utils/datatransform\".Transform"},{"id":21,"kind":2048,"name":"bufferToString","url":"classes/_utils_datatransform_.transform.html#buffertostring","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"\"utils/datatransform\".Transform"},{"id":22,"kind":2048,"name":"iteratorToList","url":"classes/_utils_datatransform_.transform.html#iteratortolist","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"\"utils/datatransform\".Transform"},{"id":23,"kind":2048,"name":"iteratorToKVList","url":"classes/_utils_datatransform_.transform.html#iteratortokvlist","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"\"utils/datatransform\".Transform"},{"id":24,"kind":2048,"name":"normalizePayload","url":"classes/_utils_datatransform_.transform.html#normalizepayload","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"\"utils/datatransform\".Transform"},{"id":25,"kind":1,"name":"\"ChaincodeMockStub\"","url":"modules/_chaincodemockstub_.html","classes":"tsd-kind-external-module"},{"id":26,"kind":128,"name":"ChaincodeMockStub","url":"classes/_chaincodemockstub_.chaincodemockstub.html","classes":"tsd-kind-class tsd-parent-kind-external-module","parent":"\"ChaincodeMockStub\""},{"id":27,"kind":1024,"name":"state","url":"classes/_chaincodemockstub_.chaincodemockstub.html#state","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":28,"kind":512,"name":"constructor","url":"classes/_chaincodemockstub_.chaincodemockstub.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":29,"kind":2048,"name":"getTxID","url":"classes/_chaincodemockstub_.chaincodemockstub.html#gettxid","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":30,"kind":2048,"name":"getArgs","url":"classes/_chaincodemockstub_.chaincodemockstub.html#getargs","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":31,"kind":2048,"name":"getStringArgs","url":"classes/_chaincodemockstub_.chaincodemockstub.html#getstringargs","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":32,"kind":2048,"name":"getFunctionAndParameters","url":"classes/_chaincodemockstub_.chaincodemockstub.html#getfunctionandparameters","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":33,"kind":2048,"name":"mockTransactionStart","url":"classes/_chaincodemockstub_.chaincodemockstub.html#mocktransactionstart","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":34,"kind":2048,"name":"mockTransactionEnd","url":"classes/_chaincodemockstub_.chaincodemockstub.html#mocktransactionend","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":35,"kind":2048,"name":"mockPeerChaincode","url":"classes/_chaincodemockstub_.chaincodemockstub.html#mockpeerchaincode","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":36,"kind":2048,"name":"mockInit","url":"classes/_chaincodemockstub_.chaincodemockstub.html#mockinit","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":37,"kind":2048,"name":"mockInvoke","url":"classes/_chaincodemockstub_.chaincodemockstub.html#mockinvoke","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":38,"kind":2048,"name":"invokeChaincode","url":"classes/_chaincodemockstub_.chaincodemockstub.html#invokechaincode","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":39,"kind":2048,"name":"mockInvokeWithSignedProposal","url":"classes/_chaincodemockstub_.chaincodemockstub.html#mockinvokewithsignedproposal","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":40,"kind":2048,"name":"getState","url":"classes/_chaincodemockstub_.chaincodemockstub.html#getstate","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":41,"kind":2048,"name":"putState","url":"classes/_chaincodemockstub_.chaincodemockstub.html#putstate","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":42,"kind":2048,"name":"deleteState","url":"classes/_chaincodemockstub_.chaincodemockstub.html#deletestate","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":43,"kind":2048,"name":"getStateByRange","url":"classes/_chaincodemockstub_.chaincodemockstub.html#getstatebyrange","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":44,"kind":2048,"name":"getQueryResult","url":"classes/_chaincodemockstub_.chaincodemockstub.html#getqueryresult","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":45,"kind":2048,"name":"getStateByPartialCompositeKey","url":"classes/_chaincodemockstub_.chaincodemockstub.html#getstatebypartialcompositekey","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":46,"kind":2048,"name":"createCompositeKey","url":"classes/_chaincodemockstub_.chaincodemockstub.html#createcompositekey","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":47,"kind":2048,"name":"splitCompositeKey","url":"classes/_chaincodemockstub_.chaincodemockstub.html#splitcompositekey","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":48,"kind":2048,"name":"getSignedProposal","url":"classes/_chaincodemockstub_.chaincodemockstub.html#getsignedproposal","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":49,"kind":2048,"name":"setSignedProposal","url":"classes/_chaincodemockstub_.chaincodemockstub.html#setsignedproposal","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":50,"kind":2048,"name":"setTxTimestamp","url":"classes/_chaincodemockstub_.chaincodemockstub.html#settxtimestamp","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":51,"kind":2048,"name":"getTxTimestamp","url":"classes/_chaincodemockstub_.chaincodemockstub.html#gettxtimestamp","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":52,"kind":2048,"name":"getCreator","url":"classes/_chaincodemockstub_.chaincodemockstub.html#getcreator","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":53,"kind":2048,"name":"getHistoryForKey","url":"classes/_chaincodemockstub_.chaincodemockstub.html#gethistoryforkey","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":54,"kind":2048,"name":"getBinding","url":"classes/_chaincodemockstub_.chaincodemockstub.html#getbinding","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":55,"kind":2048,"name":"getTransient","url":"classes/_chaincodemockstub_.chaincodemockstub.html#gettransient","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":56,"kind":2048,"name":"setEvent","url":"classes/_chaincodemockstub_.chaincodemockstub.html#setevent","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":57,"kind":2048,"name":"getChannelID","url":"classes/_chaincodemockstub_.chaincodemockstub.html#getchannelid","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":58,"kind":32,"name":"defaultUserCert","url":"modules/_chaincodemockstub_.html#defaultusercert","classes":"tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported","parent":"\"ChaincodeMockStub\""},{"id":59,"kind":1,"name":"\"constants/errors\"","url":"modules/_constants_errors_.html","classes":"tsd-kind-external-module"},{"id":60,"kind":1,"name":"\"index\"","url":"modules/_index_.html","classes":"tsd-kind-external-module"}]}; | ||
typedoc.search.data = {"kinds":{"1":"External module","2":"Module","32":"Variable","128":"Class","256":"Interface","512":"Constructor","1024":"Property","2048":"Method","65536":"Type literal","262144":"Accessor","4194304":"Type alias"},"rows":[{"id":0,"kind":1,"name":"\"ChaincodeError\"","url":"modules/_chaincodeerror_.html","classes":"tsd-kind-external-module"},{"id":1,"kind":128,"name":"ChaincodeError","url":"classes/_chaincodeerror_.chaincodeerror.html","classes":"tsd-kind-class tsd-parent-kind-external-module","parent":"\"ChaincodeError\""},{"id":2,"kind":512,"name":"constructor","url":"classes/_chaincodeerror_.chaincodeerror.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"\"ChaincodeError\".ChaincodeError"},{"id":3,"kind":262144,"name":"serialized","url":"classes/_chaincodeerror_.chaincodeerror.html#serialized","classes":"tsd-kind-get-signature tsd-parent-kind-class","parent":"\"ChaincodeError\".ChaincodeError"},{"id":4,"kind":1024,"name":"name","url":"classes/_chaincodeerror_.chaincodeerror.html#name","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-static","parent":"\"ChaincodeError\".ChaincodeError"},{"id":5,"kind":1024,"name":"message","url":"classes/_chaincodeerror_.chaincodeerror.html#message","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-static","parent":"\"ChaincodeError\".ChaincodeError"},{"id":6,"kind":1024,"name":"stack","url":"classes/_chaincodeerror_.chaincodeerror.html#stack","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-overwrite tsd-is-inherited tsd-is-static","parent":"\"ChaincodeError\".ChaincodeError"},{"id":7,"kind":1024,"name":"Error","url":"classes/_chaincodeerror_.chaincodeerror.html#error","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-static","parent":"\"ChaincodeError\".ChaincodeError"},{"id":8,"kind":1,"name":"\"MockStateQueryIterator\"","url":"modules/_mockstatequeryiterator_.html","classes":"tsd-kind-external-module"},{"id":9,"kind":1,"name":"\"IdBytes\"","url":"modules/_idbytes_.html","classes":"tsd-kind-external-module"},{"id":10,"kind":1,"name":"\"ChaincodeProposalCreator\"","url":"modules/_chaincodeproposalcreator_.html","classes":"tsd-kind-external-module"},{"id":11,"kind":1,"name":"\"CompositeKeys\"","url":"modules/_compositekeys_.html","classes":"tsd-kind-external-module"},{"id":12,"kind":1,"name":"\"utils/helpers\"","url":"modules/_utils_helpers_.html","classes":"tsd-kind-external-module"},{"id":13,"kind":128,"name":"Helpers","url":"classes/_utils_helpers_.helpers.html","classes":"tsd-kind-class tsd-parent-kind-external-module","parent":"\"utils/helpers\""},{"id":14,"kind":2048,"name":"getLoggerInstance","url":"classes/_utils_helpers_.helpers.html#getloggerinstance","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"\"utils/helpers\".Helpers"},{"id":15,"kind":2048,"name":"checkArgs","url":"classes/_utils_helpers_.helpers.html#checkargs","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"\"utils/helpers\".Helpers"},{"id":16,"kind":1,"name":"\"index\"","url":"modules/_index_.html","classes":"tsd-kind-external-module"},{"id":17,"kind":256,"name":"KeyModificationItem","url":"interfaces/_index_.keymodificationitem.html","classes":"tsd-kind-interface tsd-parent-kind-external-module","parent":"\"index\""},{"id":18,"kind":1024,"name":"is_delete","url":"interfaces/_index_.keymodificationitem.html#is_delete","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"index\".KeyModificationItem"},{"id":19,"kind":1024,"name":"value","url":"interfaces/_index_.keymodificationitem.html#value","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"index\".KeyModificationItem"},{"id":20,"kind":1024,"name":"timestamp","url":"interfaces/_index_.keymodificationitem.html#timestamp","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"index\".KeyModificationItem"},{"id":21,"kind":1024,"name":"tx_id","url":"interfaces/_index_.keymodificationitem.html#tx_id","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"index\".KeyModificationItem"},{"id":22,"kind":1,"name":"\"utils/datatransform\"","url":"modules/_utils_datatransform_.html","classes":"tsd-kind-external-module"},{"id":23,"kind":128,"name":"Transform","url":"classes/_utils_datatransform_.transform.html","classes":"tsd-kind-class tsd-parent-kind-external-module","parent":"\"utils/datatransform\""},{"id":24,"kind":2048,"name":"serialize","url":"classes/_utils_datatransform_.transform.html#serialize","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"\"utils/datatransform\".Transform"},{"id":25,"kind":2048,"name":"bufferToObject","url":"classes/_utils_datatransform_.transform.html#buffertoobject","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"\"utils/datatransform\".Transform"},{"id":26,"kind":2048,"name":"bufferToDate","url":"classes/_utils_datatransform_.transform.html#buffertodate","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"\"utils/datatransform\".Transform"},{"id":27,"kind":2048,"name":"bufferToString","url":"classes/_utils_datatransform_.transform.html#buffertostring","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"\"utils/datatransform\".Transform"},{"id":28,"kind":2048,"name":"iteratorToList","url":"classes/_utils_datatransform_.transform.html#iteratortolist","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"\"utils/datatransform\".Transform"},{"id":29,"kind":2048,"name":"iteratorToKVList","url":"classes/_utils_datatransform_.transform.html#iteratortokvlist","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"\"utils/datatransform\".Transform"},{"id":30,"kind":2048,"name":"iteratorToHistoryList","url":"classes/_utils_datatransform_.transform.html#iteratortohistorylist","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"\"utils/datatransform\".Transform"},{"id":31,"kind":2048,"name":"normalizePayload","url":"classes/_utils_datatransform_.transform.html#normalizepayload","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-static","parent":"\"utils/datatransform\".Transform"},{"id":32,"kind":1,"name":"\"MockProtoTimestamp\"","url":"modules/_mockprototimestamp_.html","classes":"tsd-kind-external-module"},{"id":33,"kind":128,"name":"MockProtoTimestamp","url":"classes/_mockprototimestamp_.mockprototimestamp.html","classes":"tsd-kind-class tsd-parent-kind-external-module","parent":"\"MockProtoTimestamp\""},{"id":34,"kind":1024,"name":"seconds","url":"classes/_mockprototimestamp_.mockprototimestamp.html#seconds","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":35,"kind":1024,"name":"nanos","url":"classes/_mockprototimestamp_.mockprototimestamp.html#nanos","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":36,"kind":512,"name":"constructor","url":"classes/_mockprototimestamp_.mockprototimestamp.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":37,"kind":2048,"name":"getSeconds","url":"classes/_mockprototimestamp_.mockprototimestamp.html#getseconds","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-overwrite","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":38,"kind":2048,"name":"toDate","url":"classes/_mockprototimestamp_.mockprototimestamp.html#todate","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-overwrite","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":39,"kind":2048,"name":"setSeconds","url":"classes/_mockprototimestamp_.mockprototimestamp.html#setseconds","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":40,"kind":2048,"name":"getNanos","url":"classes/_mockprototimestamp_.mockprototimestamp.html#getnanos","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":41,"kind":2048,"name":"setNanos","url":"classes/_mockprototimestamp_.mockprototimestamp.html#setnanos","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":42,"kind":2048,"name":"fromDate","url":"classes/_mockprototimestamp_.mockprototimestamp.html#fromdate","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":43,"kind":2048,"name":"serializeBinary","url":"classes/_mockprototimestamp_.mockprototimestamp.html#serializebinary","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-overwrite tsd-is-inherited","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":44,"kind":2048,"name":"toObject","url":"classes/_mockprototimestamp_.mockprototimestamp.html#toobject","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-overwrite tsd-is-inherited","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":45,"kind":2048,"name":"toObject","url":"classes/_mockprototimestamp_.mockprototimestamp.html#toobject-1","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-overwrite tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":46,"kind":1024,"name":"extensions","url":"classes/_mockprototimestamp_.mockprototimestamp.html#extensions","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-overwrite tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":47,"kind":65536,"name":"__type","url":"classes/_mockprototimestamp_.mockprototimestamp.html#extensions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported","parent":"\"MockProtoTimestamp\".MockProtoTimestamp.extensions"},{"id":48,"kind":1024,"name":"extensionsBinary","url":"classes/_mockprototimestamp_.mockprototimestamp.html#extensionsbinary","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-overwrite tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":49,"kind":65536,"name":"__type","url":"classes/_mockprototimestamp_.mockprototimestamp.html#extensionsbinary.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported","parent":"\"MockProtoTimestamp\".MockProtoTimestamp.extensionsBinary"},{"id":50,"kind":2048,"name":"serializeBinaryToWriter","url":"classes/_mockprototimestamp_.mockprototimestamp.html#serializebinarytowriter","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-overwrite tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":51,"kind":2048,"name":"deserializeBinary","url":"classes/_mockprototimestamp_.mockprototimestamp.html#deserializebinary","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-overwrite tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":52,"kind":2048,"name":"deserializeBinaryFromReader","url":"classes/_mockprototimestamp_.mockprototimestamp.html#deserializebinaryfromreader","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-overwrite tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":53,"kind":2048,"name":"getJsPbMessageId","url":"classes/_mockprototimestamp_.mockprototimestamp.html#getjspbmessageid","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":54,"kind":2048,"name":"initialize","url":"classes/_mockprototimestamp_.mockprototimestamp.html#initialize","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":55,"kind":2048,"name":"toObjectList","url":"classes/_mockprototimestamp_.mockprototimestamp.html#toobjectlist","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":56,"kind":2048,"name":"toObjectExtension","url":"classes/_mockprototimestamp_.mockprototimestamp.html#toobjectextension","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":57,"kind":2048,"name":"serializeBinaryExtensions","url":"classes/_mockprototimestamp_.mockprototimestamp.html#serializebinaryextensions","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":58,"kind":2048,"name":"readBinaryExtension","url":"classes/_mockprototimestamp_.mockprototimestamp.html#readbinaryextension","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":59,"kind":2048,"name":"getField","url":"classes/_mockprototimestamp_.mockprototimestamp.html#getfield","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":60,"kind":2048,"name":"getOptionalFloatingPointField","url":"classes/_mockprototimestamp_.mockprototimestamp.html#getoptionalfloatingpointfield","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":61,"kind":2048,"name":"getRepeatedFloatingPointField","url":"classes/_mockprototimestamp_.mockprototimestamp.html#getrepeatedfloatingpointfield","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":62,"kind":2048,"name":"bytesAsB64","url":"classes/_mockprototimestamp_.mockprototimestamp.html#bytesasb64","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":63,"kind":2048,"name":"bytesAsU8","url":"classes/_mockprototimestamp_.mockprototimestamp.html#bytesasu8","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":64,"kind":2048,"name":"bytesListAsB64","url":"classes/_mockprototimestamp_.mockprototimestamp.html#byteslistasb64","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":65,"kind":2048,"name":"bytesListAsU8","url":"classes/_mockprototimestamp_.mockprototimestamp.html#byteslistasu8","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":66,"kind":2048,"name":"getFieldWithDefault","url":"classes/_mockprototimestamp_.mockprototimestamp.html#getfieldwithdefault","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":67,"kind":2048,"name":"getMapField","url":"classes/_mockprototimestamp_.mockprototimestamp.html#getmapfield","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":68,"kind":2048,"name":"setField","url":"classes/_mockprototimestamp_.mockprototimestamp.html#setfield","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":69,"kind":2048,"name":"addToRepeatedField","url":"classes/_mockprototimestamp_.mockprototimestamp.html#addtorepeatedfield","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":70,"kind":2048,"name":"setOneofField","url":"classes/_mockprototimestamp_.mockprototimestamp.html#setoneoffield","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":71,"kind":2048,"name":"computeOneofCase","url":"classes/_mockprototimestamp_.mockprototimestamp.html#computeoneofcase","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":72,"kind":2048,"name":"getWrapperField","url":"classes/_mockprototimestamp_.mockprototimestamp.html#getwrapperfield","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":73,"kind":2048,"name":"getRepeatedWrapperField","url":"classes/_mockprototimestamp_.mockprototimestamp.html#getrepeatedwrapperfield","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":74,"kind":2048,"name":"setWrapperField","url":"classes/_mockprototimestamp_.mockprototimestamp.html#setwrapperfield","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":75,"kind":2048,"name":"setOneofWrapperField","url":"classes/_mockprototimestamp_.mockprototimestamp.html#setoneofwrapperfield","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":76,"kind":2048,"name":"setRepeatedWrapperField","url":"classes/_mockprototimestamp_.mockprototimestamp.html#setrepeatedwrapperfield","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":77,"kind":2048,"name":"addToRepeatedWrapperField","url":"classes/_mockprototimestamp_.mockprototimestamp.html#addtorepeatedwrapperfield","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":78,"kind":2048,"name":"toMap","url":"classes/_mockprototimestamp_.mockprototimestamp.html#tomap","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":79,"kind":2048,"name":"toArray","url":"classes/_mockprototimestamp_.mockprototimestamp.html#toarray","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":80,"kind":2048,"name":"toString","url":"classes/_mockprototimestamp_.mockprototimestamp.html#tostring","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":81,"kind":2048,"name":"getExtension","url":"classes/_mockprototimestamp_.mockprototimestamp.html#getextension","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":82,"kind":2048,"name":"setExtension","url":"classes/_mockprototimestamp_.mockprototimestamp.html#setextension","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":83,"kind":2048,"name":"difference","url":"classes/_mockprototimestamp_.mockprototimestamp.html#difference","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":84,"kind":2048,"name":"equals","url":"classes/_mockprototimestamp_.mockprototimestamp.html#equals","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":85,"kind":2048,"name":"compareExtensions","url":"classes/_mockprototimestamp_.mockprototimestamp.html#compareextensions","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":86,"kind":2048,"name":"compareFields","url":"classes/_mockprototimestamp_.mockprototimestamp.html#comparefields","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":87,"kind":2048,"name":"cloneMessage","url":"classes/_mockprototimestamp_.mockprototimestamp.html#clonemessage","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":88,"kind":2048,"name":"clone","url":"classes/_mockprototimestamp_.mockprototimestamp.html#clone","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":89,"kind":2048,"name":"clone","url":"classes/_mockprototimestamp_.mockprototimestamp.html#clone-1","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":90,"kind":2048,"name":"cloneMessage","url":"classes/_mockprototimestamp_.mockprototimestamp.html#clonemessage-1","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":91,"kind":2048,"name":"copyInto","url":"classes/_mockprototimestamp_.mockprototimestamp.html#copyinto","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":92,"kind":2048,"name":"registerMessageType","url":"classes/_mockprototimestamp_.mockprototimestamp.html#registermessagetype","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":93,"kind":2,"name":"Timestamp","url":"modules/_mockprototimestamp_.mockprototimestamp.timestamp.html","classes":"tsd-kind-module tsd-parent-kind-class","parent":"\"MockProtoTimestamp\".MockProtoTimestamp"},{"id":94,"kind":4194304,"name":"AsObject","url":"modules/_mockprototimestamp_.mockprototimestamp.timestamp.html#asobject","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"MockProtoTimestamp\".MockProtoTimestamp.Timestamp"},{"id":95,"kind":65536,"name":"__type","url":"modules/_mockprototimestamp_.mockprototimestamp.timestamp.html#asobject.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias tsd-is-not-exported","parent":"\"MockProtoTimestamp\".MockProtoTimestamp.Timestamp.AsObject"},{"id":96,"kind":32,"name":"seconds","url":"modules/_mockprototimestamp_.mockprototimestamp.timestamp.html#asobject.__type.seconds","classes":"tsd-kind-variable tsd-parent-kind-type-literal tsd-is-not-exported","parent":"\"MockProtoTimestamp\".MockProtoTimestamp.Timestamp.AsObject.__type"},{"id":97,"kind":32,"name":"nanos","url":"modules/_mockprototimestamp_.mockprototimestamp.timestamp.html#asobject.__type.nanos","classes":"tsd-kind-variable tsd-parent-kind-type-literal tsd-is-not-exported","parent":"\"MockProtoTimestamp\".MockProtoTimestamp.Timestamp.AsObject.__type"},{"id":98,"kind":1,"name":"\"MockHistoryQueryIterator\"","url":"modules/_mockhistoryqueryiterator_.html","classes":"tsd-kind-external-module"},{"id":99,"kind":1,"name":"\"ChaincodeMockStub\"","url":"modules/_chaincodemockstub_.html","classes":"tsd-kind-external-module"},{"id":100,"kind":128,"name":"ChaincodeMockStub","url":"classes/_chaincodemockstub_.chaincodemockstub.html","classes":"tsd-kind-class tsd-parent-kind-external-module","parent":"\"ChaincodeMockStub\""},{"id":101,"kind":1024,"name":"state","url":"classes/_chaincodemockstub_.chaincodemockstub.html#state","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":102,"kind":1024,"name":"event","url":"classes/_chaincodemockstub_.chaincodemockstub.html#event","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":103,"kind":1024,"name":"history","url":"classes/_chaincodemockstub_.chaincodemockstub.html#history","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":104,"kind":512,"name":"constructor","url":"classes/_chaincodemockstub_.chaincodemockstub.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":105,"kind":2048,"name":"getTxID","url":"classes/_chaincodemockstub_.chaincodemockstub.html#gettxid","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":106,"kind":2048,"name":"getArgs","url":"classes/_chaincodemockstub_.chaincodemockstub.html#getargs","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":107,"kind":2048,"name":"getStringArgs","url":"classes/_chaincodemockstub_.chaincodemockstub.html#getstringargs","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":108,"kind":2048,"name":"getFunctionAndParameters","url":"classes/_chaincodemockstub_.chaincodemockstub.html#getfunctionandparameters","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":109,"kind":2048,"name":"mockTransactionStart","url":"classes/_chaincodemockstub_.chaincodemockstub.html#mocktransactionstart","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":110,"kind":2048,"name":"mockTransactionEnd","url":"classes/_chaincodemockstub_.chaincodemockstub.html#mocktransactionend","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":111,"kind":2048,"name":"mockPeerChaincode","url":"classes/_chaincodemockstub_.chaincodemockstub.html#mockpeerchaincode","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":112,"kind":2048,"name":"mockInit","url":"classes/_chaincodemockstub_.chaincodemockstub.html#mockinit","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":113,"kind":2048,"name":"mockInvoke","url":"classes/_chaincodemockstub_.chaincodemockstub.html#mockinvoke","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":114,"kind":2048,"name":"invokeChaincode","url":"classes/_chaincodemockstub_.chaincodemockstub.html#invokechaincode","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":115,"kind":2048,"name":"mockInvokeWithSignedProposal","url":"classes/_chaincodemockstub_.chaincodemockstub.html#mockinvokewithsignedproposal","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":116,"kind":2048,"name":"getState","url":"classes/_chaincodemockstub_.chaincodemockstub.html#getstate","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":117,"kind":2048,"name":"putState","url":"classes/_chaincodemockstub_.chaincodemockstub.html#putstate","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":118,"kind":2048,"name":"deleteState","url":"classes/_chaincodemockstub_.chaincodemockstub.html#deletestate","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":119,"kind":2048,"name":"getStateByRange","url":"classes/_chaincodemockstub_.chaincodemockstub.html#getstatebyrange","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":120,"kind":2048,"name":"getQueryResult","url":"classes/_chaincodemockstub_.chaincodemockstub.html#getqueryresult","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":121,"kind":2048,"name":"getStateByPartialCompositeKey","url":"classes/_chaincodemockstub_.chaincodemockstub.html#getstatebypartialcompositekey","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":122,"kind":2048,"name":"createCompositeKey","url":"classes/_chaincodemockstub_.chaincodemockstub.html#createcompositekey","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":123,"kind":2048,"name":"splitCompositeKey","url":"classes/_chaincodemockstub_.chaincodemockstub.html#splitcompositekey","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":124,"kind":2048,"name":"getSignedProposal","url":"classes/_chaincodemockstub_.chaincodemockstub.html#getsignedproposal","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":125,"kind":2048,"name":"setSignedProposal","url":"classes/_chaincodemockstub_.chaincodemockstub.html#setsignedproposal","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":126,"kind":2048,"name":"setTxTimestamp","url":"classes/_chaincodemockstub_.chaincodemockstub.html#settxtimestamp","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":127,"kind":2048,"name":"getTxTimestamp","url":"classes/_chaincodemockstub_.chaincodemockstub.html#gettxtimestamp","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":128,"kind":2048,"name":"getCreator","url":"classes/_chaincodemockstub_.chaincodemockstub.html#getcreator","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":129,"kind":2048,"name":"getHistoryForKey","url":"classes/_chaincodemockstub_.chaincodemockstub.html#gethistoryforkey","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":130,"kind":2048,"name":"getBinding","url":"classes/_chaincodemockstub_.chaincodemockstub.html#getbinding","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":131,"kind":2048,"name":"getTransient","url":"classes/_chaincodemockstub_.chaincodemockstub.html#gettransient","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":132,"kind":2048,"name":"setEvent","url":"classes/_chaincodemockstub_.chaincodemockstub.html#setevent","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":133,"kind":2048,"name":"getEvent","url":"classes/_chaincodemockstub_.chaincodemockstub.html#getevent","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":134,"kind":2048,"name":"getChannelID","url":"classes/_chaincodemockstub_.chaincodemockstub.html#getchannelid","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"ChaincodeMockStub\".ChaincodeMockStub"},{"id":135,"kind":32,"name":"defaultUserCert","url":"modules/_chaincodemockstub_.html#defaultusercert","classes":"tsd-kind-variable tsd-parent-kind-external-module tsd-is-not-exported","parent":"\"ChaincodeMockStub\""},{"id":136,"kind":1,"name":"\"constants/errors\"","url":"modules/_constants_errors_.html","classes":"tsd-kind-external-module"}]}; |
{ | ||
"name": "@theledger/fabric-mock-stub", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "Mock implementation of the hyperledger fabric-shim package for testing", | ||
@@ -27,3 +27,3 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@theledger/fabric-shim-types": "https://github.com/wearetheledger/fabric-shim-types", | ||
"@theledger/fabric-shim-types": "^1.0.5", | ||
"@types/chai": "^4.0.4", | ||
@@ -30,0 +30,0 @@ "@types/mocha": "^2.2.43", |
@@ -17,3 +17,3 @@ [![Build Status](https://travis-ci.org/wearetheledger/fabric-mock-stub.svg?branch=master)](https://travis-ci.org/wearetheledger/fabric-mock-stub) | ||
## Installation | ||
## Installation | ||
```sh | ||
@@ -34,3 +34,3 @@ yarn add @theledger/fabric-mock-stub --dev | ||
### ChaincodeMockStub [View definition](https://wearetheledger.github.io/fabric-mock-stub/classes/_chaincodemockstub_.chaincodemockstub.html) | ||
This ChaincodeMockStub is a Mock implementation of the fabric-shim stub. This means you can test your chaincode without actually starting your network. | ||
This ChaincodeMockStub is a Mock implementation of the fabric-shim stub. This means you can test your chaincode without actually starting your network. | ||
@@ -43,3 +43,2 @@ Examples are located at [examples/tests](examples/tests) | ||
- getTransient | ||
- setEvent | ||
- getChannelID | ||
@@ -153,3 +152,3 @@ | ||
const mockStub = new ChaincodeMockStub("MyMockStub", chaincode); | ||
const response = await mockStub.mockInvoke("tx2", ['queryCar', `CAR0`]); | ||
@@ -202,3 +201,3 @@ | ||
#### Testing using Mychaincode directly | ||
A remark when using this, depending what you return in your function, you will be able to recieve a Buffer or an object in your tests. This is discussed in [chaincode](#writing-chaincode) | ||
A remark when using this, depending what you return in your function, you will be able to receive a Buffer or an object in your tests. This is discussed in [chaincode](#writing-chaincode) | ||
```javascript | ||
@@ -232,3 +231,6 @@ import { MyChaincode } from '../<path_to_your_chaincode_class>'; | ||
#### Testing using ChaincodeMockStub directly ๐คจ | ||
You can do this, but you shouldn't. Your logic should be written in your functions, not your tests. | ||
You can do this, but you shouldn't. Your logic should be written in your functions, not your tests. | ||
##### Test query results | ||
```javascript | ||
@@ -263,4 +265,18 @@ import { MyChaincode } from '../<path_to_your_chaincode_class>'; | ||
##### Test emitted events | ||
```javascript | ||
it("Should get the emitted event", async () => { | ||
const mockStub = new ChaincodeMockStub("MyMockStub", chaincode); | ||
await mockStub.mockInvoke("tx1", ['createCar', `CAR0`, `prop1`, `prop2`, `prop3`, `owner`]); | ||
const eventPayload = await mockStub.getEvent('CREATE_CAR'); | ||
expect(eventPayload).to.equal('Car created.'); | ||
}); | ||
``` | ||
## Contributing | ||
1. Fork it! ๐ด | ||
@@ -267,0 +283,0 @@ 2. Create your feature branch: `git checkout -b my-new-feature` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
970568
72
2776
297