Skip to content

Commit

Permalink
feat!: identity funding with asset lock special transactions (#1510)
Browse files Browse the repository at this point in the history
Co-authored-by: markin.io <[email protected]>
  • Loading branch information
shumkov and markin-io authored Nov 1, 2023
1 parent 2a95380 commit 3323dd8
Show file tree
Hide file tree
Showing 160 changed files with 2,688 additions and 2,605 deletions.
24 changes: 12 additions & 12 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
11 changes: 6 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/bench-suite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"lint": "eslint ."
},
"dependencies": {
"@dashevo/dashcore-lib": "~0.20.9",
"@dashevo/dashcore-lib": "~0.21.0",
"@dashevo/dpns-contract": "workspace:*",
"@dashevo/wallet-lib": "workspace:*",
"@dashevo/wasm-dpp": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/dapi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"dependencies": {
"@dashevo/bls": "~1.2.9",
"@dashevo/dapi-grpc": "workspace:*",
"@dashevo/dashcore-lib": "~0.20.9",
"@dashevo/dashcore-lib": "~0.21.0",
"@dashevo/dashd-rpc": "^18.2.0",
"@dashevo/grpc-common": "workspace:*",
"@dashevo/wasm-dpp": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/dash-spv/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dependencies": {
"@dashevo/dark-gravity-wave": "^1.1.1",
"@dashevo/dash-util": "^2.0.3",
"@dashevo/dashcore-lib": "~0.20.9",
"@dashevo/dashcore-lib": "~0.21.0",
"levelup": "^4.4.0",
"memdown": "^5.1.0",
"wasm-x11-hash": "~0.0.2"
Expand Down
2 changes: 1 addition & 1 deletion packages/dashmate/configs/defaults/getBaseConfigFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function getBaseConfigFactory(homeDir) {
},
core: {
docker: {
image: 'dashpay/dashd:20.0.0-beta.4',
image: 'dashpay/dashd:20.0.0-rc.2',
commandArgs: [],
},
p2p: {
Expand Down
5 changes: 5 additions & 0 deletions packages/dashmate/configs/getConfigFileMigrationsFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,11 @@ function getConfigFileMigrationsFactory(homeDir, defaultConfigs) {
Object.entries(configFile.configs)
.forEach(([, options]) => {
options.platform.drive.tenderdash.log.level = 'info';

if (options.network !== NETWORK_MAINNET) {
options.core.docker.image = base.get('core.docker.image');
}

options.core.docker.commandArgs = [];
});

Expand Down
2 changes: 1 addition & 1 deletion packages/dashmate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"homepage": "https://github.com/dashevo/dashmate#readme",
"dependencies": {
"@dashevo/bls": "~1.2.9",
"@dashevo/dashcore-lib": "~0.20.9",
"@dashevo/dashcore-lib": "~0.21.0",
"@dashevo/dashd-rpc": "^18.2.0",
"@dashevo/dashpay-contract": "workspace:*",
"@dashevo/docker-compose": "^0.24.4",
Expand Down
21 changes: 12 additions & 9 deletions packages/dashmate/src/config/HomeDir.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,20 @@ class HomeDir {
/**
*
* @param {string} path - Use the current home dir if not present
* @param {boolean} [skipValidation=false] - Do not validate path
*/
constructor(path) {
if (!fs.existsSync(path)) {
throw new HomeDirDoesNotExistError(path);
}
constructor(path, skipValidation = false) {
if (!skipValidation) {
if (!fs.existsSync(path)) {
throw new HomeDirDoesNotExistError(path);
}

try {
// eslint-disable-next-line no-bitwise
fs.accessSync(path, fs.constants.R_OK | fs.constants.W_OK);
} catch (e) {
throw new HomeDirIsNotWritableError(path);
try {
// eslint-disable-next-line no-bitwise
fs.accessSync(path, fs.constants.R_OK | fs.constants.W_OK);
} catch (e) {
throw new HomeDirIsNotWritableError(path);
}
}

this.#path = path;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,26 @@ function migrateConfigFileFactory(getConfigFileMigrations) {
* @returns {Object}
*/
function migrateConfigFile(rawConfigFile, fromVersion, toVersion) {
// TODO: We just need to migrate up to the latest version in migrations
// to handle properly development process when you work on non-released version
if (fromVersion === toVersion) {
return rawConfigFile;
}

const configFileMigrations = getConfigFileMigrations();

return Object.keys(configFileMigrations)
/**
* @type {Object}
*/
const migratedConfigFile = Object.keys(configFileMigrations)
.filter((version) => semver.gt(version, fromVersion))
.sort(semver.compare)
.reduce((migratedOptions, version) => {
const migrationFunction = configFileMigrations[version];
return migrationFunction(rawConfigFile);
}, rawConfigFile);

migratedConfigFile.configFormatVersion = toVersion;

return migratedConfigFile;
}

return migrateConfigFile;
Expand Down
6 changes: 3 additions & 3 deletions packages/dashmate/src/docker/ensureFileMountExistsFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ const fs = require('fs');
const path = require('path');

/**
* @return {resolveDockerHostIp}
* @return {ensureFileMountExists}
*/
function ensureFileMountExistsFactory() {
/**
* @typedef {resolveDockerHostIp}
* @typedef {ensureFileMountExists}
* @param {string} filePath
* @param {string|number} [mode] - https://nodejs.org/api/fs.html#fschmodpath-mode-callback
* @return {Promise<void>}
* @return {void}
*/
function ensureFileMountExists(filePath, mode = undefined) {
// Remove directory that could potentially be created by Docker mount
Expand Down
Loading

0 comments on commit 3323dd8

Please sign in to comment.