diff --git a/.github/workflows/.env b/.github/workflows/.env index 0e4fd81..153708e 100644 --- a/.github/workflows/.env +++ b/.github/workflows/.env @@ -1,4 +1,4 @@ -DRIVE_BRANCH=v0.21-dev +DRIVE_BRANCH=update-dpp DAPI_BRANCH=v0.21-dev -# DASHMATE_BRANCH= -# SDK_BRANCH= +DASHMATE_BRANCH=convenient-errors +#SDK_BRANCH=update-dpp diff --git a/lib/test/createClientWithFundedWallet.js b/lib/test/createClientWithFundedWallet.js index 1b95a40..7305bfc 100644 --- a/lib/test/createClientWithFundedWallet.js +++ b/lib/test/createClientWithFundedWallet.js @@ -23,6 +23,7 @@ async function createClientWithFundedWallet(HDPrivateKey = undefined) { contractId: process.env.DPNS_CONTRACT_ID, }, }, + driveProtocolVersion: 1, }; const faucetClient = createFaucetClient(); diff --git a/lib/test/createClientWithoutWallet.js b/lib/test/createClientWithoutWallet.js index 7099bd5..b8a0aaf 100644 --- a/lib/test/createClientWithoutWallet.js +++ b/lib/test/createClientWithoutWallet.js @@ -11,6 +11,7 @@ function createClientWithoutWallet() { contractId: process.env.DPNS_CONTRACT_ID, }, }, + driveProtocolVersion: 1, }); } diff --git a/lib/test/createFaucetClient.js b/lib/test/createFaucetClient.js index 6745ece..b0995f8 100644 --- a/lib/test/createFaucetClient.js +++ b/lib/test/createFaucetClient.js @@ -19,6 +19,7 @@ function createFaucetClient() { contractId: process.env.DPNS_CONTRACT_ID, }, }, + driveProtocolVersion: 1, }; faucetClient = new Dash.Client({ diff --git a/package-lock.json b/package-lock.json index 468db53..0cfc4f1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,9 +24,9 @@ } }, "@babel/helper-validator-identifier": { - "version": "7.14.9", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.9.tgz", - "integrity": "sha512-pQYxPY0UP6IHISRitNe8bsijHex4TWZXi2HwKVsjPiltzlhse2znVcm9Ace510VT1kxIHjGJCZZQBX2gJDbo0g==", + "version": "7.15.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz", + "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==", "dev": true }, "@babel/highlight": { @@ -56,12 +56,14 @@ } }, "@dashevo/dapi-client": { - "version": "0.21.0-dev.7", - "resolved": "https://registry.npmjs.org/@dashevo/dapi-client/-/dapi-client-0.21.0-dev.7.tgz", - "integrity": "sha512-fNfby71MJasseVRLmNURZvBSFqAhCpkJaSoJhf2AK2zmJ1YDFhJkB0IdnMMyjgfnxrzmVYL8X0wf+fLpiVJ6dw==", - "requires": { - "@dashevo/dapi-grpc": "~0.21.0-dev.8", - "@dashevo/dashcore-lib": "~0.19.25", + "version": "0.21.0-dev.10", + "resolved": "https://registry.npmjs.org/@dashevo/dapi-client/-/dapi-client-0.21.0-dev.10.tgz", + "integrity": "sha512-VRQRian6obil1CtCT6IKbJwCWfcoTZrY6y6r2VzaiICyYu9WMeSxAjUYrJjpYJM9dS1R6Fb3Ufa0htrUq8noYg==", + "requires": { + "@dashevo/dapi-grpc": "~0.21.0-dev.12", + "@dashevo/dashcore-lib": "~0.19.26", + "@dashevo/dpp": "~0.21.0-dev.5", + "@dashevo/grpc-common": "~0.5.4", "axios": "^0.21.1", "bs58": "^4.0.1", "cbor": "^7.0.5", @@ -69,6 +71,24 @@ "node-inspect-extracted": "^1.0.7" }, "dependencies": { + "@dashevo/grpc-common": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/@dashevo/grpc-common/-/grpc-common-0.5.4.tgz", + "integrity": "sha512-2VEQJsTgE1HToiQ2XhfnPWqQW/2lnPE32z6QSz8YUoAjWCIFddhbYbGqNX8YNqSqnoQhcDGkVd1hD2udNA4oOQ==", + "requires": { + "@grpc/grpc-js": "^1.3.6", + "@grpc/proto-loader": "^0.5.2", + "cbor": "^7.0.6", + "lodash.get": "^4.4.2", + "protobufjs": "github:jawid-h/protobuf.js#fix/buffer-conversion", + "semver": "^7.3.2" + } + }, + "@types/node": { + "version": "13.13.52", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.52.tgz", + "integrity": "sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ==" + }, "cbor": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cbor/-/cbor-7.0.6.tgz", @@ -85,26 +105,75 @@ "requires": { "@cto.af/textdecoder": "^0.0.0" } + }, + "protobufjs": { + "version": "github:jawid-h/protobuf.js#8b91c72dca68fd6c418078fd2358c4969425dcdc", + "from": "github:jawid-h/protobuf.js#fix/buffer-conversion", + "requires": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.1", + "@types/node": "^13.7.0", + "long": "^4.0.0" + } } } }, "@dashevo/dapi-grpc": { - "version": "0.21.0-dev.8", - "resolved": "https://registry.npmjs.org/@dashevo/dapi-grpc/-/dapi-grpc-0.21.0-dev.8.tgz", - "integrity": "sha512-/jfmpR7K0mgVWoJvxWd33bfecTKEBcaUE2KI2u6+PyItwYcrK+nxJm36Yt6AzroQBf56Dxvo3lQ6WhU9BwePeQ==", + "version": "0.21.0-dev.12", + "resolved": "https://registry.npmjs.org/@dashevo/dapi-grpc/-/dapi-grpc-0.21.0-dev.12.tgz", + "integrity": "sha512-uHsXionXZrNk6Ukrfl4xHinLwZSJQEWSyBlf0jGxEixXovNZEebcWkV4l8loxFQuwH0BvrZT32jGEIVf6w2KWA==", "requires": { - "@dashevo/grpc-common": "^0.4.0", + "@dashevo/grpc-common": "^0.5.4", "@grpc/grpc-js": "^1.3.6", "google-protobuf": "^3.12.2", "grpc-web": "^1.2.0", "protobufjs": "github:jawid-h/protobuf.js#fix/buffer-conversion" }, "dependencies": { + "@dashevo/grpc-common": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/@dashevo/grpc-common/-/grpc-common-0.5.4.tgz", + "integrity": "sha512-2VEQJsTgE1HToiQ2XhfnPWqQW/2lnPE32z6QSz8YUoAjWCIFddhbYbGqNX8YNqSqnoQhcDGkVd1hD2udNA4oOQ==", + "requires": { + "@grpc/grpc-js": "^1.3.6", + "@grpc/proto-loader": "^0.5.2", + "cbor": "^7.0.6", + "lodash.get": "^4.4.2", + "protobufjs": "github:jawid-h/protobuf.js#fix/buffer-conversion", + "semver": "^7.3.2" + } + }, "@types/node": { "version": "13.13.52", "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.52.tgz", "integrity": "sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ==" }, + "cbor": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cbor/-/cbor-7.0.6.tgz", + "integrity": "sha512-rgt2RFogHGDLFU5r0kSfyeBc+de55DwYHP73KxKsQxsR5b0CYuQPH6AnJaXByiohpLdjQqj/K0SFcOV+dXdhSA==", + "requires": { + "@cto.af/textdecoder": "^0.0.0", + "nofilter": "^2.0.3" + } + }, + "nofilter": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/nofilter/-/nofilter-2.0.3.tgz", + "integrity": "sha512-FbuXC+lK+GU2+63D1kC1ETiZo+Z7SIi7B+mxKTCH1byrh6WFvfBCN/wpherFz0a0bjGd7EKTst/cz0yLeNngug==", + "requires": { + "@cto.af/textdecoder": "^0.0.0" + } + }, "protobufjs": { "version": "github:jawid-h/protobuf.js#8b91c72dca68fd6c418078fd2358c4969425dcdc", "from": "github:jawid-h/protobuf.js#fix/buffer-conversion", @@ -127,9 +196,9 @@ } }, "@dashevo/dashcore-lib": { - "version": "0.19.25", - "resolved": "https://registry.npmjs.org/@dashevo/dashcore-lib/-/dashcore-lib-0.19.25.tgz", - "integrity": "sha512-/xVQxotoysCDKUg54Wkc0q/5IICLlUkt+8Pp5zAHI7E8Zf8bQ+CB7P0KzeufkMiUVsIdOZ7INM2sMQYcVk2SeA==", + "version": "0.19.26", + "resolved": "https://registry.npmjs.org/@dashevo/dashcore-lib/-/dashcore-lib-0.19.26.tgz", + "integrity": "sha512-wcGojfHIpEWR4/pjT4CcMmRhI00MbkYT5S29uBhUl7aTNo3Ya75f9YQOXykD03gM3yyCRQSOovmK/cOJU030BQ==", "requires": { "@dashevo/x11-hash-js": "^1.0.2", "@types/node": "^12.12.47", @@ -145,13 +214,13 @@ } }, "@dashevo/dpns-contract": { - "version": "github:dashevo/dpns-contract#7cf5d05c5f03972d4cb39cd875561d9faa3a62fe", - "from": "github:dashevo/dpns-contract#update-dpp" + "version": "github:dashevo/dpns-contract#70ed81c0576e1e499f12c15943757b6c47eed746", + "from": "github:dashevo/dpns-contract" }, "@dashevo/dpp": { - "version": "0.21.0-dev.4", - "resolved": "https://registry.npmjs.org/@dashevo/dpp/-/dpp-0.21.0-dev.4.tgz", - "integrity": "sha512-H1QP1ZdZnptYe4rztIdkohts8Y11J2izt6LDkquZR9+kfrpv4gCiWqs+UeslCY06HiaeXVjLUHwk+x7JZOvVNQ==", + "version": "0.21.0-dev.7", + "resolved": "https://registry.npmjs.org/@dashevo/dpp/-/dpp-0.21.0-dev.7.tgz", + "integrity": "sha512-dN+tcwUSIUB/jYUUs7/XnSvQiyvlzIAeOmv5Vv0DwxrBlfSK2kynH86iKOY65kD2AHWbRq9Sc9xnVotb0iA0nw==", "requires": { "@apidevtools/json-schema-ref-parser": "^8.0.0", "@dashevo/dashcore-lib": "~0.19.25", @@ -175,9 +244,9 @@ "from": "github:dashevo/feature-flags-contract#update-dpp" }, "@dashevo/grpc-common": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@dashevo/grpc-common/-/grpc-common-0.4.1.tgz", - "integrity": "sha512-9UQSHbNLeIPIeUnn7XBc8gMaKZiXW/jUUictsVJrECUPlS5W/hwW6gz5vNayjg59QYPQXSKy98NhVkEXh2FbbA==", + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@dashevo/grpc-common/-/grpc-common-0.4.2.tgz", + "integrity": "sha512-z8f5ucWIkM7Pohr7nQAggXEgRMwbi6MVgBXskXZ/rps3N2es9psMjnhSKWMP4GPCOKBJE72F/7BPw64SVLQc8Q==", "requires": { "@grpc/grpc-js": "^1.3.6", "@grpc/proto-loader": "^0.5.2", @@ -199,14 +268,14 @@ "integrity": "sha512-ihW/0heZgcLozQTSPDxa/cSy4NCZmQdGvu9lyR1jrCGfeDPp5N8ZXbLWOPPLulnR/28g683QA+Z4G/8tW+mw5Q==" }, "@dashevo/wallet-lib": { - "version": "7.21.0-dev.6", - "resolved": "https://registry.npmjs.org/@dashevo/wallet-lib/-/wallet-lib-7.21.0-dev.6.tgz", - "integrity": "sha512-sbsTNSJc0tAh/vqtc2i203oxzm0iFjSIVsl3N1nwV6iqxU/+P1Bjw3Z6z4j0M54ZUEADptR2txseNhT5xh4PGQ==", - "requires": { - "@dashevo/dapi-client": "~0.21.0-dev.7", - "@dashevo/dashcore-lib": "~0.19.25", - "@dashevo/dpp": "~0.21.0-dev.4", - "@dashevo/grpc-common": "~0.4.0", + "version": "7.21.0-dev.8", + "resolved": "https://registry.npmjs.org/@dashevo/wallet-lib/-/wallet-lib-7.21.0-dev.8.tgz", + "integrity": "sha512-18yRDpoF4wfWvBpf1xoS4EjzxO70AdBnK552oj5fXKVEes71NR61N5Q9qgTVuM8bbIB7aM4LiQbII8OL0IVdVQ==", + "requires": { + "@dashevo/dapi-client": "~0.21.0-dev.10", + "@dashevo/dashcore-lib": "~0.19.26", + "@dashevo/dpp": "~0.21.0-dev.5", + "@dashevo/grpc-common": "~0.5.4", "cbor": "^7.0.5", "crypto-js": "^4.0.0", "lodash": "^4.17.19", @@ -214,6 +283,24 @@ "winston": "^3.2.1" }, "dependencies": { + "@dashevo/grpc-common": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/@dashevo/grpc-common/-/grpc-common-0.5.4.tgz", + "integrity": "sha512-2VEQJsTgE1HToiQ2XhfnPWqQW/2lnPE32z6QSz8YUoAjWCIFddhbYbGqNX8YNqSqnoQhcDGkVd1hD2udNA4oOQ==", + "requires": { + "@grpc/grpc-js": "^1.3.6", + "@grpc/proto-loader": "^0.5.2", + "cbor": "^7.0.6", + "lodash.get": "^4.4.2", + "protobufjs": "github:jawid-h/protobuf.js#fix/buffer-conversion", + "semver": "^7.3.2" + } + }, + "@types/node": { + "version": "13.13.52", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.52.tgz", + "integrity": "sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ==" + }, "cbor": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cbor/-/cbor-7.0.6.tgz", @@ -230,6 +317,25 @@ "requires": { "@cto.af/textdecoder": "^0.0.0" } + }, + "protobufjs": { + "version": "github:jawid-h/protobuf.js#8b91c72dca68fd6c418078fd2358c4969425dcdc", + "from": "github:jawid-h/protobuf.js#fix/buffer-conversion", + "requires": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.1", + "@types/node": "^13.7.0", + "long": "^4.0.0" + } } } }, @@ -253,13 +359,6 @@ "requires": { "lodash.camelcase": "^4.3.0", "protobufjs": "^6.8.6" - }, - "dependencies": { - "@types/node": { - "version": "16.9.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.1.tgz", - "integrity": "sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g==" - } } }, "@jsdevtools/ono": { @@ -364,9 +463,9 @@ "integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w==" }, "@types/node": { - "version": "12.20.24", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.24.tgz", - "integrity": "sha512-yxDeaQIAJlMav7fH5AQqPH1u8YIuhYJXYBzxaQ4PifsU0GDO38MSdmEDeRlIxrKbC6NbEaaEHDanWb+y30U8SQ==" + "version": "12.20.26", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.26.tgz", + "integrity": "sha512-gIt+h4u2uTho2bsH1K250fUv5fHU71ET1yWT7bM4523zV/XrFb9jlWBOV4DO8FpscY+Sz/WEr1EEjIP2H4yumQ==" }, "acorn": { "version": "7.4.1", @@ -849,22 +948,91 @@ "integrity": "sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw==" }, "dash": { - "version": "3.21.0-dev.6", - "resolved": "https://registry.npmjs.org/dash/-/dash-3.21.0-dev.6.tgz", - "integrity": "sha512-693lL3qfPWlADW2jCc9fi8sHvC0BQS5HRxBEtkW69uPDZNd0sqAPgbOn1nlGz/xaGl/QBU3zcGLyfB4wqLIotw==", + "version": "3.21.0-dev.7", + "resolved": "github:dashevo/js-dash-sdk#4d9295703e29b7268fc48e75c47226b63011ceb3", "requires": { - "@dashevo/dapi-client": "~0.21.0-dev.7", + "@dashevo/dapi-client": "~0.21.0-dev.10", "@dashevo/dashcore-lib": "~0.19.25", - "@dashevo/dpp": "~0.21.0-dev.4", - "@dashevo/wallet-lib": "~7.21.0-dev.6", + "@dashevo/dpp": "~0.21.0-dev.6", + "@dashevo/grpc-common": "~0.5.2", + "@dashevo/wallet-lib": "github:dashevo/wallet-lib#update-dpp", "bs58": "^4.0.1", "node-inspect-extracted": "1.0.7" }, "dependencies": { + "@dashevo/grpc-common": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/@dashevo/grpc-common/-/grpc-common-0.5.4.tgz", + "integrity": "sha512-2VEQJsTgE1HToiQ2XhfnPWqQW/2lnPE32z6QSz8YUoAjWCIFddhbYbGqNX8YNqSqnoQhcDGkVd1hD2udNA4oOQ==", + "requires": { + "@grpc/grpc-js": "^1.3.6", + "@grpc/proto-loader": "^0.5.2", + "cbor": "^7.0.6", + "lodash.get": "^4.4.2", + "protobufjs": "github:jawid-h/protobuf.js#fix/buffer-conversion", + "semver": "^7.3.2" + } + }, + "@dashevo/wallet-lib": { + "version": "github:dashevo/wallet-lib#d3fb13ff088c307b747effbd1c25d9c0fac1ec68", + "from": "github:dashevo/wallet-lib#update-dpp", + "requires": { + "@dashevo/dapi-client": "~0.21.0-dev.10", + "@dashevo/dashcore-lib": "~0.19.25", + "@dashevo/dpp": "~0.21.0-dev.6", + "@dashevo/grpc-common": "~0.5.3", + "cbor": "^7.0.5", + "crypto-js": "^4.0.0", + "lodash": "^4.17.19", + "pbkdf2": "^3.1.1", + "winston": "^3.2.1" + } + }, + "@types/node": { + "version": "13.13.52", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.52.tgz", + "integrity": "sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ==" + }, + "cbor": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cbor/-/cbor-7.0.6.tgz", + "integrity": "sha512-rgt2RFogHGDLFU5r0kSfyeBc+de55DwYHP73KxKsQxsR5b0CYuQPH6AnJaXByiohpLdjQqj/K0SFcOV+dXdhSA==", + "requires": { + "@cto.af/textdecoder": "^0.0.0", + "nofilter": "^2.0.3" + } + }, "node-inspect-extracted": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/node-inspect-extracted/-/node-inspect-extracted-1.0.7.tgz", "integrity": "sha512-FDdIQtuAVzkmV8Qh/Z0MdUvj4p6rRHYl28PkwnlRzwXNGFMd5leouoLtqaAqvtG0RG0jj0/RzYOznNe5XZw1lg==" + }, + "nofilter": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/nofilter/-/nofilter-2.0.3.tgz", + "integrity": "sha512-FbuXC+lK+GU2+63D1kC1ETiZo+Z7SIi7B+mxKTCH1byrh6WFvfBCN/wpherFz0a0bjGd7EKTst/cz0yLeNngug==", + "requires": { + "@cto.af/textdecoder": "^0.0.0" + } + }, + "protobufjs": { + "version": "github:jawid-h/protobuf.js#8b91c72dca68fd6c418078fd2358c4969425dcdc", + "from": "github:jawid-h/protobuf.js#fix/buffer-conversion", + "requires": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.1", + "@types/node": "^13.7.0", + "long": "^4.0.0" + } } } }, @@ -1407,11 +1575,6 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, - "fast-safe-stringify": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", - "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==" - }, "fecha": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.1.tgz", @@ -1579,9 +1742,9 @@ } }, "google-protobuf": { - "version": "3.17.3", - "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.17.3.tgz", - "integrity": "sha512-OVPzcSWIAJ+d5yiHyeaLrdufQtrvaBrF4JQg+z8ynTkbO3uFcujqXszTumqg1cGsAsjkWnI+M5B1xZ19yR4Wyg==" + "version": "3.18.0", + "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.18.0.tgz", + "integrity": "sha512-WlaQWRkUOo/lm9uTgNH6nk9IQt814RggWPzKBfnAVewOFzSzRUSmS1yUWRT6ixW1vS7er5p6tmLSmwzpPpmc8A==" }, "graceful-fs": { "version": "4.2.8", @@ -1751,9 +1914,9 @@ }, "dependencies": { "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, "ansi-styles": { @@ -2118,14 +2281,14 @@ } }, "logform": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/logform/-/logform-2.2.0.tgz", - "integrity": "sha512-N0qPlqfypFx7UHNn4B3lzS/b0uLqt2hmuoa+PpuXNYgozdJYAyauF5Ky0BWVjrxDlMWiT3qN4zPq3vVAfZy7Yg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/logform/-/logform-2.3.0.tgz", + "integrity": "sha512-graeoWUH2knKbGthMtuG1EfaSPMZFZBIrhuJHhkS5ZseFBrc7DupCzihOQAzsK/qIKPQaPJ/lFQFctILUY5ARQ==", "requires": { "colors": "^1.2.1", - "fast-safe-stringify": "^2.0.4", "fecha": "^4.2.0", "ms": "^2.1.1", + "safe-stable-stringify": "^1.1.0", "triple-beam": "^1.3.0" } }, @@ -2879,6 +3042,11 @@ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" }, + "safe-stable-stringify": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-1.1.1.tgz", + "integrity": "sha512-ERq4hUjKDbJfE4+XtZLFPCDi8Vb1JqaxAPTxWFLBx8XcAlf9Bda/ZJdVezs/NAfsMQScyIlUMx+Yeu7P7rx5jw==" + }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -2933,9 +3101,9 @@ } }, "signal-exit": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.4.tgz", + "integrity": "sha512-rqYhcAnZ6d/vTPGghdrw7iumdcbXpsk1b8IG/rz+VWV51DM0p7XCtMoJ3qhPLIbp3tvyt3pKRbaaEMZYpHto8Q==", "dev": true }, "simple-swizzle": { diff --git a/package.json b/package.json index 9131e62..fe5e65c 100644 --- a/package.json +++ b/package.json @@ -20,16 +20,16 @@ "homepage": "https://github.com/dashevo/platform-test-suite#readme", "dependencies": { "@dashevo/dashcore-lib": "~0.19.25", - "@dashevo/dpns-contract": "github:dashevo/dpns-contract#update-dpp", + "@dashevo/dpns-contract": "github:dashevo/dpns-contract", "@dashevo/feature-flags-contract": "github:dashevo/feature-flags-contract#update-dpp", - "@dashevo/dpp": "~0.21.0-dev.4", + "@dashevo/dpp": "~0.21.0-dev.7", "@dashevo/grpc-common": "~0.4.0", "@dashevo/merk": "git+https://github.com/dashevo/node-merk.git", - "@dashevo/wallet-lib": "~7.21.0-dev.6", + "@dashevo/wallet-lib": "~7.21.0-dev.8", "blake3": "^2.1.4", "chai": "^4.2.0", "chai-as-promised": "^7.1.1", - "dash": "~3.21.0-dev.6", + "dash": "~3.21.0-dev.7", "dirty-chai": "^2.0.1", "dotenv-safe": "^8.2.0", "github-api": "^3.3.0", diff --git a/test/e2e/wallet.spec.js b/test/e2e/wallet.spec.js index 3e1ba32..be3dad5 100644 --- a/test/e2e/wallet.spec.js +++ b/test/e2e/wallet.spec.js @@ -36,6 +36,7 @@ describe('e2e', () => { mnemonic, waitForInstantLockTimeout: 120000, }, + driveProtocolVersion: 1, }); }); @@ -101,6 +102,7 @@ describe('e2e', () => { }, seeds: getDAPISeeds(), network: process.env.NETWORK, + driveProtocolVersion: 1, }); restoredAccount = await restoredWallet.getWalletAccount(); diff --git a/test/functional/core/getBlockHash.spec.js b/test/functional/core/getBlockHash.spec.js index 372bfba..2c1bbdd 100644 --- a/test/functional/core/getBlockHash.spec.js +++ b/test/functional/core/getBlockHash.spec.js @@ -37,8 +37,9 @@ describe('Core', () => { } expect(broadcastError).to.exist(); - expect(broadcastError.name).to.equal('JsonRpcError'); + expect(broadcastError.name).to.equal('ResponseError'); expect(broadcastError.message).contains('Block height out of range'); + expect(broadcastError.code).to.equal(-32602); }); }); }); diff --git a/test/functional/core/getTransaction.spec.js b/test/functional/core/getTransaction.spec.js index a011e31..b7e4437 100644 --- a/test/functional/core/getTransaction.spec.js +++ b/test/functional/core/getTransaction.spec.js @@ -3,7 +3,7 @@ const { PrivateKey, } = require('@dashevo/dashcore-lib'); -const NotFoundError = require('@dashevo/dapi-client/lib/errors/response/NotFoundError'); +const NotFoundError = require('@dashevo/dapi-client/lib/transport/GrpcTransport/errors/NotFoundError'); const createFaucetClient = require('../../../lib/test/createFaucetClient'); const wait = require('../../../lib/wait'); diff --git a/test/functional/platform/DataContract.spec.js b/test/functional/platform/DataContract.spec.js index e1ade35..b5e3e58 100644 --- a/test/functional/platform/DataContract.spec.js +++ b/test/functional/platform/DataContract.spec.js @@ -4,6 +4,8 @@ const getDataContractFixture = require( const { executeProof, verifyProof } = require('@dashevo/merk'); const generateRandomIdentifier = require('@dashevo/dpp/lib/test/utils/generateRandomIdentifier'); +const IdentityNotFoundError = require('@dashevo/dpp/lib/errors/consensus/signature/IdentityNotFoundError'); +const { StateTransitionBroadcastError } = require('dash/build/src/errors/StateTransitionBroadcastError'); const createClientWithFundedWallet = require('../../../lib/test/createClientWithFundedWallet'); const testProofStructure = require('../../../lib/test/testProofStructure'); const parseStoreTreeProof = require('../../../lib/parseStoreTreeProof'); @@ -41,8 +43,8 @@ describe('Platform', () => { broadcastError = e; } - expect(broadcastError.message).to.equal(`16 UNAUTHENTICATED: Identity ${dataContractFixture.getOwnerId().toString()} not found`); - expect(broadcastError.code).to.equal(2000); + expect(broadcastError).to.be.an.instanceOf(StateTransitionBroadcastError); + expect(broadcastError.getCause()).to.be.an.instanceOf(IdentityNotFoundError); }); it('should create new data contract with previously created identity as an owner', async () => { diff --git a/test/functional/platform/Document.spec.js b/test/functional/platform/Document.spec.js index 2e6d1f7..d9d7403 100644 --- a/test/functional/platform/Document.spec.js +++ b/test/functional/platform/Document.spec.js @@ -9,6 +9,8 @@ const getIdentityFixture = require( const { signStateTransition } = require('dash/build/src/SDK/Client/Platform/signStateTransition'); +const InvalidDocumentTypeError = require('@dashevo/dpp/lib/errors/consensus/basic/document/InvalidDocumentTypeError'); +const { StateTransitionBroadcastError } = require('dash/build/src/errors/StateTransitionBroadcastError'); const createClientWithFundedWallet = require('../../../lib/test/createClientWithFundedWallet'); describe('Platform', () => { @@ -82,12 +84,8 @@ describe('Platform', () => { broadcastError = e; } - expect(broadcastError).to.exist(); - expect( - /INVALID_ARGUMENT: Data Contract \w* doesn't define document with type undefinedType/ - .test(broadcastError.message), - ).to.be.true(); - expect(broadcastError.code).to.be.equal(1024); + expect(broadcastError).to.be.an.instanceOf(StateTransitionBroadcastError); + expect(broadcastError.getCause()).to.be.an.instanceOf(InvalidDocumentTypeError); }); it('should fail to create a new document with an unknown owner', async () => { diff --git a/test/functional/platform/Identity.spec.js b/test/functional/platform/Identity.spec.js index 7f143f8..d53978a 100644 --- a/test/functional/platform/Identity.spec.js +++ b/test/functional/platform/Identity.spec.js @@ -11,6 +11,12 @@ const { default: createIdentityTopUpTransition } = require('dash/build/src/SDK/C const { default: createAssetLockTransaction } = require('dash/build/src/SDK/Client/Platform/createAssetLockTransaction'); const { PrivateKey } = require('@dashevo/dashcore-lib'); +const { StateTransitionBroadcastError } = require('dash/build/src/errors/StateTransitionBroadcastError'); +const InvalidInstantAssetLockProofSignatureError = require('@dashevo/dpp/lib/errors/consensus/basic/identity/InvalidInstantAssetLockProofSignatureError'); +const IdentityAssetLockTransactionOutPointAlreadyExistsError = require('@dashevo/dpp/lib/errors/consensus/basic/identity/IdentityAssetLockTransactionOutPointAlreadyExistsError'); +const BalanceIsNotEnoughError = require('@dashevo/dpp/lib/errors/consensus/fee/BalanceIsNotEnoughError'); +const IdentityPublicKeyAlreadyExistsError = require('@dashevo/dpp/lib/errors/consensus/state/identity/IdentityPublicKeyAlreadyExistsError'); + const waitForBlocks = require('../../../lib/waitForBlocks'); const waitForBalanceToChange = require('../../../lib/test/waitForBalanceToChange'); @@ -89,9 +95,10 @@ describe('Platform', () => { broadcastError = e; } - expect(broadcastError).to.exist(); - expect(broadcastError.message).to.be.equal('3 INVALID_ARGUMENT: Invalid instant lock proof signature'); - expect(broadcastError.code).to.be.equal(1042); + expect(broadcastError).to.be.an.instanceOf(StateTransitionBroadcastError); + expect(broadcastError.getCause()).to.be.an.instanceOf( + InvalidInstantAssetLockProofSignatureError, + ); }); it('should fail to create an identity with already used asset lock output', async () => { @@ -142,9 +149,10 @@ describe('Platform', () => { broadcastError = e; } - expect(broadcastError).to.exist(); - expect(broadcastError.message).to.satisfy((msg) => msg.startsWith('3 INVALID_ARGUMENT: Asset lock transaction')); - expect(broadcastError.code).to.be.equal(1033); + expect(broadcastError).to.be.an.instanceOf(StateTransitionBroadcastError); + expect(broadcastError.getCause()).to.be.an.instanceOf( + IdentityAssetLockTransactionOutPointAlreadyExistsError, + ); }); it('should fail to create an identity with already used public key', async () => { @@ -184,7 +192,9 @@ describe('Platform', () => { expect(broadcastError).to.exist(); expect(broadcastError.message).to.be.equal(`Identity public key ${identity.getPublicKeyById(0).hash().toString('hex')} already exists`); - expect(broadcastError.code).to.be.equal(4012); + expect(broadcastError.getCause()).to.be.an.instanceOf( + IdentityPublicKeyAlreadyExistsError, + ); }); it('should be able to get newly created identity', async () => { @@ -350,12 +360,10 @@ describe('Platform', () => { broadcastError = e; } - expect(broadcastError).to.exist(); - expect( - /FAILED_PRECONDITION: Failed precondition: Current credits balance \d* is not enough to pay \d* fee/ - .test(broadcastError.message), - ).to.be.true(); - expect(broadcastError.code).to.be.equal(3000); + expect(broadcastError).to.be.an.instanceOf(StateTransitionBroadcastError); + expect(broadcastError.getCause()).to.be.an.instanceOf( + BalanceIsNotEnoughError, + ); }); it.skip('should fail top-up if instant lock is not valid', async () => { @@ -474,9 +482,10 @@ describe('Platform', () => { broadcastError = e; } - expect(broadcastError).to.exist(); - expect(broadcastError.message).to.satisfy((msg) => msg.startsWith('3 INVALID_ARGUMENT: Asset lock transaction')); - expect(broadcastError.code).to.be.equal(1033); + expect(broadcastError).to.be.an.instanceOf(StateTransitionBroadcastError); + expect(broadcastError.getCause()).to.be.an.instanceOf( + IdentityAssetLockTransactionOutPointAlreadyExistsError, + ); }); });