@apex-pub/convector-adapter-fabric-in-chaincode 1.4.1-4-alpha.8d3ff686 → 1.4.1-4-alpha.4ece38f3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,35 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InChaincodeAdapter = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const convector_core_1 = require("@apex-pub/convector-core");
|
|
6
|
+
class InChaincodeAdapter {
|
|
7
|
+
invoke(controller, name, config = {}, ...args) {
|
|
8
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
9
|
+
return this.rawInvoke(`${controller}_${name}`, config, ...args);
|
|
10
|
+
});
|
|
5
11
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
};
|
|
12
|
+
rawInvoke(fn, config = {}, ...args) {
|
|
13
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
14
|
+
if (!config.tx) {
|
|
15
|
+
throw new Error('InChaincodeAdapter needs the ChaincodeTx in config');
|
|
16
|
+
}
|
|
17
|
+
if (!config.chaincode) {
|
|
18
|
+
throw new Error('InChaincodeAdapter needs a stub in config');
|
|
19
|
+
}
|
|
20
|
+
const stub = config.tx.stub.getStub();
|
|
21
|
+
let beforeTx = stub.constructor.name === 'ChaincodeMockStub' ? {
|
|
22
|
+
signedProposal: stub.signedProposal,
|
|
23
|
+
txID: stub.txID,
|
|
24
|
+
transientMap: stub.transientMap,
|
|
25
|
+
args: stub.args
|
|
26
|
+
} : {};
|
|
27
|
+
const res = yield stub.invokeChaincode(config.chaincode, [fn, ...args], config.channel);
|
|
28
|
+
const storage = convector_core_1.BaseStorage.current;
|
|
29
|
+
storage.stubHelper = config.tx.stub;
|
|
30
|
+
Object.assign(stub, beforeTx);
|
|
31
|
+
if (res.status === 500) {
|
|
32
|
+
const rawMessage = res.message.toString();
|
|
33
|
+
throw rawMessage ? JSON.parse(rawMessage) : res;
|
|
34
|
+
}
|
|
35
|
+
const rawResult = res.payload.toString();
|
|
36
|
+
return Object.assign(Object.assign({}, res), { result: rawResult ? JSON.parse(rawResult) : undefined });
|
|
37
|
+
});
|
|
33
38
|
}
|
|
34
39
|
}
|
|
40
|
+
exports.InChaincodeAdapter = InChaincodeAdapter;
|
|
35
41
|
//# sourceMappingURL=fabric-in-chaincode.controller-adapter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fabric-in-chaincode.controller-adapter.js","sourceRoot":"","sources":["../../src/fabric-in-chaincode.controller-adapter.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"fabric-in-chaincode.controller-adapter.js","sourceRoot":"","sources":["../../src/fabric-in-chaincode.controller-adapter.ts"],"names":[],"mappings":";;;;AAEA,6DAA0E;AAQ1E,MAAa,kBAAkB;IAEhB,MAAM,CAAC,UAAkB,EAAE,IAAY,EAAE,SAAmC,EAAE,EAAE,GAAG,IAAW;;YACzG,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,UAAU,IAAI,IAAI,EAAE,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC;QAClE,CAAC;KAAA;IAEY,SAAS,CAAC,EAAU,EAAE,SAAmC,EAAE,EAAE,GAAG,IAAW;;YACtF,IAAI,CAAC,MAAM,CAAC,EAAE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AC,CAAC,CAAC,CAAC,SAAS,IACrD;QACJ,CAAC;KAAA;CACF;AA3CD,gDA2CC"}
|
package/dist/src/index.js
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./fabric-in-chaincode.controller-adapter"), exports);
|
|
2
5
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,mFAAyD"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apex-pub/convector-adapter-fabric-in-chaincode",
|
|
3
|
-
"version": "1.4.1-4-alpha.
|
|
3
|
+
"version": "1.4.1-4-alpha.4ece38f3",
|
|
4
4
|
"description": "Controller adapter to inside chaincode transactions to invoke another chaincode",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
|
-
"type": "module",
|
|
7
6
|
"repository": {
|
|
8
7
|
"type": "git",
|
|
9
8
|
"url": "https://github.com/hyperledger-labs/convector/tree/develop/%40worldsibu/convector-adapter-fabric"
|
|
@@ -46,11 +45,11 @@
|
|
|
46
45
|
"fabric-client": "1.4.20"
|
|
47
46
|
},
|
|
48
47
|
"dependencies": {
|
|
49
|
-
"@apex-pub/convector-core": "1.4.1-4-alpha.
|
|
50
|
-
"@apex-pub/convector-core-chaincode": "1.4.1-4-alpha.
|
|
51
|
-
"@apex-pub/convector-storage-stub": "1.4.1-4-alpha.
|
|
48
|
+
"@apex-pub/convector-core": "1.4.1-4-alpha.4ece38f3",
|
|
49
|
+
"@apex-pub/convector-core-chaincode": "1.4.1-4-alpha.4ece38f3",
|
|
50
|
+
"@apex-pub/convector-storage-stub": "1.4.1-4-alpha.4ece38f3"
|
|
52
51
|
},
|
|
53
52
|
"devDependencies": {
|
|
54
|
-
"@apex-pub/convector-adapter-mock": "1.4.1-4-alpha.
|
|
53
|
+
"@apex-pub/convector-adapter-mock": "1.4.1-4-alpha.4ece38f3"
|
|
55
54
|
}
|
|
56
55
|
}
|