diff --git a/.pnp.cjs b/.pnp.cjs index c1f40457d98..9afeeb83fbc 100755 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -2561,7 +2561,7 @@ const RAW_RUNTIME_STATE = ["@dashevo/dapi-client", "workspace:packages/js-dapi-client"],\ ["@dashevo/dapi-grpc", "workspace:packages/dapi-grpc"],\ ["@dashevo/dashcore-lib", "npm:0.22.0"],\ - ["@dashevo/dashd-rpc", "npm:19.0.0"],\ + ["@dashevo/dashd-rpc", "npm:19.1.0"],\ ["@dashevo/dp-services-ctl", "https://github.com/dashevo/js-dp-services-ctl.git#commit=3976076b0018c5b4632ceda4c752fc597f27a640"],\ ["@dashevo/grpc-common", "workspace:packages/js-grpc-common"],\ ["@dashevo/wasm-dpp", "workspace:packages/wasm-dpp"],\ @@ -2732,10 +2732,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@dashevo/dashd-rpc", [\ - ["npm:19.0.0", {\ - "packageLocation": "./.yarn/cache/@dashevo-dashd-rpc-npm-19.0.0-54bb2a5dfc-2eab84af3e.zip/node_modules/@dashevo/dashd-rpc/",\ + ["npm:19.1.0", {\ + "packageLocation": "./.yarn/cache/@dashevo-dashd-rpc-npm-19.1.0-9dfdfd28d7-5d3ebf1f0b.zip/node_modules/@dashevo/dashd-rpc/",\ "packageDependencies": [\ - ["@dashevo/dashd-rpc", "npm:19.0.0"],\ + ["@dashevo/dashd-rpc", "npm:19.1.0"],\ ["async", "npm:3.2.4"],\ ["bluebird", "npm:3.7.2"]\ ],\ @@ -9702,7 +9702,7 @@ const RAW_RUNTIME_STATE = ["@dashevo/bls", "npm:1.2.9"],\ ["@dashevo/dapi-client", "workspace:packages/js-dapi-client"],\ ["@dashevo/dashcore-lib", "npm:0.22.0"],\ - ["@dashevo/dashd-rpc", "npm:19.0.0"],\ + ["@dashevo/dashd-rpc", "npm:19.1.0"],\ ["@dashevo/docker-compose", "npm:0.24.4"],\ ["@dashevo/wallet-lib", "workspace:packages/wallet-lib"],\ ["@dashevo/withdrawals-contract", "workspace:packages/withdrawals-contract"],\ diff --git a/.yarn/cache/@dashevo-dashd-rpc-npm-19.0.0-54bb2a5dfc-2eab84af3e.zip b/.yarn/cache/@dashevo-dashd-rpc-npm-19.0.0-54bb2a5dfc-2eab84af3e.zip deleted file mode 100644 index 6ad3f917538..00000000000 Binary files a/.yarn/cache/@dashevo-dashd-rpc-npm-19.0.0-54bb2a5dfc-2eab84af3e.zip and /dev/null differ diff --git a/.yarn/cache/@dashevo-dashd-rpc-npm-19.1.0-9dfdfd28d7-5d3ebf1f0b.zip b/.yarn/cache/@dashevo-dashd-rpc-npm-19.1.0-9dfdfd28d7-5d3ebf1f0b.zip new file mode 100644 index 00000000000..8c470f8b74e Binary files /dev/null and b/.yarn/cache/@dashevo-dashd-rpc-npm-19.1.0-9dfdfd28d7-5d3ebf1f0b.zip differ diff --git a/packages/dapi/package.json b/packages/dapi/package.json index 6c74d064021..441296e5ce1 100644 --- a/packages/dapi/package.json +++ b/packages/dapi/package.json @@ -36,7 +36,7 @@ "@dashevo/bls": "~1.2.9", "@dashevo/dapi-grpc": "workspace:*", "@dashevo/dashcore-lib": "~0.22.0", - "@dashevo/dashd-rpc": "^19.0.0", + "@dashevo/dashd-rpc": "^19.1.0", "@dashevo/grpc-common": "workspace:*", "@dashevo/wasm-dpp": "workspace:*", "@grpc/grpc-js": "^1.14.3", diff --git a/packages/dashmate/package.json b/packages/dashmate/package.json index d0bbe0b9e49..9b07c8b640b 100644 --- a/packages/dashmate/package.json +++ b/packages/dashmate/package.json @@ -59,7 +59,7 @@ "@dashevo/bls": "~1.2.9", "@dashevo/dapi-client": "workspace:*", "@dashevo/dashcore-lib": "~0.22.0", - "@dashevo/dashd-rpc": "^19.0.0", + "@dashevo/dashd-rpc": "^19.1.0", "@dashevo/docker-compose": "^0.24.4", "@dashevo/wallet-lib": "workspace:*", "@dashevo/withdrawals-contract": "workspace:*", diff --git a/packages/dashmate/src/status/scopes/platform.js b/packages/dashmate/src/status/scopes/platform.js index b2f44b8eac3..4e3b565e197 100644 --- a/packages/dashmate/src/status/scopes/platform.js +++ b/packages/dashmate/src/status/scopes/platform.js @@ -49,11 +49,19 @@ export default function getPlatformScopeFactory( rpcClient.getBlockchainInfo(), ]); - const { - result: { - softforks: { mn_rr: mnRR }, - }, - } = blockchainInfo; + // Core v24 omits softforks from getblockchaininfo unless started with + // -deprecatedrpc=softforks and reports them in getdeploymentinfo. Core v23 has no + // getdeploymentinfo, so softforks is read first. + const deployments = blockchainInfo.result.softforks + ?? (await rpcClient.getDeploymentInfo()).result?.deployments; + + const mnRR = deployments?.mn_rr; + + // getPlatformScope reads the mn_rr deployment outside its try, so a missing or malformed + // deployment has to fail here, where it is handled as unavailable Core info. + if (typeof mnRR?.active !== 'boolean' || !Number.isInteger(mnRR.height)) { + throw new Error(`Core did not report a valid mn_rr deployment: ${JSON.stringify(mnRR)}`); + } const { result: { @@ -336,7 +344,7 @@ export default function getPlatformScopeFactory( } catch (e) { if (process.env.DEBUG) { // eslint-disable-next-line no-console - console.error('Could not get MNSync from core', e); + console.error('Could not get sync status and platform activation from Core', e); } } diff --git a/packages/dashmate/test/fixtures/coreRpc/23.1.8/getblockchaininfo-1112.json b/packages/dashmate/test/fixtures/coreRpc/23.1.8/getblockchaininfo-1112.json new file mode 100644 index 00000000000..e164a8fdffb --- /dev/null +++ b/packages/dashmate/test/fixtures/coreRpc/23.1.8/getblockchaininfo-1112.json @@ -0,0 +1,117 @@ +{ + "chain": "regtest", + "blocks": 1112, + "headers": 1112, + "bestblockhash": "0933f86094f3ded670c18238e70a8eacb06813373657d10e328dba2a31c7f6cd", + "difficulty": 4.656542373906925e-10, + "time": 1792060531, + "mediantime": 1792060530, + "verificationprogress": 1, + "initialblockdownload": false, + "chainwork": "00000000000000000000000000000000000000000000000000000000000008b2", + "size_on_disk": 802296, + "pruned": false, + "softforks": { + "bip34": { + "type": "buried", + "active": true, + "height": 1 + }, + "bip66": { + "type": "buried", + "active": true, + "height": 1 + }, + "bip65": { + "type": "buried", + "active": true, + "height": 1 + }, + "bip147": { + "type": "buried", + "active": true, + "height": 0 + }, + "csv": { + "type": "buried", + "active": true, + "height": 1 + }, + "dip0001": { + "type": "buried", + "active": true, + "height": 1 + }, + "dip0003": { + "type": "buried", + "active": true, + "height": 432 + }, + "dip0008": { + "type": "buried", + "active": true, + "height": 1 + }, + "dip0020": { + "type": "buried", + "active": true, + "height": 1 + }, + "dip0024": { + "type": "buried", + "active": true, + "height": 1 + }, + "realloc": { + "type": "buried", + "active": true, + "height": 1 + }, + "v19": { + "type": "buried", + "active": true, + "height": 1 + }, + "v20": { + "type": "buried", + "active": true, + "height": 432 + }, + "mn_rr": { + "type": "buried", + "active": true, + "height": 1000 + }, + "withdrawals": { + "type": "buried", + "active": true, + "height": 600 + }, + "v24": { + "type": "bip9", + "bip9": { + "status": "defined", + "start_time": 0, + "timeout": 9223372036854775807, + "min_activation_height": 0, + "ehf": true, + "since": 0 + }, + "active": false + }, + "testdummy": { + "type": "bip9", + "bip9": { + "status": "active", + "start_time": 0, + "timeout": 9223372036854775807, + "min_activation_height": 0, + "ehf": false, + "since": 432 + }, + "height": 432, + "active": true + } + }, + "warnings": "" +} diff --git a/packages/dashmate/test/fixtures/coreRpc/23.1.8/mnsync-status.json b/packages/dashmate/test/fixtures/coreRpc/23.1.8/mnsync-status.json new file mode 100644 index 00000000000..d587204ecbd --- /dev/null +++ b/packages/dashmate/test/fixtures/coreRpc/23.1.8/mnsync-status.json @@ -0,0 +1,8 @@ +{ + "AssetID": 999, + "AssetName": "MASTERNODE_SYNC_FINISHED", + "AssetStartTime": 1792060356, + "Attempt": 0, + "IsBlockchainSynced": true, + "IsSynced": true +} diff --git a/packages/dashmate/test/fixtures/coreRpc/24.0.0-rc.3/getblockchaininfo-1112.json b/packages/dashmate/test/fixtures/coreRpc/24.0.0-rc.3/getblockchaininfo-1112.json new file mode 100644 index 00000000000..89d4a6a9537 --- /dev/null +++ b/packages/dashmate/test/fixtures/coreRpc/24.0.0-rc.3/getblockchaininfo-1112.json @@ -0,0 +1,15 @@ +{ + "chain": "regtest", + "blocks": 1112, + "headers": 1112, + "bestblockhash": "69bf772133b0ed53979dce7927104fcc3577180137aacb283e8a282ecb86bf85", + "difficulty": 4.656542373906925e-10, + "time": 1792060432, + "mediantime": 1792060431, + "verificationprogress": 1, + "initialblockdownload": false, + "chainwork": "00000000000000000000000000000000000000000000000000000000000008b2", + "size_on_disk": 802291, + "pruned": false, + "warnings": "This is a pre-release test build - use at your own risk - do not use for mining or merchant applications" +} diff --git a/packages/dashmate/test/fixtures/coreRpc/24.0.0-rc.3/getblockchaininfo-512.json b/packages/dashmate/test/fixtures/coreRpc/24.0.0-rc.3/getblockchaininfo-512.json new file mode 100644 index 00000000000..8f30b16fc0e --- /dev/null +++ b/packages/dashmate/test/fixtures/coreRpc/24.0.0-rc.3/getblockchaininfo-512.json @@ -0,0 +1,15 @@ +{ + "chain": "regtest", + "blocks": 512, + "headers": 512, + "bestblockhash": "0883b85d67c2eaf7d5756fd174cb79e99144bcab29a56b2a122b2134203ab45d", + "difficulty": 4.656542373906925e-10, + "time": 1792060332, + "mediantime": 1792060331, + "verificationprogress": 1, + "initialblockdownload": false, + "chainwork": "0000000000000000000000000000000000000000000000000000000000000402", + "size_on_disk": 172286, + "pruned": false, + "warnings": "This is a pre-release test build - use at your own risk - do not use for mining or merchant applications" +} diff --git a/packages/dashmate/test/fixtures/coreRpc/24.0.0-rc.3/getdeploymentinfo-1112.json b/packages/dashmate/test/fixtures/coreRpc/24.0.0-rc.3/getdeploymentinfo-1112.json new file mode 100644 index 00000000000..583c7c69aa4 --- /dev/null +++ b/packages/dashmate/test/fixtures/coreRpc/24.0.0-rc.3/getdeploymentinfo-1112.json @@ -0,0 +1,121 @@ +{ + "hash": "69bf772133b0ed53979dce7927104fcc3577180137aacb283e8a282ecb86bf85", + "height": 1112, + "deployments": { + "bip34": { + "type": "buried", + "active": true, + "height": 1 + }, + "bip66": { + "type": "buried", + "active": true, + "height": 1 + }, + "bip65": { + "type": "buried", + "active": true, + "height": 1 + }, + "bip147": { + "type": "buried", + "active": true, + "height": 0 + }, + "csv": { + "type": "buried", + "active": true, + "height": 1 + }, + "dip0001": { + "type": "buried", + "active": true, + "height": 1 + }, + "dip0003": { + "type": "buried", + "active": true, + "height": 432 + }, + "dip0008": { + "type": "buried", + "active": true, + "height": 1 + }, + "dip0020": { + "type": "buried", + "active": true, + "height": 1 + }, + "dip0024": { + "type": "buried", + "active": true, + "height": 1 + }, + "realloc": { + "type": "buried", + "active": true, + "height": 1 + }, + "v19": { + "type": "buried", + "active": true, + "height": 1 + }, + "v20": { + "type": "buried", + "active": true, + "height": 432 + }, + "mn_rr": { + "type": "buried", + "active": true, + "height": 1000 + }, + "withdrawals": { + "type": "buried", + "active": true, + "height": 600 + }, + "v24": { + "type": "bip9", + "active": false, + "bip9": { + "start_time": 0, + "timeout": 9223372036854775807, + "ehf": true, + "min_activation_height": 0, + "status": "defined", + "since": 0, + "status_next": "defined" + } + }, + "evo_shares": { + "type": "bip9", + "active": false, + "bip9": { + "start_time": 0, + "timeout": 9223372036854775807, + "ehf": true, + "min_activation_height": 0, + "status": "defined", + "since": 0, + "status_next": "defined" + } + }, + "testdummy": { + "type": "bip9", + "height": 432, + "active": true, + "bip9": { + "start_time": 0, + "timeout": 9223372036854775807, + "ehf": false, + "min_activation_height": 0, + "status": "active", + "since": 432, + "status_next": "active" + } + } + } +} diff --git a/packages/dashmate/test/fixtures/coreRpc/24.0.0-rc.3/getdeploymentinfo-512.json b/packages/dashmate/test/fixtures/coreRpc/24.0.0-rc.3/getdeploymentinfo-512.json new file mode 100644 index 00000000000..5e99145c10f --- /dev/null +++ b/packages/dashmate/test/fixtures/coreRpc/24.0.0-rc.3/getdeploymentinfo-512.json @@ -0,0 +1,121 @@ +{ + "hash": "0883b85d67c2eaf7d5756fd174cb79e99144bcab29a56b2a122b2134203ab45d", + "height": 512, + "deployments": { + "bip34": { + "type": "buried", + "active": true, + "height": 1 + }, + "bip66": { + "type": "buried", + "active": true, + "height": 1 + }, + "bip65": { + "type": "buried", + "active": true, + "height": 1 + }, + "bip147": { + "type": "buried", + "active": true, + "height": 0 + }, + "csv": { + "type": "buried", + "active": true, + "height": 1 + }, + "dip0001": { + "type": "buried", + "active": true, + "height": 1 + }, + "dip0003": { + "type": "buried", + "active": true, + "height": 432 + }, + "dip0008": { + "type": "buried", + "active": true, + "height": 1 + }, + "dip0020": { + "type": "buried", + "active": true, + "height": 1 + }, + "dip0024": { + "type": "buried", + "active": true, + "height": 1 + }, + "realloc": { + "type": "buried", + "active": true, + "height": 1 + }, + "v19": { + "type": "buried", + "active": true, + "height": 1 + }, + "v20": { + "type": "buried", + "active": true, + "height": 432 + }, + "mn_rr": { + "type": "buried", + "active": false, + "height": 1000 + }, + "withdrawals": { + "type": "buried", + "active": false, + "height": 600 + }, + "v24": { + "type": "bip9", + "active": false, + "bip9": { + "start_time": 0, + "timeout": 9223372036854775807, + "ehf": true, + "min_activation_height": 0, + "status": "defined", + "since": 0, + "status_next": "defined" + } + }, + "evo_shares": { + "type": "bip9", + "active": false, + "bip9": { + "start_time": 0, + "timeout": 9223372036854775807, + "ehf": true, + "min_activation_height": 0, + "status": "defined", + "since": 0, + "status_next": "defined" + } + }, + "testdummy": { + "type": "bip9", + "height": 432, + "active": true, + "bip9": { + "start_time": 0, + "timeout": 9223372036854775807, + "ehf": false, + "min_activation_height": 0, + "status": "active", + "since": 432, + "status_next": "active" + } + } + } +} diff --git a/packages/dashmate/test/fixtures/coreRpc/24.0.0-rc.3/mnsync-status.json b/packages/dashmate/test/fixtures/coreRpc/24.0.0-rc.3/mnsync-status.json new file mode 100644 index 00000000000..4643b091c2e --- /dev/null +++ b/packages/dashmate/test/fixtures/coreRpc/24.0.0-rc.3/mnsync-status.json @@ -0,0 +1,8 @@ +{ + "AssetID": 999, + "AssetName": "MASTERNODE_SYNC_FINISHED", + "AssetStartTime": 1792060306, + "Attempt": 0, + "IsBlockchainSynced": true, + "IsSynced": true +} diff --git a/packages/dashmate/test/unit/core/createRpcClient.spec.js b/packages/dashmate/test/unit/core/createRpcClient.spec.js new file mode 100644 index 00000000000..cad7b88e2ad --- /dev/null +++ b/packages/dashmate/test/unit/core/createRpcClient.spec.js @@ -0,0 +1,42 @@ +import { EventEmitter } from 'events'; +import fs from 'fs'; +import http from 'http'; +import path from 'path'; +import { PACKAGE_ROOT_DIR } from '../../../src/constants.js'; +import createRpcClient from '../../../src/core/createRpcClient.js'; + +describe('createRpcClient', () => { + it('should call getdeploymentinfo, where Core v24 reports platform activation', async function it() { + // Recorded from Dash Core 24.0.0-rc.3 on regtest with testactivationheight=mn_rr@1000 + const deploymentInfo = JSON.parse(fs.readFileSync( + path.join(PACKAGE_ROOT_DIR, 'test/fixtures/coreRpc/24.0.0-rc.3/getdeploymentinfo-1112.json'), + 'utf8', + )); + + let requestBody = ''; + + this.sinon.stub(http, 'request').callsFake((options, callback) => { + const request = new EventEmitter(); + request.setHeader = () => {}; + request.write = (data) => { + requestBody += data; + }; + request.end = () => { + const response = new EventEmitter(); + callback(response); + response.statusCode = 200; + response.emit('data', JSON.stringify({ result: deploymentInfo, error: null, id: 1 })); + response.emit('end'); + }; + + return request; + }); + + const { result } = await createRpcClient().getDeploymentInfo(); + + const { method, params } = JSON.parse(requestBody); + expect(method).to.equal('getdeploymentinfo'); + expect(params).to.deep.equal([]); + expect(result.deployments.mn_rr).to.deep.equal({ type: 'buried', active: true, height: 1000 }); + }); +}); diff --git a/packages/dashmate/test/unit/status/scopes/platform.spec.js b/packages/dashmate/test/unit/status/scopes/platform.spec.js index b6736845298..f34ffb14188 100644 --- a/packages/dashmate/test/unit/status/scopes/platform.spec.js +++ b/packages/dashmate/test/unit/status/scopes/platform.spec.js @@ -1,3 +1,6 @@ +import fs from 'fs'; +import path from 'path'; +import { PACKAGE_ROOT_DIR } from '../../../../src/constants.js'; import ContainerIsNotPresentError from '../../../../src/docker/errors/ContainerIsNotPresentError.js'; import DockerComposeError from '../../../../src/docker/errors/DockerComposeError.js'; @@ -33,6 +36,7 @@ describe('getPlatformScopeFactory', () => { mockRpcClient = { mnsync: this.sinon.stub(), getBlockchainInfo: this.sinon.stub(), + getDeploymentInfo: this.sinon.stub(), masternode: this.sinon.stub(), }; mockDockerCompose = { @@ -746,5 +750,113 @@ describe('getPlatformScopeFactory', () => { const scope = await getPlatformScope(config); expect(scope).to.deep.equal(expectedScope); }); + + describe('platform activation', () => { + /** + * Read a Core RPC answer recorded from an official Dash Core build on regtest with + * testactivationheight=mn_rr@1000 and without -deprecatedrpc=softforks, at height 512 + * (before mn_rr) or 1112 (after it). Every call parses the file again, so a test may + * change the answer it gets. + * + * @param {string} coreVersion + * @param {string} name + * @returns {{result: Object}} + */ + function readCoreAnswer(coreVersion, name) { + const file = path.join(PACKAGE_ROOT_DIR, 'test/fixtures/coreRpc', coreVersion, `${name}.json`); + + return { result: JSON.parse(fs.readFileSync(file, 'utf8')) }; + } + + beforeEach(() => { + mockDockerCompose.isServiceRunning.withArgs(config, 'drive_tenderdash').returns(false); + mockDetermineDockerStatus.withArgs(mockDockerCompose, config, 'drive_abci') + .returns(DockerStatusEnum.running); + mockDockerCompose.execCommand.withArgs(config, 'drive_abci', 'drive-abci status').resolves({ exitCode: 0, out: '' }); + mockDockerCompose.execCommand.withArgs(config, 'drive_abci', 'drive-abci version').resolves({ exitCode: 0, out: '1.4.1' }); + }); + + [ + { + height: 1112, + platformActivation: 'Activated (at height 1000)', + driveServiceStatus: ServiceStatusEnum.up, + }, + { + height: 512, + platformActivation: 'Waiting for activation on height 1000', + driveServiceStatus: ServiceStatusEnum.wait_for_activation, + }, + ].forEach(({ height, platformActivation, driveServiceStatus }) => { + it(`should report platform activation and status at height ${height} on Core v24, which by default no longer reports softforks in getblockchaininfo`, async () => { + mockRpcClient.mnsync.withArgs('status').returns(readCoreAnswer('24.0.0-rc.3', 'mnsync-status')); + mockRpcClient.getBlockchainInfo.returns(readCoreAnswer('24.0.0-rc.3', `getblockchaininfo-${height}`)); + mockRpcClient.getDeploymentInfo.returns(readCoreAnswer('24.0.0-rc.3', `getdeploymentinfo-${height}`)); + + const scope = await getPlatformScope(config); + + expect(scope.platformActivation).to.equal(platformActivation); + expect(scope.coreIsSynced).to.be.true(); + expect(scope.tenderdash.serviceStatus).to.equal(ServiceStatusEnum.stopped); + expect(scope.drive).to.deep.equal({ + dockerStatus: DockerStatusEnum.running, + serviceStatus: driveServiceStatus, + version: '1.4.1', + }); + }); + }); + + it('should read platform activation from getblockchaininfo softforks on Core v23 without calling getdeploymentinfo', async () => { + // Core v23 has no getdeploymentinfo and reports deployments only in getblockchaininfo softforks + mockRpcClient.mnsync.withArgs('status').returns(readCoreAnswer('23.1.8', 'mnsync-status')); + mockRpcClient.getBlockchainInfo.returns(readCoreAnswer('23.1.8', 'getblockchaininfo-1112')); + + const scope = await getPlatformScope(config); + + expect(scope.platformActivation).to.equal('Activated (at height 1000)'); + expect(scope.coreIsSynced).to.be.true(); + expect(scope.drive.serviceStatus).to.equal(ServiceStatusEnum.up); + expect(mockRpcClient.getDeploymentInfo).to.not.have.been.called(); + }); + + [ + { + coreVersion: '23.1.8', + getDeploymentInfoCalls: 0, + mockDeployments: () => { + const blockchainInfo = readCoreAnswer('23.1.8', 'getblockchaininfo-1112'); + delete blockchainInfo.result.softforks.mn_rr; + mockRpcClient.getBlockchainInfo.returns(blockchainInfo); + }, + }, + { + coreVersion: '24.0.0-rc.3', + getDeploymentInfoCalls: 1, + mockDeployments: () => { + const deploymentInfo = readCoreAnswer('24.0.0-rc.3', 'getdeploymentinfo-1112'); + delete deploymentInfo.result.deployments.mn_rr; + mockRpcClient.getBlockchainInfo.returns(readCoreAnswer('24.0.0-rc.3', 'getblockchaininfo-1112')); + mockRpcClient.getDeploymentInfo.returns(deploymentInfo); + }, + }, + ].forEach(({ coreVersion, getDeploymentInfoCalls, mockDeployments }) => { + it(`should return the empty platform scope instead of failing when Core ${coreVersion} reports no mn_rr deployment`, async () => { + mockRpcClient.mnsync.withArgs('status').returns(readCoreAnswer(coreVersion, 'mnsync-status')); + mockDeployments(); + + const scope = await getPlatformScope(config); + + expect(scope.platformActivation).to.be.null(); + expect(scope.coreIsSynced).to.be.null(); + expect(scope.tenderdash.serviceStatus).to.be.null(); + expect(scope.drive).to.deep.equal({ + dockerStatus: null, + serviceStatus: null, + version: null, + }); + expect(mockRpcClient.getDeploymentInfo.callCount).to.equal(getDeploymentInfoCalls); + }); + }); + }); }); }); diff --git a/yarn.lock b/yarn.lock index 884fa0a45c6..219919642ef 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1606,7 +1606,7 @@ __metadata: "@dashevo/dapi-client": "workspace:*" "@dashevo/dapi-grpc": "workspace:*" "@dashevo/dashcore-lib": "npm:~0.22.0" - "@dashevo/dashd-rpc": "npm:^19.0.0" + "@dashevo/dashd-rpc": "npm:^19.1.0" "@dashevo/dp-services-ctl": "github:dashevo/js-dp-services-ctl#v0.19-dev" "@dashevo/grpc-common": "workspace:*" "@dashevo/wasm-dpp": "workspace:*" @@ -1694,13 +1694,13 @@ __metadata: languageName: node linkType: hard -"@dashevo/dashd-rpc@npm:^19.0.0": - version: 19.0.0 - resolution: "@dashevo/dashd-rpc@npm:19.0.0" +"@dashevo/dashd-rpc@npm:^19.1.0": + version: 19.1.0 + resolution: "@dashevo/dashd-rpc@npm:19.1.0" dependencies: async: "npm:^3.2.4" bluebird: "npm:^3.7.2" - checksum: 10/2eab84af3e9e654601b6bdf02b670352e4a6aec5ee0cdb3b4d0fd81655ff9b4792dbec0fd02cdc72dc54b1867103f53e17264cf5b966a4c51f2d691088d783d1 + checksum: 10/5d3ebf1f0b1a5547946ca090aa98ad18ca291c811bc40ff9d8e532d0291ea7b1592423e49ed7946da06bb344ebee8065712a6c0be38c6c27e3407588c78367e0 languageName: node linkType: hard @@ -7342,7 +7342,7 @@ __metadata: "@dashevo/bls": "npm:~1.2.9" "@dashevo/dapi-client": "workspace:*" "@dashevo/dashcore-lib": "npm:~0.22.0" - "@dashevo/dashd-rpc": "npm:^19.0.0" + "@dashevo/dashd-rpc": "npm:^19.1.0" "@dashevo/docker-compose": "npm:^0.24.4" "@dashevo/wallet-lib": "workspace:*" "@dashevo/withdrawals-contract": "workspace:*"