dash-platform-sdk 1.1.5 → 1.1.7
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.
package/package.json
CHANGED
|
@@ -66,7 +66,7 @@ function getByIdentifier(grpcPool, identifier) {
|
|
|
66
66
|
if (metadata == null) {
|
|
67
67
|
throw new Error('Metadata not found');
|
|
68
68
|
}
|
|
69
|
-
_b = (0, wasm_drive_verify_1.verifyContract)(proof.grovedbProof, undefined,
|
|
69
|
+
_b = (0, wasm_drive_verify_1.verifyContract)(proof.grovedbProof, undefined, false, false, id.bytes(), 9), rootHash = _b.root_hash, contract = _b.contract;
|
|
70
70
|
if (contract == null) {
|
|
71
71
|
throw new Error("Data Contract with identifier ".concat(id.base58(), " not found"));
|
|
72
72
|
}
|
package/src/node/status.js
CHANGED
|
@@ -38,17 +38,18 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.default = status;
|
|
40
40
|
var platform_1 = require("../../proto/generated/platform");
|
|
41
|
+
var bytesToHex_1 = require("../utils/bytesToHex");
|
|
41
42
|
function status(grpcPool) {
|
|
42
43
|
return __awaiter(this, void 0, void 0, function () {
|
|
43
44
|
var getStatusRequest, response, v0;
|
|
44
|
-
var _a, _b, _c, _d, _e;
|
|
45
|
-
return __generator(this, function (
|
|
46
|
-
switch (
|
|
45
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
46
|
+
return __generator(this, function (_j) {
|
|
47
|
+
switch (_j.label) {
|
|
47
48
|
case 0:
|
|
48
49
|
getStatusRequest = platform_1.GetStatusRequest.fromPartial({ v0: {} });
|
|
49
50
|
return [4 /*yield*/, grpcPool.getClient().getStatus(getStatusRequest)];
|
|
50
51
|
case 1:
|
|
51
|
-
response =
|
|
52
|
+
response = _j.sent();
|
|
52
53
|
v0 = response.v0;
|
|
53
54
|
if (v0 == null) {
|
|
54
55
|
throw new Error('Unable to get node status');
|
|
@@ -56,8 +57,8 @@ function status(grpcPool) {
|
|
|
56
57
|
return [2 /*return*/, {
|
|
57
58
|
node: (v0.node != null)
|
|
58
59
|
? {
|
|
59
|
-
id: v0.node.id
|
|
60
|
-
proTxHash:
|
|
60
|
+
id: (0, bytesToHex_1.default)(v0.node.id),
|
|
61
|
+
proTxHash: v0.node.proTxHash != null ? (0, bytesToHex_1.default)(v0.node.proTxHash) : undefined
|
|
61
62
|
}
|
|
62
63
|
: undefined,
|
|
63
64
|
chain: (v0.chain != null)
|
|
@@ -67,10 +68,10 @@ function status(grpcPool) {
|
|
|
67
68
|
earliestBlockHeight: v0.chain.earliestBlockHeight,
|
|
68
69
|
maxPeerBlockHeight: v0.chain.maxPeerBlockHeight,
|
|
69
70
|
coreChainLockedHeight: v0.chain.coreChainLockedHeight,
|
|
70
|
-
latestBlockHash: (
|
|
71
|
-
latestAppHash: (_c = v0.chain) === null || _c === void 0 ? void 0 : _c.latestAppHash
|
|
72
|
-
earliestBlockHash: (
|
|
73
|
-
earliestAppHash: (
|
|
71
|
+
latestBlockHash: ((_a = v0.chain) === null || _a === void 0 ? void 0 : _a.latestBlockHash) != null ? (0, bytesToHex_1.default)((_b = v0.chain) === null || _b === void 0 ? void 0 : _b.latestBlockHash) : '',
|
|
72
|
+
latestAppHash: ((_c = v0.chain) === null || _c === void 0 ? void 0 : _c.latestAppHash) != null ? (0, bytesToHex_1.default)((_d = v0.chain) === null || _d === void 0 ? void 0 : _d.latestAppHash) : '',
|
|
73
|
+
earliestBlockHash: ((_e = v0.chain) === null || _e === void 0 ? void 0 : _e.earliestBlockHash) != null ? (0, bytesToHex_1.default)((_f = v0.chain) === null || _f === void 0 ? void 0 : _f.earliestBlockHash) : '',
|
|
74
|
+
earliestAppHash: ((_g = v0.chain) === null || _g === void 0 ? void 0 : _g.earliestAppHash) != null ? (0, bytesToHex_1.default)((_h = v0.chain) === null || _h === void 0 ? void 0 : _h.earliestAppHash) : ''
|
|
74
75
|
}
|
|
75
76
|
: undefined,
|
|
76
77
|
version: v0.version,
|
|
@@ -80,23 +80,26 @@ describe('DataContract', function () {
|
|
|
80
80
|
var dataContract;
|
|
81
81
|
return __generator(this, function (_a) {
|
|
82
82
|
switch (_a.label) {
|
|
83
|
-
case 0: return [4 /*yield*/, sdk.dataContracts.getDataContractByIdentifier('GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec')
|
|
84
|
-
// User Data Contract
|
|
85
|
-
];
|
|
83
|
+
case 0: return [4 /*yield*/, sdk.dataContracts.getDataContractByIdentifier('GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec')];
|
|
86
84
|
case 1:
|
|
87
85
|
// System Data Contract
|
|
88
86
|
dataContract = _a.sent();
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
];
|
|
87
|
+
expect(dataContract).toEqual(expect.any(pshenmic_dpp_1.DataContractWASM));
|
|
88
|
+
return [4 /*yield*/, sdk.dataContracts.getDataContractByIdentifier('Aukz296s36am6wKStoMbxm4YhC6kTpu3mERVrC7vHokP')];
|
|
92
89
|
case 2:
|
|
93
90
|
// User Data Contract
|
|
94
91
|
dataContract = _a.sent();
|
|
92
|
+
expect(dataContract).toEqual(expect.any(pshenmic_dpp_1.DataContractWASM));
|
|
95
93
|
return [4 /*yield*/, sdk.dataContracts.getDataContractByIdentifier('DrEhmVJz56ukHbaFt8xLVRasnNWsrx3x8dGtcu9xg6rV')];
|
|
96
94
|
case 3:
|
|
97
95
|
// User Data Contract with keep history
|
|
98
96
|
dataContract = _a.sent();
|
|
99
97
|
expect(dataContract).toEqual(expect.any(pshenmic_dpp_1.DataContractWASM));
|
|
98
|
+
return [4 /*yield*/, sdk.dataContracts.getDataContractByIdentifier('3XtMFe9UPf75DAcLmLsX9CLTrLPNysNPMcnWCE1C39vm')];
|
|
99
|
+
case 4:
|
|
100
|
+
// Token Data Contract
|
|
101
|
+
dataContract = _a.sent();
|
|
102
|
+
expect(dataContract).toEqual(expect.any(pshenmic_dpp_1.DataContractWASM));
|
|
100
103
|
return [2 /*return*/];
|
|
101
104
|
}
|
|
102
105
|
});
|