Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: identity funding with asset lock special transactions #1510

Merged
merged 56 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
eb98957
refactor: use OutPoint instead of Bytes36
shumkov Oct 18, 2023
c34ba46
chore: get outpoint from payload
shumkov Oct 18, 2023
6bf1220
test: send asset lock transaction
shumkov Oct 19, 2023
45abe20
fix: incorrect output for chain asset lock proof
shumkov Oct 19, 2023
ca1637c
fix: compilation errors in wasm-dpp
shumkov Oct 19, 2023
dff21bc
chore: add asset lock transaction validation
shumkov Oct 19, 2023
ffc0c95
fix(wasm-dpp): compilation error typo
markin-io Oct 19, 2023
3ea2c2f
chore: update dashcore-lib to v0.20.10
markin-io Oct 19, 2023
e5d6377
feat(sdk): create asset lock transaction
markin-io Oct 19, 2023
f85971d
fix: add missing dashcore dependency
markin-io Oct 19, 2023
6306d15
fix(wasm-dpp): test
markin-io Oct 19, 2023
b8c2542
chore: verify state transition signature
shumkov Oct 19, 2023
0f3a473
Merge remote-tracking branch 'origin/feat/process-asset-locks' into f…
shumkov Oct 19, 2023
1c4bbef
fix: hash signature verification
shumkov Oct 19, 2023
5526306
fix: public key signature validation result is ignored
shumkov Oct 19, 2023
7e5ddf1
fix(wasm-dpp): compilation
markin-io Oct 19, 2023
c19a4b8
chore: asset lock proof structure validation
shumkov Oct 19, 2023
7e60430
Merge remote-tracking branch 'origin/feat/process-asset-locks' into f…
shumkov Oct 19, 2023
a200f5b
chore: some missing files
shumkov Oct 19, 2023
55c7bf2
chore: validate state
shumkov Oct 19, 2023
a31ef00
test: fix check_tx tests
shumkov Oct 19, 2023
37eb3a8
chore: set genesis block info
shumkov Oct 19, 2023
8de6b70
test: add verify_instant_lock mock
shumkov Oct 19, 2023
ef38440
style: remove unused import
shumkov Oct 19, 2023
b7d8afc
chore: remove asset lock proof type
shumkov Oct 20, 2023
fbf540d
docs: add docs for asset lock proofs
shumkov Oct 20, 2023
2a4dce1
test: fix fixture
shumkov Oct 20, 2023
ab8d56c
chore: move core expensive operations to very end
shumkov Oct 20, 2023
b157214
fix: action is not required for idenity create and topup
shumkov Oct 20, 2023
e272666
test: fix JS tests
shumkov Oct 20, 2023
b9af33a
test(wasm-dpp): fix asset lock proof tests
markin-io Oct 20, 2023
aaa5368
test(wasm-dpp): fix asset lock proof
markin-io Oct 20, 2023
ef7b753
refactor: use Bytes36 in Drive
shumkov Oct 20, 2023
0d74cf0
fix: CheckCreditPoolDiffForBlock for block failed with bad-cbtx-asse…
shumkov Oct 27, 2023
b53e1f8
Merge branch 'v1.0-dev' into feat/process-asset-locks
shumkov Oct 28, 2023
dfa80fd
fix: can't fetch asset transaction for chain asset lock proof
shumkov Oct 28, 2023
446c0bc
chore: throw JsError in create_instant_asset_lock_proof
shumkov Oct 29, 2023
9dc085f
chore: add log level in test suite config
shumkov Oct 29, 2023
558b1e6
docs: fix ensureFileMountExistsFactory js docs
shumkov Oct 29, 2023
8ea1bdd
chore: temporary use old chain locks
shumkov Oct 29, 2023
a9fa944
chore: handle a right getrawtransaction response
shumkov Oct 29, 2023
c4d74ac
fix: instant lock signature verification
shumkov Oct 29, 2023
b82c18f
chore: remove $ form consensus error messages
shumkov Oct 30, 2023
2de9ee4
fix: invalid getOutPointBuffer
shumkov Oct 30, 2023
5c7ae92
fix: internal error with chain asset lock proof
shumkov Oct 30, 2023
fc08fe1
tests: enabled identity test suite tests
shumkov Oct 30, 2023
cf39d6a
Merge branch 'v1.0-dev' into feat/process-asset-locks
shumkov Oct 30, 2023
4e0eeb6
refactor: init information to genesis block info
shumkov Oct 30, 2023
7b73a06
fix: identity create balance validation
shumkov Oct 30, 2023
6b0e0d4
test: fix wasm-dpp tests
shumkov Oct 31, 2023
078459a
Merge branch 'v1.0-dev' into feat/process-asset-locks
shumkov Oct 31, 2023
f4eb7d1
chore: fix migrations
shumkov Oct 31, 2023
bad0450
tests: disable migration tests
shumkov Oct 31, 2023
6905a64
chore: switch to instant locks version 1
shumkov Oct 31, 2023
58c381f
Merge branch 'v1.0-dev' into feat/process-asset-locks
shumkov Oct 31, 2023
b222dcb
style: fix linter
shumkov Oct 31, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading