-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
revert(dpp): rs-dpp/schema is needed for js packages tests
- Loading branch information
Showing
21 changed files
with
1,039 additions
and
0 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
packages/rs-dpp/src/schema/data_contract/v0/stateTransition/dataContractCreate.json
This file contains 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,42 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"type": "object", | ||
"properties": { | ||
"version": { | ||
"type": "integer", | ||
"$comment": "Maximum is the latest protocol version" | ||
}, | ||
"type": { | ||
"type": "integer", | ||
"const": 0 | ||
}, | ||
"dataContract": { | ||
"type": "object" | ||
}, | ||
"entropy": { | ||
"type": "array", | ||
"byteArray": true, | ||
"minItems": 32, | ||
"maxItems": 32 | ||
}, | ||
"signaturePublicKeyId": { | ||
"type": "integer", | ||
"minimum": 0 | ||
}, | ||
"signature": { | ||
"type": "array", | ||
"byteArray": true, | ||
"minItems": 65, | ||
"maxItems": 96 | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"required": [ | ||
"version", | ||
"type", | ||
"dataContract", | ||
"entropy", | ||
"signaturePublicKeyId", | ||
"signature" | ||
] | ||
} |
35 changes: 35 additions & 0 deletions
35
packages/rs-dpp/src/schema/data_contract/v0/stateTransition/dataContractUpdate.json
This file contains 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,35 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"type": "object", | ||
"properties": { | ||
"version": { | ||
"type": "integer", | ||
"$comment": "Maximum is the latest protocol version" | ||
}, | ||
"type": { | ||
"type": "integer", | ||
"const": 4 | ||
}, | ||
"dataContract": { | ||
"type": "object" | ||
}, | ||
"signaturePublicKeyId": { | ||
"type": "integer", | ||
"minimum": 0 | ||
}, | ||
"signature": { | ||
"type": "array", | ||
"byteArray": true, | ||
"minItems": 65, | ||
"maxItems": 96 | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"required": [ | ||
"version", | ||
"type", | ||
"dataContract", | ||
"signaturePublicKeyId", | ||
"signature" | ||
] | ||
} |
This file contains 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,83 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"type": "object", | ||
"properties": { | ||
"$protocolVersion": { | ||
"type": "integer", | ||
"$comment": "Maximum is the latest protocol version" | ||
}, | ||
"$id": { | ||
"type": "array", | ||
"byteArray": true, | ||
"minItems": 32, | ||
"maxItems": 32, | ||
"contentMediaType": "application/x.dash.dpp.identifier" | ||
}, | ||
"$type": { | ||
"type": "string" | ||
}, | ||
"$revision": { | ||
"type": "integer", | ||
"minimum": 1 | ||
}, | ||
"$dataContractId": { | ||
"type": "array", | ||
"byteArray": true, | ||
"minItems": 32, | ||
"maxItems": 32, | ||
"contentMediaType": "application/x.dash.dpp.identifier" | ||
}, | ||
"$ownerId": { | ||
"type": "array", | ||
"byteArray": true, | ||
"minItems": 32, | ||
"maxItems": 32, | ||
"contentMediaType": "application/x.dash.dpp.identifier" | ||
}, | ||
"$createdAt": { | ||
"type": "integer", | ||
"minimum": 0 | ||
}, | ||
"$updatedAt": { | ||
"type": "integer", | ||
"minimum": 0 | ||
}, | ||
"$transferredAt": { | ||
"type": "integer", | ||
"minimum": 0 | ||
}, | ||
"$createdAtBlockHeight": { | ||
"type": "integer", | ||
"minimum": 0 | ||
}, | ||
"$updatedAtBlockHeight": { | ||
"type": "integer", | ||
"minimum": 0 | ||
}, | ||
"$transferredAtBlockHeight": { | ||
"type": "integer", | ||
"minimum": 0 | ||
}, | ||
"$createdAtCoreBlockHeight": { | ||
"type": "integer", | ||
"minimum": 0 | ||
}, | ||
"$updatedAtCoreBlockHeight": { | ||
"type": "integer", | ||
"minimum": 0 | ||
}, | ||
"$transferredAtCoreBlockHeight": { | ||
"type": "integer", | ||
"minimum": 0 | ||
} | ||
}, | ||
"required": [ | ||
"$protocolVersion", | ||
"$id", | ||
"$type", | ||
"$revision", | ||
"$dataContractId", | ||
"$ownerId" | ||
], | ||
"additionalProperties": false | ||
} |
34 changes: 34 additions & 0 deletions
34
packages/rs-dpp/src/schema/document/v0/stateTransition/documentTransition/base.json
This file contains 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,34 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"type": "object", | ||
"properties": { | ||
"$id": { | ||
"type": "array", | ||
"byteArray": true, | ||
"minItems": 32, | ||
"maxItems": 32, | ||
"contentMediaType": "application/x.dash.dpp.identifier" | ||
}, | ||
"$type": { | ||
"type": "string" | ||
}, | ||
"$action": { | ||
"type": "integer", | ||
"enum": [0, 1, 3] | ||
}, | ||
"$dataContractId": { | ||
"type": "array", | ||
"byteArray": true, | ||
"minItems": 32, | ||
"maxItems": 32, | ||
"contentMediaType": "application/x.dash.dpp.identifier" | ||
} | ||
}, | ||
"required": [ | ||
"$id", | ||
"$type", | ||
"$action", | ||
"$dataContractId" | ||
], | ||
"additionalProperties": false | ||
} |
24 changes: 24 additions & 0 deletions
24
packages/rs-dpp/src/schema/document/v0/stateTransition/documentTransition/create.json
This file contains 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,24 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"type": "object", | ||
"properties": { | ||
"$entropy": { | ||
"type": "array", | ||
"byteArray": true, | ||
"minItems": 32, | ||
"maxItems": 32 | ||
}, | ||
"$createdAt": { | ||
"type": "integer", | ||
"minimum": 0 | ||
}, | ||
"$updatedAt": { | ||
"type": "integer", | ||
"minimum": 0 | ||
} | ||
}, | ||
"required": [ | ||
"$entropy" | ||
], | ||
"additionalProperties": false | ||
} |
18 changes: 18 additions & 0 deletions
18
packages/rs-dpp/src/schema/document/v0/stateTransition/documentTransition/replace.json
This file contains 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 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"type": "object", | ||
"properties": { | ||
"$revision": { | ||
"type": "integer", | ||
"minimum": 1 | ||
}, | ||
"$updatedAt": { | ||
"type": "integer", | ||
"minimum": 0 | ||
} | ||
}, | ||
"required": [ | ||
"$revision" | ||
], | ||
"additionalProperties": false | ||
} |
48 changes: 48 additions & 0 deletions
48
packages/rs-dpp/src/schema/document/v0/stateTransition/documentsBatch.json
This file contains 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,48 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"type": "object", | ||
"properties": { | ||
"protocolVersion": { | ||
"type": "integer", | ||
"$comment": "Maximum is the latest protocol version" | ||
}, | ||
"type": { | ||
"type": "integer", | ||
"const": 1 | ||
}, | ||
"ownerId": { | ||
"type": "array", | ||
"byteArray": true, | ||
"minItems": 32, | ||
"maxItems": 32, | ||
"contentMediaType": "application/x.dash.dpp.identifier" | ||
}, | ||
"transitions": { | ||
"type": "array", | ||
"items": { | ||
"type": "object" | ||
}, | ||
"minItems": 1, | ||
"maxItems": 10 | ||
}, | ||
"signaturePublicKeyId": { | ||
"type": "integer", | ||
"minimum": 0 | ||
}, | ||
"signature": { | ||
"type": "array", | ||
"byteArray": true, | ||
"minItems": 65, | ||
"maxItems": 96 | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"required": [ | ||
"protocolVersion", | ||
"type", | ||
"ownerId", | ||
"transitions", | ||
"signaturePublicKeyId", | ||
"signature" | ||
] | ||
} |
This file contains 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 @@ | ||
pub mod v0; |
This file contains 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,40 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"type": "object", | ||
"properties": { | ||
"protocolVersion": { | ||
"type": "integer", | ||
"minimum": 0, | ||
"$comment": "Maximum is the latest protocol version" | ||
}, | ||
"id": { | ||
"type": "array", | ||
"byteArray": true, | ||
"minItems": 32, | ||
"maxItems": 32, | ||
"contentMediaType": "application/x.dash.dpp.identifier" | ||
}, | ||
"publicKeys": { | ||
"type": "array", | ||
"minItems": 1, | ||
"maxItems": 32, | ||
"uniqueItems": true | ||
}, | ||
"balance": { | ||
"type": "integer", | ||
"minimum": 0 | ||
}, | ||
"revision": { | ||
"type": "integer", | ||
"minimum": 0, | ||
"description": "Identity update revision" | ||
} | ||
}, | ||
"required": [ | ||
"protocolVersion", | ||
"id", | ||
"publicKeys", | ||
"balance", | ||
"revision" | ||
] | ||
} |
This file contains 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,46 @@ | ||
use serde_json::Value; | ||
|
||
pub const IDENTITY_JSON_STRING: &str = r#"{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"type": "object", | ||
"properties": { | ||
"protocolVersion": { | ||
"type": "integer", | ||
"minimum": 0, | ||
"$comment": "Maximum is the latest protocol version" | ||
}, | ||
"id": { | ||
"type": "array", | ||
"byteArray": true, | ||
"minItems": 32, | ||
"maxItems": 32, | ||
"contentMediaType": "application/x.dash.dpp.identifier" | ||
}, | ||
"publicKeys": { | ||
"type": "array", | ||
"minItems": 1, | ||
"maxItems": 32, | ||
"uniqueItems": true | ||
}, | ||
"balance": { | ||
"type": "integer", | ||
"minimum": 0 | ||
}, | ||
"revision": { | ||
"type": "integer", | ||
"minimum": 0, | ||
"description": "Identity update revision" | ||
} | ||
}, | ||
"required": [ | ||
"protocolVersion", | ||
"id", | ||
"publicKeys", | ||
"balance", | ||
"revision" | ||
] | ||
}"#; | ||
|
||
pub fn identity_json() -> Result<Value, serde_json::Error> { | ||
serde_json::from_str(IDENTITY_JSON_STRING) | ||
} |
This file contains 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,3 @@ | ||
pub use identity::identity_json; | ||
|
||
mod identity; |
Oops, something went wrong.