Skip to content

Commit

Permalink
Merge branch 'v1.0-dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
shumkov committed Nov 24, 2023
2 parents 4b25aa5 + fadd522 commit 5262866
Show file tree
Hide file tree
Showing 176 changed files with 3,546 additions and 37,827 deletions.
18 changes: 18 additions & 0 deletions Cargo.lock

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

8 changes: 6 additions & 2 deletions packages/dapi-grpc/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub fn generate() -> Result<(), std::io::Error> {
// Derive features for versioned messages
//
// "GetConsensusParamsRequest" is excluded as this message does not support proofs
const VERSIONED_REQUESTS: [&str; 13] = [
const VERSIONED_REQUESTS: [&str; 15] = [
"GetDataContractHistoryRequest",
"GetDataContractRequest",
"GetDataContractsRequest",
Expand All @@ -48,10 +48,12 @@ pub fn generate() -> Result<(), std::io::Error> {
"GetIdentityRequest",
"GetProofsRequest",
"WaitForStateTransitionResultRequest",
"GetProtocolVersionUpgradeStateRequest",
"GetProtocolVersionUpgradeVoteStatusRequest",
];

// "GetConsensusParamsResponse" is excluded as this message does not support proofs
const VERSIONED_RESPONSES: [&str; 14] = [
const VERSIONED_RESPONSES: [&str; 16] = [
"GetDataContractHistoryResponse",
"GetDataContractResponse",
"GetDataContractsResponse",
Expand All @@ -66,6 +68,8 @@ pub fn generate() -> Result<(), std::io::Error> {
"GetProofsResponse",
"WaitForStateTransitionResultResponse",
"GetEpochsInfoResponse",
"GetProtocolVersionUpgradeStateResponse",
"GetProtocolVersionUpgradeVoteStatusResponse",
];

// Derive VersionedGrpcMessage on requests
Expand Down
14 changes: 14 additions & 0 deletions packages/dapi-grpc/src/platform/proto/org.dash.platform.dapi.v0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1537,6 +1537,8 @@ pub mod get_consensus_params_response {
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(::dapi_grpc_macros::VersionedGrpcMessage)]
#[grpc_versions(0)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetProtocolVersionUpgradeStateRequest {
Expand Down Expand Up @@ -1566,6 +1568,11 @@ pub mod get_protocol_version_upgrade_state_request {
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(
::dapi_grpc_macros::VersionedGrpcMessage,
::dapi_grpc_macros::VersionedGrpcResponse
)]
#[grpc_versions(0)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetProtocolVersionUpgradeStateResponse {
Expand Down Expand Up @@ -1633,6 +1640,8 @@ pub mod get_protocol_version_upgrade_state_response {
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(::dapi_grpc_macros::VersionedGrpcMessage)]
#[grpc_versions(0)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetProtocolVersionUpgradeVoteStatusRequest {
Expand Down Expand Up @@ -1669,6 +1678,11 @@ pub mod get_protocol_version_upgrade_vote_status_request {
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(
::dapi_grpc_macros::VersionedGrpcMessage,
::dapi_grpc_macros::VersionedGrpcResponse
)]
#[grpc_versions(0)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetProtocolVersionUpgradeVoteStatusResponse {
Expand Down
47 changes: 32 additions & 15 deletions packages/dashpay-contract/schema/dashpay.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,34 @@
"avatarUrl": {
"type": "string",
"format": "uri",
"maxLength": 2048
"maxLength": 2048,
"position": 0
},
"avatarHash": {
"type": "array",
"byteArray": true,
"minItems": 32,
"maxItems": 32,
"description": "SHA256 hash of the bytes of the image specified by avatarUrl"
"description": "SHA256 hash of the bytes of the image specified by avatarUrl",
"position": 1
},
"avatarFingerprint": {
"type": "array",
"byteArray": true,
"minItems": 8,
"maxItems": 8,
"description": "dHash the image specified by avatarUrl"
"description": "dHash the image specified by avatarUrl",
"position": 2
},
"publicMessage": {
"type": "string",
"maxLength": 140
"maxLength": 140,
"position": 3
},
"displayName": {
"type": "string",
"maxLength": 25
"maxLength": 25,
"position": 4
}
},
"required": [
Expand Down Expand Up @@ -93,21 +98,25 @@
"type": "array",
"byteArray": true,
"minItems": 32,
"maxItems": 32
"maxItems": 32,
"position": 0
},
"rootEncryptionKeyIndex": {
"type": "integer",
"minimum": 0
"minimum": 0,
"position": 1
},
"derivationEncryptionKeyIndex": {
"type": "integer",
"minimum": 0
"minimum": 0,
"position": 2
},
"privateData": {
"type": "array",
"byteArray": true,
"minItems": 48,
"maxItems": 2048,
"position": 3,
"description": "This is the encrypted values of aliasName + note + displayHidden encoded as an array in cbor"
}
},
Expand Down Expand Up @@ -181,41 +190,49 @@
"byteArray": true,
"minItems": 32,
"maxItems": 32,
"position": 0,
"contentMediaType": "application/x.dash.dpp.identifier"
},
"encryptedPublicKey": {
"type": "array",
"byteArray": true,
"minItems": 96,
"maxItems": 96
"maxItems": 96,
"position": 1
},
"senderKeyIndex": {
"type": "integer",
"minimum": 0
"minimum": 0,
"position": 2
},
"recipientKeyIndex": {
"type": "integer",
"minimum": 0
"minimum": 0,
"position": 3
},
"accountReference": {
"type": "integer",
"minimum": 0
"minimum": 0,
"position": 4
},
"encryptedAccountLabel": {
"type": "array",
"byteArray": true,
"minItems": 48,
"maxItems": 80
"maxItems": 80,
"position": 5
},
"autoAcceptProof": {
"type": "array",
"byteArray": true,
"minItems": 38,
"maxItems": 102
"maxItems": 102,
"position": 6
},
"coreHeightCreatedAt": {
"type": "integer",
"minimum": 1
"minimum": 1,
"position": 7
}
},
"required": [
Expand Down
18 changes: 15 additions & 3 deletions packages/dpns-contract/schema/dpns-contract-documents.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@
"pattern": "^[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]$",
"minLength": 3,
"maxLength": 63,
"position": 0,
"description": "Domain label. e.g. 'Bob'."
},
"normalizedLabel": {
"type": "string",
"pattern": "^[a-hj-km-np-z0-9][a-hj-km-np-z0-9-]{0,61}[a-hj-km-np-z0-9]$",
"maxLength": 63,
"position": 1,
"description": "Domain label converted to lowercase for case-insensitive uniqueness validation. \"o\", \"i\" and \"l\" replaced with \"0\" and \"1\" to mitigate homograph attack. e.g. 'b0b'",
"$comment": "Must be equal to the label in lowercase. \"o\", \"i\" and \"l\" must be replaced with \"0\" and \"1\"."
},
Expand All @@ -52,13 +54,15 @@
"pattern": "^$|^[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]$",
"minLength": 0,
"maxLength": 63,
"position": 2,
"description": "A full parent domain name. e.g. 'dash'."
},
"normalizedParentDomainName": {
"type": "string",
"pattern": "^$|^[a-hj-km-np-z0-9][a-hj-km-np-z0-9-\\.]{0,61}[a-hj-km-np-z0-9]$",
"minLength": 0,
"maxLength": 63,
"position": 3,
"description": "A parent domain name in lowercase for case-insensitive uniqueness validation. \"o\", \"i\" and \"l\" replaced with \"0\" and \"1\" to mitigate homograph attack. e.g. 'dash'",
"$comment": "Must either be equal to an existing domain or empty to create a top level domain. \"o\", \"i\" and \"l\" must be replaced with \"0\" and \"1\". Only the data contract owner can create top level domains."
},
Expand All @@ -67,6 +71,7 @@
"byteArray": true,
"minItems": 32,
"maxItems": 32,
"position": 4,
"description": "Salt used in the preorder document"
},
"records": {
Expand All @@ -77,34 +82,40 @@
"byteArray": true,
"minItems": 32,
"maxItems": 32,
"position": 0,
"contentMediaType": "application/x.dash.dpp.identifier",
"description": "Identity ID to be used to create the primary name the Identity",
"$comment": "Must be equal to the document owner"

},
"dashAliasIdentityId": {
"type": "array",
"byteArray": true,
"minItems": 32,
"maxItems": 32,
"position": 1,
"contentMediaType": "application/x.dash.dpp.identifier",
"description": "Identity ID to be used to create alias names for the Identity",
"$comment": "Must be equal to the document owner"
}
},
"$comment": "Constraint with max and min properties ensure that only one identity record is used - either a `dashUniqueIdentityId` or a `dashAliasIdentityId`",
"minProperties": 1,
"maxProperties": 1,
"additionalProperties": false
"position": 5,
"additionalProperties": false,
"$comment": "Constraint with max and min properties ensure that only one identity record is used - either a `dashUniqueIdentityId` or a `dashAliasIdentityId`"
},
"subdomainRules": {
"type": "object",
"properties": {
"allowSubdomains": {
"type": "boolean",
"description": "This option defines who can create subdomains: true - anyone; false - only the domain owner",
"$comment": "Only the domain owner is allowed to create subdomains for non top-level domains"
"$comment": "Only the domain owner is allowed to create subdomains for non top-level domains",
"position": 0
}
},
"position": 6,
"description": "Subdomain rules allow domain owners to define rules for subdomains",
"additionalProperties": false,
"required": ["allowSubdomains"]
Expand Down Expand Up @@ -140,6 +151,7 @@
"byteArray": true,
"minItems": 32,
"maxItems": 32,
"position": 0,
"description": "Double sha-256 of the concatenation of a 32 byte random salt and a normalized domain name"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ describe('Client - Platform - Documents - .get()', () => {
contentMediaType: 'application/x.dash.dpp.identifier',
minItems: 32,
maxItems: 32,
position: 0,
},
anotherNested: {
type: 'object',
Expand All @@ -200,12 +201,15 @@ describe('Client - Platform - Documents - .get()', () => {
contentMediaType: 'application/x.dash.dpp.identifier',
minItems: 32,
maxItems: 32,
position: 0,
},
},
additionalProperties: false,
position: 1,
},
},
additionalProperties: false,
position: 0,
},
},
additionalProperties: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@
"byteArray": true,
"minItems": 32,
"maxItems": 32,
"contentMediaType": "application/x.dash.dpp.identifier"
"contentMediaType": "application/x.dash.dpp.identifier",
"position": 0
},
"percentage": {
"description": "Reward percentage to share",
"type": "integer",
"minimum": 1,
"maximum": 10000
"maximum": 10000,
"position": 1
}
},
"required": [
Expand Down
Loading

0 comments on commit 5262866

Please sign in to comment.