Skip to content

Commit

Permalink
Merge pull request #1077 from Chia-Network/revert-1068-revert-1066-de…
Browse files Browse the repository at this point in the history
…velop

Revert "Revert "Release 1.7.15""
  • Loading branch information
TheLastCicada authored May 15, 2024
2 parents ce8a998 + f91ae7a commit 19a8bc0
Show file tree
Hide file tree
Showing 9 changed files with 931 additions and 836 deletions.
2 changes: 1 addition & 1 deletion docs/cadt_rpc_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ POST Options:

```json
// Request
curl --location -g --request POST 'localhost:31310/v1/organizations/' \
curl --location -g --request POST 'localhost:31310/v1/organizations/create' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Sample Org",
Expand Down
629 changes: 325 additions & 304 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cadt",
"version": "1.7.14",
"version": "1.7.15",
"_comment": "DONT CHANGE MAJOR UNLESS DATAMODEL CHANGES: The major version corresponds to the datamodel version your using, so 2.0.0 means it'll use datamodel v2",
"private": true,
"bin": "build/server.js",
Expand Down Expand Up @@ -45,7 +45,7 @@
"lodash": "^4.17.21",
"log-update": "^4.0.0",
"multer": "^1.4.5-lts.1",
"mysql2": "^3.9.3",
"mysql2": "^3.9.7",
"node-xlsx": "^0.23.0",
"regenerator-runtime": "^0.13.11",
"rxjs": "^7.8.1",
Expand Down
4 changes: 4 additions & 0 deletions src/controllers/organization.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,17 @@ export const homeOrgSyncStatus = async (req, res) => {
where: { commited: true },
});

const { sync_status } = await datalayer.getSyncStatus(homeOrg.orgUid);

return res.json({
ready:
walletSynced && Boolean(homeOrg?.synced) && pendingCommitsCount === 0,
status: {
wallet_synced: walletSynced,
home_org_synced: Boolean(homeOrg?.synced),
pending_commits: pendingCommitsCount,
home_org_profile_synced:
sync_status.target_root_hash === homeOrg.orgHash,
},
success: true,
});
Expand Down
29 changes: 29 additions & 0 deletions src/datalayer/persistance.js
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,34 @@ const cancelOffer = async (tradeId) => {
}
};

const getSyncStatus = async (storeId) => {
const url = `${CONFIG.DATALAYER_URL}/get_sync_status`;
const { cert, key, timeout } = getBaseOptions();

try {
const response = await superagent
.post(url)
.key(key)
.cert(cert)
.timeout(timeout)
.send({
id: storeId,
});

const data = response.body;

// We just care that we got some response, not what the response is
if (Object.keys(data).includes('success')) {
return data;
}

return false;
} catch (error) {
logger.error(error);
return false;
}
};

export {
addMirror,
makeOffer,
Expand All @@ -737,4 +765,5 @@ export {
takeOffer,
clearPendingRoots,
getValue,
getSyncStatus,
};
Loading

0 comments on commit 19a8bc0

Please sign in to comment.