-
Notifications
You must be signed in to change notification settings - Fork 44
feat: integrate wallet contract #2345
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
Merged
Merged
Changes from 33 commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
24177fa
feat: hardcoded identity transfers in strategy tests
pauldelucia dacc6db
fix(drive): uncommitted state if db transaction fails (#2305)
shumkov 306b86c
fix(drive): apply batch is not using transaction in `remove_all_votes…
QuantumExplorer 99fe5fa
add comment
pauldelucia cee3098
Merge remote-tracking branch 'origin/v1.6-dev' into feat/hardcoded-id…
pauldelucia 0d3e091
comment
pauldelucia e421514
use into_iter instead of iter
pauldelucia 3d941ec
use current identities instead of hardcoded start identities
pauldelucia 4bc0a65
let transfer keys be any security level or key type
pauldelucia dc48827
fix
pauldelucia cafda11
feat: hardcoded identity transfers in strategy tests (#2312)
pauldelucia b86f4e0
Merge branch 'v1.6-dev' of github.com:dashpay/platform into v1.6-dev
shumkov ae97f47
ci: run devcontainers workflow only on push to master (#2295)
shumkov 48cca1a
ci: do not run test on push (#2308)
shumkov 7315c91
feat: add wallet contract
HashEngineering 2e16647
fix: remove unnecessary file
HashEngineering 08cb2e5
fix: set v1.5.1
HashEngineering e9b8601
fix: rename dpns_contract to wallet_contract
HashEngineering c265209
tests: fix validation
HashEngineering a5fefa6
Merge branch 'v1.6-dev' of https://github.com/dashpay/platform into f…
HashEngineering 6440612
fix: remove identityVerify document and tests
HashEngineering be4fe7f
feat: add wallet contract (#2314)
shumkov 91a8303
chore: remove junk
shumkov 19fbb51
chore: create wallet contract
shumkov eda1351
build: add wallet-contract
shumkov 97d9400
build: invalid platform path
shumkov ab81b55
docs: fix doc block
shumkov 39fe144
chore: re-export wallet contract
shumkov baea397
revert: unnecessary and broken refactoring
shumkov 0f2ea36
docs: remove wrong comment
shumkov 16534b0
refactor: remove unused param
shumkov d4ed535
docs: remove usage section
shumkov 8f9db89
fix: duplicated ID
shumkov c036d95
docs: update description
shumkov c18f02d
docs: remove usage
shumkov bf1769f
feat: add mutability flags
shumkov 03733de
refactor: rename contract
shumkov 4dd3feb
chore: update yarn
shumkov 837cbd7
ci: add wallet utils contract
shumkov 1182e54
build: fix wallet utils contract path
shumkov 7ec638b
chore: fix linter warning and tests
shumkov 233c582
test: add more tests
shumkov 4565ca3
ci: fix rs package name
shumkov 953c7b2
feat: make tx_metadata mutable
shumkov 33850fe
chore: change index name
shumkov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| { | ||
| "extends": "airbnb-base", | ||
| "rules": { | ||
| "no-plusplus": 0, | ||
| "eol-last": [ | ||
| "error", | ||
| "always" | ||
| ], | ||
| "class-methods-use-this": "off", | ||
| "curly": [ | ||
| "error", | ||
| "all" | ||
| ] | ||
| }, | ||
| "globals": { | ||
| "BigInt": true | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| require: test/bootstrap.js | ||
| recursive: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| [package] | ||
| name = "wallet-contract" | ||
| description = "Wallet data contract schema and tools" | ||
| version = "1.5.0" | ||
| edition = "2021" | ||
| rust-version.workspace = true | ||
| license = "MIT" | ||
|
|
||
| [dependencies] | ||
| thiserror = "1.0.64" | ||
| platform-version = { path = "../rs-platform-version" } | ||
| serde_json = { version = "1.0" } | ||
| platform-value = { path = "../rs-platform-value" } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| The MIT License (MIT) | ||
|
|
||
| Copyright (c) 2019 Dash Core Group, Inc. | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
| this software and associated documentation files (the "Software"), to deal in | ||
| the Software without restriction, including without limitation the rights to | ||
| use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
| the Software, and to permit persons to whom the Software is furnished to do so, | ||
| subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
| FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
| COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
| IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
| CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # Wallet Contract | ||
|
|
||
| [](https://github.com/dashpay/platform/actions/workflows/release.yml) | ||
| [](https://npmjs.org/package/@dashevo/wallet-contract) | ||
|
|
||
| JSON Contracts for Dash Wallet apps | ||
|
|
||
shumkov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ## Table of Contents | ||
|
|
||
| - [Install](#install) | ||
| - [Usage](#usage) | ||
| - [Contributing](#contributing) | ||
| - [License](#license) | ||
shumkov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
shumkov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ## Install | ||
|
|
||
| ```sh | ||
| npm install @dashevo/wallet-contract | ||
| ``` | ||
|
|
||
| ## Contributing | ||
|
|
||
| Feel free to dive in! [Open an issue](https://github.com/dashpay/platform/issues/new/choose) or submit PRs. | ||
|
|
||
| ## License | ||
|
|
||
| [MIT](LICENSE) © Dash Core Group, Inc. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| module.exports = { | ||
| ownerId: '11111111111111111111111111111111', | ||
| contractId: '7CSFGeF4WNzgDmx94zwvHkYaG3Dx4XEe5LFsFgJswLbm' | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| { | ||
| "name": "@dashevo/wallet-contract", | ||
| "version": "1.5.0", | ||
| "description": "A contract and helper scripts for Wallet DApp", | ||
| "scripts": { | ||
| "lint": "eslint .", | ||
| "test": "yarn run test:unit", | ||
| "test:unit": "mocha 'test/unit/**/*.spec.js'" | ||
| }, | ||
| "contributors": [ | ||
| { | ||
| "name": "Eric Britten", | ||
| "email": "[email protected]", | ||
| "url": "https://github.com/hashengineering" | ||
| } | ||
| ], | ||
| "license": "MIT", | ||
| "devDependencies": { | ||
| "@dashevo/wasm-dpp": "workspace:*", | ||
| "chai": "^4.3.10", | ||
| "dirty-chai": "^2.0.1", | ||
| "eslint": "^8.53.0", | ||
| "eslint-config-airbnb-base": "^15.0.0", | ||
| "eslint-plugin-import": "^2.29.0", | ||
| "mocha": "^10.2.0", | ||
| "sinon": "^17.0.1", | ||
| "sinon-chai": "^3.7.0" | ||
| } | ||
| } |
55 changes: 55 additions & 0 deletions
55
packages/wallet-contract/schema/v1/wallet-contract-documents.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| { | ||
| "txMetadata": { | ||
shumkov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "type": "object", | ||
| "indices": [ | ||
| { | ||
| "name": "ownerId", | ||
| "properties": [ | ||
| { | ||
| "$ownerId": "asc" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "name": "ownerIdAndCreatedAt", | ||
| "properties": [ | ||
| { | ||
| "$ownerId": "asc" | ||
| }, | ||
| { | ||
| "$createdAt": "asc" | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "properties": { | ||
| "keyIndex": { | ||
| "type": "integer", | ||
| "minimum": 0, | ||
| "description": "The index of the owners identity public key used to derive the encryption key.", | ||
shumkov marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| "position": 0 | ||
| }, | ||
| "encryptionKeyIndex": { | ||
| "type": "integer", | ||
| "minimum": 0, | ||
| "description": "The secondary index used to derive the encryption key that is used to encrypt and decrypt encryptedData.", | ||
| "position": 1 | ||
| }, | ||
| "encryptedMetadata": { | ||
| "type": "array", | ||
| "byteArray": true, | ||
| "minItems": 32, | ||
| "maxItems": 4096, | ||
QuantumExplorer marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "description": "encrypted metadata using AES-CBC-256", | ||
| "position": 2 | ||
| } | ||
| }, | ||
| "required": [ | ||
| "keyIndex", | ||
| "encryptionKeyIndex", | ||
| "encryptedMetadata", | ||
| "$createdAt" | ||
QuantumExplorer marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ], | ||
| "additionalProperties": false | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| use platform_version::version::FeatureVersion; | ||
|
|
||
| #[derive(thiserror::Error, Debug)] | ||
| pub enum Error { | ||
| /// Platform expected some specific versions | ||
| #[error("platform unknown version on {method}, received: {received}")] | ||
| UnknownVersionMismatch { | ||
| /// method | ||
| method: String, | ||
| /// the allowed versions for this method | ||
| known_versions: Vec<FeatureVersion>, | ||
| /// requested core height | ||
| received: FeatureVersion, | ||
| }, | ||
| #[error("schema deserialize error: {0}")] | ||
| InvalidSchemaJson(#[from] serde_json::Error), | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.