diff --git a/docs/transactions.md b/docs/transactions.md index 9d6ca2030..8b5d6ceb2 100644 --- a/docs/transactions.md +++ b/docs/transactions.md @@ -128,6 +128,7 @@ Adds a record about a Vendor. - companyLegalName: `string` - Legal name of the vendor company - companyPreferredName: `optional(string)` - Preferred name of the vendor company - vendorLandingPageURL: `optional(string)` - URL of the vendor's landing page + - schemaVersion: `optional(uint32)` - Schema version to support backward/forward compatability(default 1) - In State: `vendorinfo/VendorInfo/value/` - Who can send: - Account with a vendor role who has the matching Vendor ID @@ -147,6 +148,7 @@ Updates a record about a Vendor. - companyLegalName: `optional(string)` - Legal name of the vendor company - companyPreferredName: `optional(string)` - Preferred name of the vendor company - vendorLandingPageURL: `optional(string)` - URL of the vendor's landing page + - schemaVersion: `optional(uint32)` - Schema version to support backward/forward compatability(default 1) - In State: `vendorinfo/VendorInfo/value/` - Who can send: - Account with a vendor role who has the matching Vendor ID @@ -209,6 +211,7 @@ Not all fields can be edited (see `EDIT_MODEL`). - supportURL: `optional(string)` - URL that contains product specific web page that contains support details for the device model. - productURL: `optional(string)` - URL that contains product specific web page that contains details for the device model. - lsfURL: `optional(string)` - URL to the Localized String File of this product. + - schemaVersion: `optional(uint32)` - Schema version to support backward/forward compatability(default 1) - In State: - `model/Model/value//` - `model/VendorProducts/value/` @@ -254,6 +257,7 @@ All non-edited fields remain the same. - supportURL: `optional(string)` - URL that contains product specific web page that contains support details for the device model. - productURL: `optional(string)` - URL that contains product specific web page that contains details for the device model. - lsfURL: `optional(string)` - URL to the Localized String File of this product. + - schemaVersion: `optional(uint32)` - Schema version to support backward/forward compatability(default 1) - lsfRevision: `optional(uint32)` - LsfRevision is a monotonically increasing positive integer indicating the latest available version of Localized String File. - In State: `model/Model/value//` - Who can send: @@ -305,6 +309,7 @@ If one of `OTA_URl`, `OTA_checksum` or `OTA_checksum_type` fields is set, then t - otaChecksum `optional(string)` - Digest of the entire contents of the associated OTA Software Update Image under the OtaUrl attribute, encoded in base64 string representation. The digest SHALL have been computed using the algorithm specified in OtaChecksumType - otaChecksumType `optional(string)` - Numeric identifier as defined in IANA Named Information Hash Algorithm Registry for the type of otaChecksum. For example, a value of 1 would match the sha-256 identifier, which maps to the SHA-256 digest algorithm - releaseNotesURL `optional(string)` - URL that contains product specific web page that contains release notes for the device model. + - schemaVersion: `optional(uint32)` - Schema version to support backward/forward compatability(default 1) - In State: - `model/ModelVersion/value///` - `model/ModelVersions/value//` @@ -351,6 +356,7 @@ All non-edited fields remain the same. - otaURL `optional(string)` - URL where to obtain the OTA image - otaFileSize `optional(string)` - OtaFileSize is the total size of the OTA software image in bytes - otaChecksum `optional(string)` - Digest of the entire contents of the associated OTA Software Update Image under the OtaUrl attribute, encoded in base64 string representation. The digest SHALL have been computed using the algorithm specified in OtaChecksumType + - schemaVersion: `optional(uint32)` - Schema version to support backward/forward compatability(default 1) - In State: `model/ModelVersion/value///` - Who can send: @@ -488,6 +494,7 @@ from the revocation list. - transport `optional(string)` - optional field describing the transport - parentChild `optional(string)` - optional field describing the parent/child - Currently 'parent' and 'child' types are supported - certificationIDOfSoftwareComponent `optional(string)` - optional field describing the certification ID of software component + - schemaVersion: `optional(uint32)` - Schema version to support backward/forward compatability(default 1) - In State: - `compliance/ComplianceInfo/value////` - `compliance/CertifiedModel/value////` @@ -525,6 +532,7 @@ Updates a compliance info by VID, PID, Software Version and Certification Type. - transport `optional(string)` - optional field describing the transport - parentChild `optional(string)` - optional field describing the parent/child - Currently 'parent' and 'child' types are supported - certificationIDOfSoftwareComponent `optional(string)` - optional field describing the certification ID of software component + - schemaVersion: `optional(uint32)` - Schema version to support backward/forward compatability(default 1) - Who can send: - CertificationCenter - CLI command: @@ -572,6 +580,7 @@ is written on the ledger (`CERTIFY_MODEL` was called), or - revocationDate: `string` - The date of model revocation (rfc3339 encoded), for example 2019-10-12T07:20:50.52Z - certificationType: `string` - Certification type - Currently 'zigbee' and 'matter', 'access control', 'product security' types are supported - reason `optional(string)` - optional comment describing the reason of revocation + - schemaVersion: `optional(uint32)` - Schema version to support backward/forward compatability(default 1) - In State: - `compliance/ComplianceInfo/value////` - `compliance/RevokedModel/value////` @@ -611,6 +620,7 @@ Can not be set if there is already a certification record on the ledger (certifi - transport `optional(string)` - optional field describing the transport - parentChild `optional(string)` - optional field describing the parent/child - Currently 'parent' and 'child' types are supported - certificationIDOfSoftwareComponent `optional(string)` - optional field describing the certification ID of software component + - schemaVersion: `optional(uint32)` - Schema version to support backward/forward compatability(default 1) - In State: - `compliance/ComplianceInfo/value////` - `compliance/ProvisionalModel/value////` @@ -831,6 +841,7 @@ The certificate is immutable. It can only be revoked by either the owner or a qu - cert: `string` - PEM encoded certificate. The corresponding CLI parameter can contain either a PEM string or a path to a file containing the data. - info: `optional(string)` - information/notes for the proposal - time: `optional(int64)` - proposal time (number of nanoseconds elapsed since January 1, 1970 UTC). CLI uses the current time for that field. + - schemaVersion: `optional(uint32)` - Schema version to support backward/forward compatability(default 1) - In State: `pki/ProposedCertificate/value//` - Who can send: - Trustee @@ -913,6 +924,7 @@ The certificate is immutable. It can only be revoked by either the owner or a qu - `vid` field associated with the corresponding PAA on the ledger must be equal to the Vendor account's VID. - Parameters: - cert: `string` - PEM encoded certificate. The corresponding CLI parameter can contain either a PEM string or a path to a file containing the data. + - schemaVersion: `optional(uint32)` - Schema version to support backward/forward compatability(default 1) - In State: - `pki/ApprovedCertificates/value//` - `pki/ChildCertificates/value//` @@ -1145,6 +1157,7 @@ This transaction adds a NOC root certificate owned by the Vendor. - the signature (self-signature) and expiration date must be valid. - Parameters: - cert: `string` - The NOC Root Certificate, encoded in X.509v3 PEM format. Can be a PEM string or a file path. + - schemaVersion: `optional(uint32)` - Schema version to support backward/forward compatability(default 1) - In State: - `pki/ApprovedCertificates/value//` - `pki/ApprovedCertificatesBySubject/value/` @@ -1175,6 +1188,7 @@ already present on the ledger. - the signature (self-signature) and expiration date must be valid. - Parameters: - cert: `string` - The NOC non-root Certificate, encoded in X.509v3 PEM format. Can be a PEM string or a file path. + - schemaVersion: `optional(uint32)` - Schema version to support backward/forward compatability(default 1) - In State: - `pki/ApprovedCertificates/value//` - `pki/ApprovedCertificatesBySubject/value/` diff --git a/integration_tests/cli/compliance-demo.sh b/integration_tests/cli/compliance-demo.sh index 5685e7c60..88fe69df1 100755 --- a/integration_tests/cli/compliance-demo.sh +++ b/integration_tests/cli/compliance-demo.sh @@ -44,7 +44,8 @@ zigbee_certification_type="zigbee" matter_certification_type="matter" cd_certificate_id="123" cd_version_number=1 - +schema_version_1=1 +schema_version_2=2 echo "Certify unknown Model with VID: $vid PID: $pid SV: ${sv} with zigbee certification" result=$(echo "$passphrase" | dcld tx compliance certify-model --vid=$vid --pid=$pid --softwareVersion=$sv --softwareVersionString=$svs --certificationType="$zigbee_certification_type" --certificationDate="$certification_date" --cdCertificateId="$cd_certificate_id" --from $zb_account --yes) echo "$result" @@ -182,7 +183,7 @@ check_response "$result" "ledger does not have matching CDVersionNumber=0: model test_divider echo "Certify Model with VID: $vid PID: $pid SV: ${sv} with zigbee certification" -result=$(echo "$passphrase" | dcld tx compliance certify-model --vid=$vid --pid=$pid --softwareVersion=$sv --softwareVersionString=$svs --certificationType="$zigbee_certification_type" --certificationDate="$certification_date" --cdCertificateId="$cd_certificate_id" --cdVersionNumber=$cd_version_number --from $zb_account --yes) +result=$(echo "$passphrase" | dcld tx compliance certify-model --vid=$vid --pid=$pid --softwareVersion=$sv --softwareVersionString=$svs --certificationType="$zigbee_certification_type" --certificationDate="$certification_date" --cdCertificateId="$cd_certificate_id" --cdVersionNumber=$cd_version_number --schemaVersion=$schema_version_2 --from $zb_account --yes) echo "$result" check_response "$result" "\"code\": 0" @@ -276,6 +277,7 @@ check_response "$result" "\"softwareVersionCertificationStatus\": 2" check_response "$result" "\"cDCertificateId\": \"$cd_certificate_id\"" check_response "$result" "\"date\": \"$certification_date\"" check_response "$result" "\"certificationType\": \"$zigbee_certification_type\"" +check_response "$result" "\"schemaVersion\": $schema_version_2" echo "$result" test_divider @@ -288,6 +290,7 @@ check_response "$result" "\"softwareVersionCertificationStatus\": 2" check_response "$result" "\"cDCertificateId\": \"$cd_certificate_id\"" check_response "$result" "\"date\": \"$certification_date\"" check_response "$result" "\"certificationType\": \"$matter_certification_type\"" +check_response "$result" "\"schemaVersion\": $schema_version_1" echo "$result" test_divider @@ -728,9 +731,10 @@ upd_supported_clusters="brand_new_clusters" upd_os_version="brand_new_os_version" upd_parent_child="parent" upd_certification_id_of_software_component="brand_new_component" +schema_version_3=3 echo "Update Compliance Info for Model with VID: ${vid} PID: ${pid} SV: ${sv} for $zigbee_certification_type with all optional fields set" -result=$(echo "$passphrase" | dcld tx compliance update-compliance-info --vid=$vid --pid=$pid --softwareVersion=$sv --certificationType=$zigbee_certification_type --cdVersionNumber=$upd_cd_version_number --certificationDate=$upd_certification_date --reason=$upd_reason --cdCertificateId=$upd_cd_certificate_id --certificationRoute=$upd_certification_route --programType=$upd_program_type --programTypeVersion=$upd_program_type_version --compliantPlatformUsed=$upd_compliant_platform_used --compliantPlatformVersion=$upd_compliant_platform_version --transport=$upd_transport --familyId=$upd_familyID --supportedClusters=$upd_supported_clusters --OSVersion=$upd_os_version --parentChild=$upd_parent_child --certificationIDOfSoftwareComponent=$upd_certification_id_of_software_component --from=$zb_account --yes) +result=$(echo "$passphrase" | dcld tx compliance update-compliance-info --vid=$vid --pid=$pid --softwareVersion=$sv --certificationType=$zigbee_certification_type --cdVersionNumber=$upd_cd_version_number --certificationDate=$upd_certification_date --reason=$upd_reason --cdCertificateId=$upd_cd_certificate_id --certificationRoute=$upd_certification_route --programType=$upd_program_type --programTypeVersion=$upd_program_type_version --compliantPlatformUsed=$upd_compliant_platform_used --compliantPlatformVersion=$upd_compliant_platform_version --transport=$upd_transport --familyId=$upd_familyID --supportedClusters=$upd_supported_clusters --OSVersion=$upd_os_version --parentChild=$upd_parent_child --certificationIDOfSoftwareComponent=$upd_certification_id_of_software_component --schemaVersion=$schema_version_3 --from=$zb_account --yes) echo "$result" echo "Compliance Info for Model with VID: ${vid} PID: ${pid} SV: ${sv} for $zigbee_certification_type all fields updated" @@ -754,6 +758,8 @@ check_response "$result" "\"supportedClusters\": \"$upd_supported_clusters\"" check_response "$result" "\"OSVersion\": \"$upd_os_version\"" check_response "$result" "\"parentChild\": \"$upd_parent_child\"" check_response "$result" "\"certificationIdOfSoftwareComponent\": \"$upd_certification_id_of_software_component\"" +check_response "$result" "\"schemaVersion\": $schema_version_3" + test_divider diff --git a/integration_tests/cli/compliance-provisioning.sh b/integration_tests/cli/compliance-provisioning.sh index 380810655..6c7a52425 100755 --- a/integration_tests/cli/compliance-provisioning.sh +++ b/integration_tests/cli/compliance-provisioning.sh @@ -40,6 +40,8 @@ certification_type_matter="matter" provision_date="2020-02-02T02:20:20Z" provision_reason="some reason" cd_certificate_id="123" +schema_version_1=1 +schema_version_2=2 test_divider @@ -47,7 +49,7 @@ echo "Add Model and a New Model Version with VID: $vid PID: $pid SV: $sv" create_model_and_version $vid $pid $sv $svs $vendor_account echo "Provision for uncertificate Model with VID: $vid PID: $pid for ZB" -result=$(echo "$passphrase" | dcld tx compliance provision-model --vid=$vid --pid=$pid --softwareVersion=$sv --softwareVersionString=$svs --certificationType="$certification_type_zb" --provisionalDate="$provision_date" --reason "$provision_reason" --cdCertificateId="$cd_certificate_id" --cdVersionNumber=1 --from $zb_account --yes) +result=$(echo "$passphrase" | dcld tx compliance provision-model --vid=$vid --pid=$pid --softwareVersion=$sv --softwareVersionString=$svs --certificationType="$certification_type_zb" --provisionalDate="$provision_date" --reason "$provision_reason" --cdCertificateId="$cd_certificate_id" --cdVersionNumber=1 --schemaVersion=$schema_version_2 --from $zb_account --yes) check_response "$result" "\"code\": 0" echo "$result" @@ -148,6 +150,7 @@ check_response "$result" "\"cDCertificateId\": \"$cd_certificate_id\"" check_response "$result" "\"date\": \"$provision_date\"" check_response "$result" "\"reason\": \"$provision_reason\"" check_response "$result" "\"certificationType\": \"$certification_type_zb\"" +check_response "$result" "\"schemaVersion\": $schema_version_2" check_response "$result" "\"history\"" echo "$result" @@ -162,6 +165,7 @@ check_response "$result" "\"date\": \"$provision_date\"" check_response "$result" "\"reason\": \"$provision_reason\"" check_response "$result" "\"certificationType\": \"$certification_type_matter\"" check_response "$result" "\"history\"" +check_response "$result" "\"schemaVersion\": $schema_version_1" echo "$result" test_divider diff --git a/integration_tests/cli/compliance-revocation.sh b/integration_tests/cli/compliance-revocation.sh index abc0447ed..d47e6293b 100755 --- a/integration_tests/cli/compliance-revocation.sh +++ b/integration_tests/cli/compliance-revocation.sh @@ -48,7 +48,9 @@ test_divider echo "Revoke Certification for uncertificate Model with VID: $vid PID: $pid" revocation_date="2020-02-02T02:20:20Z" revocation_reason="some reason" -result=$(echo "$passphrase" | dcld tx compliance revoke-model --vid=$vid --pid=$pid --softwareVersion=$sv --softwareVersionString=$svs --certificationType="$certification_type" --revocationDate="$revocation_date" --reason "$revocation_reason" --cdVersionNumber=1 --from $zb_account --yes) +schema_version_1=1 +schema_version_2=2 +result=$(echo "$passphrase" | dcld tx compliance revoke-model --vid=$vid --pid=$pid --softwareVersion=$sv --softwareVersionString=$svs --certificationType="$certification_type" --revocationDate="$revocation_date" --reason "$revocation_reason" --cdVersionNumber=1 --schemaVersion=$schema_version_2 --from $zb_account --yes) check_response "$result" "\"code\": 0" echo "$result" @@ -129,6 +131,7 @@ check_response "$result" "\"softwareVersionCertificationStatus\": 3" check_response "$result" "\"date\": \"$revocation_date\"" check_response "$result" "\"reason\": \"$revocation_reason\"" check_response "$result" "\"certificationType\": \"$certification_type\"" +check_response "$result" "\"schemaVersion\": $schema_version_2" check_response "$result" "\"history\"" echo "$result" @@ -142,6 +145,7 @@ check_response "$result" "\"softwareVersionCertificationStatus\": 3" check_response "$result" "\"date\": \"$revocation_date\"" check_response "$result" "\"reason\": \"$revocation_reason\"" check_response "$result" "\"certificationType\": \"$certification_type_matter\"" +check_response "$result" "\"schemaVersion\": $schema_version_1" check_response "$result" "\"history\"" echo "$result" diff --git a/integration_tests/cli/model-demo.sh b/integration_tests/cli/model-demo.sh index 6f804ad3e..0538e5dfa 100755 --- a/integration_tests/cli/model-demo.sh +++ b/integration_tests/cli/model-demo.sh @@ -58,8 +58,10 @@ echo "$result" test_divider productLabel="Device #1" +schema_version_1=1 +schema_version_2=2 echo "Add Model with VID: $vid PID: $pid" -result=$(echo "test1234" | dcld tx model add-model --vid=$vid --pid=$pid --deviceTypeID=1 --productName=TestProduct --productLabel="$productLabel" --partNumber=1 --commissioningCustomFlow=0 --from=$vendor_account --yes) +result=$(echo "test1234" | dcld tx model add-model --vid=$vid --pid=$pid --deviceTypeID=1 --productName=TestProduct --productLabel="$productLabel" --partNumber=1 --commissioningCustomFlow=0 --schemaVersion=$schema_version_2 --from=$vendor_account --yes) check_response "$result" "\"code\": 0" echo "$result" @@ -78,6 +80,15 @@ result=$(dcld query model get-model --vid=$vid --pid=$pid) check_response "$result" "\"vid\": $vid" check_response "$result" "\"pid\": $pid" check_response "$result" "\"productLabel\": \"$productLabel\"" +check_response "$result" "\"schemaVersion\": $schema_version_2" +echo "$result" + +echo "Get Model with VID: $vid_with_pids PID: $pid" +result=$(dcld query model get-model --vid=$vid_with_pids --pid=$pid) +check_response "$result" "\"vid\": $vid_with_pids" +check_response "$result" "\"pid\": $pid" +check_response "$result" "\"productLabel\": \"$productLabel\"" +check_response "$result" "\"schemaVersion\": $schema_version_1" echo "$result" test_divider @@ -115,7 +126,8 @@ test_divider echo "Update Model with VID: ${vid} PID: ${pid} with new description" description="New Device Description" -result=$(echo "test1234" | dcld tx model update-model --vid=$vid --pid=$pid --from $vendor_account --yes --productLabel "$description") +schema_version_3=3 +result=$(echo "test1234" | dcld tx model update-model --vid=$vid --pid=$pid --from $vendor_account --yes --productLabel "$description" --schemaVersion=$schema_version_3) check_response "$result" "\"code\": 0" echo "$result" @@ -133,6 +145,7 @@ result=$(dcld query model get-model --vid=$vid --pid=$pid) check_response "$result" "\"vid\": $vid" check_response "$result" "\"pid\": $pid" check_response "$result" "\"productLabel\": \"$description\"" +check_response "$result" "\"schemaVersion\": $schema_version_3" echo "$result" test_divider diff --git a/integration_tests/cli/modelversion-demo.sh b/integration_tests/cli/modelversion-demo.sh index 4a7fa98e2..9f6832598 100755 --- a/integration_tests/cli/modelversion-demo.sh +++ b/integration_tests/cli/modelversion-demo.sh @@ -27,7 +27,6 @@ create_new_vendor_account $vendor_account $vid # Create a new model version - echo "Add Model with VID: $vid PID: $pid" result=$(echo "test1234" | dcld tx model add-model --vid=$vid --pid=$pid --deviceTypeID=1 --productName=TestProduct --productLabel="Test Product" --partNumber=1 --commissioningCustomFlow=0 --from=$vendor_account --yes) check_response "$result" "\"code\": 0" @@ -35,8 +34,9 @@ check_response "$result" "\"code\": 0" test_divider sv=$RANDOM +schema_version_2=2 echo "Create a Device Model Version with VID: $vid PID: $pid SV: $sv" -result=$(echo 'test1234' | dcld tx model add-model-version --cdVersionNumber=1 --maxApplicableSoftwareVersion=10 --minApplicableSoftwareVersion=1 --vid=$vid --pid=$pid --softwareVersion=$sv --softwareVersionString=1 --from=$vendor_account --yes) +result=$(echo 'test1234' | dcld tx model add-model-version --cdVersionNumber=1 --maxApplicableSoftwareVersion=10 --minApplicableSoftwareVersion=1 --vid=$vid --pid=$pid --softwareVersion=$sv --softwareVersionString=1 --schemaVersion=$schema_version_2 --from=$vendor_account --yes) echo "$result" check_response "$result" "\"code\": 0" @@ -54,6 +54,7 @@ check_response "$result" "\"cdVersionNumber\": 1" check_response "$result" "\"softwareVersionValid\": true" check_response "$result" "\"minApplicableSoftwareVersion\": 1" check_response "$result" "\"maxApplicableSoftwareVersion\": 10" +check_response "$result" "\"schemaVersion\": $schema_version_2" test_divider @@ -86,9 +87,10 @@ check_response "$result" "Not Found" test_divider +schema_version_3=3 # Update the existing model version echo "Update Device Model Version with VID: $vid PID: $pid SV: $sv" -result=$(echo 'test1234' | dcld tx model update-model-version --vid=$vid --pid=$pid --minApplicableSoftwareVersion=2 --maxApplicableSoftwareVersion=10 --softwareVersion=$sv --softwareVersionValid=false --from=$vendor_account --yes) +result=$(echo 'test1234' | dcld tx model update-model-version --vid=$vid --pid=$pid --minApplicableSoftwareVersion=2 --maxApplicableSoftwareVersion=10 --softwareVersion=$sv --softwareVersionValid=false --schemaVersion=$schema_version_3 --from=$vendor_account --yes) check_response "$result" "\"code\": 0" test_divider @@ -105,6 +107,7 @@ check_response "$result" "\"cdVersionNumber\": 1" check_response "$result" "\"softwareVersionValid\": false" check_response "$result" "\"minApplicableSoftwareVersion\": 2" check_response "$result" "\"maxApplicableSoftwareVersion\": 10" +check_response "$result" "\"schemaVersion\": $schema_version_3" test_divider diff --git a/integration_tests/cli/pki-demo.sh b/integration_tests/cli/pki-demo.sh index ec0d2b231..9c922c166 100755 --- a/integration_tests/cli/pki-demo.sh +++ b/integration_tests/cli/pki-demo.sh @@ -187,11 +187,12 @@ test_divider echo "$user_account (Not Trustee) propose Root certificate" root_path="integration_tests/constants/root_cert" +schema_version_2=2 result=$(echo "$passphrase" | dcld tx pki propose-add-x509-root-cert --certificate="$root_path" --from $user_account --vid $vid --yes) response_does_not_contain "$result" "\"code\": 0" echo "$trustee_account (Trustee) propose Root certificate" -result=$(echo "$passphrase" | dcld tx pki propose-add-x509-root-cert --certificate="$root_path" --from $trustee_account --vid $vid --yes) +result=$(echo "$passphrase" | dcld tx pki propose-add-x509-root-cert --certificate="$root_path" --schemaVersion=$schema_version_2 --from $trustee_account --vid $vid --yes) check_response "$result" "\"code\": 0" test_divider @@ -201,7 +202,7 @@ result=$(dcld query pki all-proposed-x509-root-certs) echo $result | jq check_response "$result" "\"subject\": \"$root_cert_subject\"" check_response "$result" "\"subjectKeyId\": \"$root_cert_subject_key_id\"" - +check_response "$result" "\"schemaVersion\": $schema_version_2" test_divider @@ -384,7 +385,7 @@ test_divider echo "$vendor_account adds Intermediate certificate" intermediate_path="integration_tests/constants/intermediate_cert" -result=$(echo "$passphrase" | dcld tx pki add-x509-cert --certificate="$intermediate_path" --from $vendor_account --yes) +result=$(echo "$passphrase" | dcld tx pki add-x509-cert --certificate="$intermediate_path" --schemaVersion=$schema_version_2 --from $vendor_account --yes) check_response "$result" "\"code\": 0" @@ -397,6 +398,7 @@ check_response "$result" "\"subject\": \"$intermediate_cert_subject\"" check_response "$result" "\"subjectKeyId\": \"$intermediate_cert_subject_key_id\"" check_response "$result" "\"serialNumber\": \"$intermediate_cert_serial_number\"" check_response "$result" "\"subjectAsText\": \"$intermediate_cert_subject_as_text\"" +check_response "$result" "\"schemaVersion\": $schema_version_2" check_response "$result" "\"approvals\": \\[\\]" echo "Request Intermediate certificate by subjectKeyId - There are no approvals for Intermidiate Certificates" @@ -452,6 +454,7 @@ test_divider echo "$vendor_account add Leaf certificate" leaf_path="integration_tests/constants/leaf_cert" +schema_version_1=1 result=$(echo "$passphrase" | dcld tx pki add-x509-cert --certificate="$leaf_path" --from $vendor_account --yes) check_response "$result" "\"code\": 0" @@ -464,6 +467,7 @@ check_response "$result" "\"subject\": \"$leaf_cert_subject\"" check_response "$result" "\"subjectKeyId\": \"$leaf_cert_subject_key_id\"" check_response "$result" "\"serialNumber\": \"$leaf_cert_serial_number\"" check_response "$result" "\"subjectAsText\": \"$leaf_cert_subject_as_text\"" +check_response "$result" "\"schemaVersion\": $schema_version_1" check_response "$result" "\"approvals\": \\[\\]" echo "Request Leaf certificate by subjectKeyId - There is no approvals on leaf certificate" @@ -1179,6 +1183,7 @@ check_response "$result" "\"address\": \"$trustee_account_address\"" check_response "$result" "\"subjectKeyId\": \"$google_cert_subject_key_id\"" check_response "$result" "\"serialNumber\": \"$google_cert_serial_number\"" check_response "$result" "\"subjectAsText\": \"$google_cert_subject_as_text\"" +check_response "$result" "\"schemaVersion\": $schema_version_1" check_response "$result" "\"vid\": $google_cert_vid" echo $result | jq diff --git a/integration_tests/cli/pki-revocation-points.sh b/integration_tests/cli/pki-revocation-points.sh index e6e1778d9..e3abb9893 100755 --- a/integration_tests/cli/pki-revocation-points.sh +++ b/integration_tests/cli/pki-revocation-points.sh @@ -158,7 +158,8 @@ test_divider echo "9. ADD REVOCATION POINT FOR VID-SCOPED PAA" -result=$(dcld tx pki add-revocation-point --vid=$vid --is-paa="true" --certificate="$paa_cert_with_numeric_vid_path" --label="$label" --data-url="$data_url" --issuer-subject-key-id=$issuer_subject_key_id --revocation-type=1 --from=$vendor_account --yes) +schema_version_2=2 +result=$(dcld tx pki add-revocation-point --vid=$vid --is-paa="true" --certificate="$paa_cert_with_numeric_vid_path" --label="$label" --data-url="$data_url" --issuer-subject-key-id=$issuer_subject_key_id --revocation-type=1 --schemaVersion=$schema_version_2 --from=$vendor_account --yes) check_response "$result" "\"code\": 0" echo $result @@ -166,6 +167,7 @@ result=$(dcld query pki all-revocation-points) check_response "$result" "\"vid\": $vid" check_response "$result" "\"label\": \"$label\"" check_response "$result" "\"issuerSubjectKeyID\": \"$issuer_subject_key_id\"" +check_response "$result" "\"schemaVersion\": $schema_version_2" result=$(dcld query pki revocation-points --issuer-subject-key-id=$issuer_subject_key_id) check_response "$result" "\"vid\": $vid" @@ -294,8 +296,8 @@ echo $result test_divider echo "17. UPDATE REVOCATION POINT FOR VID-SCOPED PAA" - -result=$(dcld tx pki update-revocation-point --vid=$vid --certificate="$root_cert_path" --label="$label" --data-url="$data_url" --issuer-subject-key-id=$issuer_subject_key_id --from=$vendor_account --yes) +schema_version_3=3 +result=$(dcld tx pki update-revocation-point --vid=$vid --certificate="$root_cert_path" --label="$label" --data-url="$data_url" --issuer-subject-key-id=$issuer_subject_key_id --schemaVersion=$schema_version_3 --from=$vendor_account --yes) check_response "$result" "\"code\": 0" echo $result @@ -304,7 +306,7 @@ check_response "$result" "\"CrlSignerCertificate\": $(<$root_cert_path)" check_response "$result" "\"vid\": $vid" check_response "$result" "\"label\": \"$label\"" check_response "$result" "\"issuerSubjectKeyID\": \"$issuer_subject_key_id\"" - +check_response "$result" "\"schemaVersion\": $schema_version_3" test_divider echo "18. UPDATE REVOCATION POINT FOR NON-VID SCOPED PAA" diff --git a/integration_tests/cli/vendorinfo-demo.sh b/integration_tests/cli/vendorinfo-demo.sh index 7c8eeb288..53d19776f 100755 --- a/integration_tests/cli/vendorinfo-demo.sh +++ b/integration_tests/cli/vendorinfo-demo.sh @@ -50,7 +50,8 @@ test_divider echo "Create VendorInfo Record for VID: $vid" companyLegalName="XYZ IOT Devices Inc" vendorName="XYZ Devices" -result=$(echo "test1234" | dcld tx vendorinfo add-vendor --vid=$vid --companyLegalName="$companyLegalName" --vendorName="$vendorName" --from=$vendor_account --yes) +schema_version_2=2 +result=$(echo "test1234" | dcld tx vendorinfo add-vendor --vid=$vid --companyLegalName="$companyLegalName" --vendorName="$vendorName" --schemaVersion=$schema_version_2 --from=$vendor_account --yes) check_response "$result" "\"code\": 0" echo "$result" @@ -62,6 +63,7 @@ result=$(dcld query vendorinfo vendor --vid=$vid) check_response "$result" "\"vendorID\": $vid" check_response "$result" "\"companyLegalName\": \"$companyLegalName\"" check_response "$result" "\"vendorName\": \"$vendorName\"" +check_response "$result" "\"schemaVersion\": $schema_version_2" echo "$result" test_divider @@ -97,7 +99,8 @@ test_divider echo "Update vendor info record for VID: $vid" companyLegalName="ABC Subsidiary Corporation" vendorLandingPageURL="https://www.w3.org/" -result=$(echo "test1234" | dcld tx vendorinfo update-vendor --vid=$vid --companyLegalName="$companyLegalName" --vendorLandingPageURL=$vendorLandingPageURL --vendorName="$vendorName" --from=$vendor_account --yes) +schema_version_3=3 +result=$(echo "test1234" | dcld tx vendorinfo update-vendor --vid=$vid --companyLegalName="$companyLegalName" --vendorLandingPageURL=$vendorLandingPageURL --vendorName="$vendorName" --schemaVersion=$schema_version_3 --from=$vendor_account --yes) check_response "$result" "\"code\": 0" echo "$result" @@ -110,6 +113,7 @@ check_response "$result" "\"vendorID\": $vid" check_response "$result" "\"companyLegalName\": \"$companyLegalName\"" check_response "$result" "\"vendorName\": \"$vendorName\"" check_response "$result" "\"vendorLandingPageURL\": \"$vendorLandingPageURL\"" +check_response "$result" "\"schemaVersion\": $schema_version_3" echo "$result" test_divider diff --git a/integration_tests/constants/constants.go b/integration_tests/constants/constants.go index df67bac6c..2e2d521dc 100644 --- a/integration_tests/constants/constants.go +++ b/integration_tests/constants/constants.go @@ -174,6 +174,8 @@ var ( ValidHTTPSURL = "https://valid.url.com" ValidHTTPURL = "http://valid.url.com" NotAValidURL = "not a valid url" + + SchemaVersion uint32 = 1 ) /* diff --git a/proto/compliance/compliance_info.proto b/proto/compliance/compliance_info.proto index bc847b8be..2e3c2aa86 100644 --- a/proto/compliance/compliance_info.proto +++ b/proto/compliance/compliance_info.proto @@ -30,6 +30,6 @@ message ComplianceInfo { string OSVersion = 21; string parentChild = 22; string certificationIdOfSoftwareComponent = 23; - + uint32 schemaVersion = 24; } diff --git a/proto/compliance/device_software_compliance.proto b/proto/compliance/device_software_compliance.proto index 98b68dcae..fa3ff6a32 100644 --- a/proto/compliance/device_software_compliance.proto +++ b/proto/compliance/device_software_compliance.proto @@ -7,6 +7,5 @@ import "compliance/compliance_info.proto"; message DeviceSoftwareCompliance { string cDCertificateId = 1; - repeated ComplianceInfo complianceInfo = 2; - + repeated ComplianceInfo complianceInfo = 2; } diff --git a/proto/compliance/tx.proto b/proto/compliance/tx.proto index debf0538c..910a0c263 100644 --- a/proto/compliance/tx.proto +++ b/proto/compliance/tx.proto @@ -40,6 +40,7 @@ message MsgCertifyModel { string transport = 19 [(gogoproto.moretags) = "validate:\"max=64\""]; string parentChild = 20 [(gogoproto.moretags) = "validate:\"max=64\""]; string certificationIdOfSoftwareComponent = 21 [(gogoproto.moretags) = "validate:\"max=64\""]; + uint32 schemaVersion = 22; } message MsgCertifyModelResponse { @@ -55,6 +56,7 @@ message MsgRevokeModel { string revocationDate = 7 [(gogoproto.moretags) = "validate:\"required\""]; string certificationType = 8 [(gogoproto.moretags) = "validate:\"required,max=100\""]; string reason = 9 [(gogoproto.moretags) = "validate:\"max=102400\""]; + uint32 schemaVersion = 10; } message MsgRevokeModelResponse { @@ -82,6 +84,7 @@ message MsgProvisionModel { string transport = 19 [(gogoproto.moretags) = "validate:\"max=64\""]; string parentChild = 20 [(gogoproto.moretags) = "validate:\"max=64\""]; string certificationIdOfSoftwareComponent = 21 [(gogoproto.moretags) = "validate:\"max=64\""]; + uint32 schemaVersion = 22; } message MsgProvisionModelResponse { @@ -109,6 +112,7 @@ message MsgUpdateComplianceInfo { string OSVersion = 19 [(gogoproto.moretags) = "validate:\"omitempty,max=64\""]; string parentChild = 20 [(gogoproto.moretags) = "validate:\"omitempty,max=64\""]; string certificationIdOfSoftwareComponent = 21 [(gogoproto.moretags) = "validate:\"omitempty,max=64\""]; + uint32 schemaVersion = 22; } message MsgUpdateComplianceInfoResponse { diff --git a/proto/model/model.proto b/proto/model/model.proto index 0765405f3..75bcb7547 100644 --- a/proto/model/model.proto +++ b/proto/model/model.proto @@ -24,5 +24,6 @@ message Model { string lsfUrl = 16; int32 lsfRevision = 17; string creator = 18 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + uint32 schemaVersion = 19; } diff --git a/proto/model/model_version.proto b/proto/model/model_version.proto index 4f576fa4a..3196de8eb 100644 --- a/proto/model/model_version.proto +++ b/proto/model/model_version.proto @@ -21,5 +21,6 @@ message ModelVersion { uint32 maxApplicableSoftwareVersion = 13; string releaseNotesUrl = 14; string creator = 15 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + uint32 schemaVersion = 16; } diff --git a/proto/model/product.proto b/proto/model/product.proto index f1e1297bc..a14bf1524 100644 --- a/proto/model/product.proto +++ b/proto/model/product.proto @@ -7,5 +7,6 @@ message Product { int32 pid = 1; string name = 2; - string partNumber = 3; + string partNumber = 3; + uint32 schemaVersion = 4; } diff --git a/proto/model/tx.proto b/proto/model/tx.proto index c0a49b5e7..559bb5895 100644 --- a/proto/model/tx.proto +++ b/proto/model/tx.proto @@ -40,6 +40,7 @@ message MsgCreateModel { string supportUrl = 15 [(gogoproto.moretags) = "validate:\"omitempty,url,startsnotwith=http:,max=256\""]; string productUrl = 16 [(gogoproto.moretags) = "validate:\"omitempty,url,startsnotwith=http:,max=256\""]; string lsfUrl = 17 [(gogoproto.moretags) = "validate:\"omitempty,url,startsnotwith=http:,max=256\""]; + uint32 schemaVersion = 18; } message MsgCreateModelResponse {} @@ -58,7 +59,8 @@ message MsgUpdateModel { string supportUrl = 11 [(gogoproto.moretags) = "validate:\"omitempty,url,startsnotwith=http:,max=256\""]; string productUrl = 12 [(gogoproto.moretags) = "validate:\"omitempty,url,startsnotwith=http:,max=256\""]; string lsfUrl = 13 [(gogoproto.moretags) = "validate:\"omitempty,url,startsnotwith=http:,max=256\""]; - int32 lsfRevision = 14 [(gogoproto.moretags) = "validate:\"gte=0,lte=65535\""]; + int32 lsfRevision = 14 [(gogoproto.moretags) = "validate:\"gte=0,lte=65535\""]; + uint32 schemaVersion = 15; } message MsgUpdateModelResponse {} @@ -86,6 +88,7 @@ message MsgCreateModelVersion { uint32 minApplicableSoftwareVersion = 13; uint32 maxApplicableSoftwareVersion = 14 [(gogoproto.moretags) = "validate:\"gtecsfield=MinApplicableSoftwareVersion\""]; string releaseNotesUrl = 15 [(gogoproto.moretags) = "validate:\"omitempty,url,startsnotwith=http:,max=256\""]; + uint32 schemaVersion = 16; } message MsgCreateModelVersionResponse {} @@ -102,6 +105,7 @@ message MsgUpdateModelVersion { string releaseNotesUrl = 9 [(gogoproto.moretags) = "validate:\"omitempty,url,startsnotwith=http:,max=256\""]; uint64 otaFileSize = 10; string otaChecksum = 11 [(gogoproto.moretags) = "validate:\"max=64\""]; + uint32 schemaVersion = 12; } message MsgUpdateModelVersionResponse {} diff --git a/proto/pki/certificate.proto b/proto/pki/certificate.proto index 493832136..a021e7619 100644 --- a/proto/pki/certificate.proto +++ b/proto/pki/certificate.proto @@ -24,5 +24,6 @@ message Certificate { string subjectAsText = 12; repeated Grant rejects = 13; int32 vid = 14 [(gogoproto.moretags) = "validate:\"gte=1,lte=65535\""]; - bool isNoc = 15; + bool isNoc = 15; + uint32 schemaVersion = 16; } diff --git a/proto/pki/pki_revocation_distribution_point.proto b/proto/pki/pki_revocation_distribution_point.proto index 2aef749e9..7818ab4e2 100644 --- a/proto/pki/pki_revocation_distribution_point.proto +++ b/proto/pki/pki_revocation_distribution_point.proto @@ -14,7 +14,7 @@ message PkiRevocationDistributionPoint { uint64 dataFileSize = 8; string dataDigest = 9; uint32 dataDigestType = 10; - uint32 revocationType = 11; - + uint32 revocationType = 11; + uint32 schemaVersion = 12; } diff --git a/proto/pki/proposed_certificate.proto b/proto/pki/proposed_certificate.proto index ffed8e509..f1fd6edeb 100644 --- a/proto/pki/proposed_certificate.proto +++ b/proto/pki/proposed_certificate.proto @@ -17,5 +17,6 @@ message ProposedCertificate { string subjectAsText = 7; repeated Grant rejects = 8; int32 vid = 9 [(gogoproto.moretags) = "validate:\"gte=1,lte=65535\""]; + uint32 schemaVersion = 10; } diff --git a/proto/pki/tx.proto b/proto/pki/tx.proto index 6b72a046d..e04183719 100644 --- a/proto/pki/tx.proto +++ b/proto/pki/tx.proto @@ -35,6 +35,7 @@ message MsgProposeAddX509RootCert { string info = 3 [(gogoproto.moretags) = "validate:\"max=4096\""]; int64 time = 4; int32 vid = 5 [(gogoproto.moretags) = "validate:\"gte=1,lte=65535,required\""]; + uint32 schemaVersion = 6; } message MsgProposeAddX509RootCertResponse { @@ -56,6 +57,7 @@ message MsgAddX509Cert { string cert = 2 [(gogoproto.moretags) = "validate:\"required,max=10485760\""]; string info = 3 [(gogoproto.moretags) = "validate:\"max=4096\""]; int64 time = 4; + uint32 schemaVersion = 5; } message MsgAddX509CertResponse { @@ -123,6 +125,7 @@ message MsgAddPkiRevocationDistributionPoint { string dataDigest = 10; uint32 dataDigestType = 11; uint32 revocationType = 12 [(gogoproto.moretags) = "validate:\"required\""]; + uint32 schemaVersion = 13; } message MsgAddPkiRevocationDistributionPointResponse { @@ -138,6 +141,7 @@ message MsgUpdatePkiRevocationDistributionPoint { uint64 dataFileSize = 7; string dataDigest = 8; uint32 dataDigestType = 9; + uint32 schemaVersion = 10; } message MsgUpdatePkiRevocationDistributionPointResponse { @@ -166,6 +170,7 @@ message MsgAssignVidResponse { message MsgAddNocX509RootCert { string signer = 1 [(cosmos_proto.scalar) = "cosmos.AddressString", (gogoproto.moretags) = "validate:\"required\""]; string cert = 2 [(gogoproto.moretags) = "validate:\"required,max=10485760\""]; + uint32 schemaVersion = 3; } message MsgAddNocX509RootCertResponse { @@ -184,6 +189,7 @@ message MsgRemoveX509CertResponse { message MsgAddNocX509Cert { string signer = 1 [(cosmos_proto.scalar) = "cosmos.AddressString", (gogoproto.moretags) = "validate:\"required\""]; string cert = 2 [(gogoproto.moretags) = "validate:\"required,max=10485760\""]; + uint32 schemaVersion = 3; } message MsgAddNocX509CertResponse { diff --git a/proto/vendorinfo/tx.proto b/proto/vendorinfo/tx.proto index 2aa6f9f1c..6e223915f 100644 --- a/proto/vendorinfo/tx.proto +++ b/proto/vendorinfo/tx.proto @@ -23,6 +23,7 @@ message MsgCreateVendorInfo { string companyLegalName = 4 [(gogoproto.moretags) = "validate:\"required,max=256\""]; string companyPreferredName = 5 [(gogoproto.moretags) = "validate:\"omitempty,max=256\""]; string vendorLandingPageURL = 6 [(gogoproto.moretags) = "validate:\"omitempty,max=256,url\""]; + uint32 schemaVersion = 7; } message MsgCreateVendorInfoResponse {} @@ -34,6 +35,7 @@ message MsgUpdateVendorInfo { string companyLegalName = 4 [(gogoproto.moretags) = "validate:\"omitempty,max=256\""]; string companyPreferredName = 5 [(gogoproto.moretags) = "validate:\"omitempty,max=256\""]; string vendorLandingPageURL = 6 [(gogoproto.moretags) = "validate:\"omitempty,max=256,url\""]; + uint32 schemaVersion = 7; } message MsgUpdateVendorInfoResponse {} diff --git a/proto/vendorinfo/vendor_info.proto b/proto/vendorinfo/vendor_info.proto index ceae0bd81..bba53ecbf 100644 --- a/proto/vendorinfo/vendor_info.proto +++ b/proto/vendorinfo/vendor_info.proto @@ -12,5 +12,6 @@ message VendorInfo { string companyPreferredName = 4; string vendorLandingPageURL = 5; string creator = 6 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + uint32 schemaVersion = 7; } diff --git a/types/compliance/compliance_info.pb.go b/types/compliance/compliance_info.pb.go index 9bf9fd7c2..48c0c6a83 100644 --- a/types/compliance/compliance_info.pb.go +++ b/types/compliance/compliance_info.pb.go @@ -24,29 +24,30 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type ComplianceInfo struct { - Vid int32 `protobuf:"varint,1,opt,name=vid,proto3" json:"vid,omitempty"` - Pid int32 `protobuf:"varint,2,opt,name=pid,proto3" json:"pid,omitempty"` - SoftwareVersion uint32 `protobuf:"varint,3,opt,name=softwareVersion,proto3" json:"softwareVersion,omitempty"` - CertificationType string `protobuf:"bytes,4,opt,name=certificationType,proto3" json:"certificationType,omitempty"` - SoftwareVersionString string `protobuf:"bytes,5,opt,name=softwareVersionString,proto3" json:"softwareVersionString,omitempty"` - CDVersionNumber uint32 `protobuf:"varint,6,opt,name=cDVersionNumber,proto3" json:"cDVersionNumber,omitempty"` - SoftwareVersionCertificationStatus uint32 `protobuf:"varint,7,opt,name=softwareVersionCertificationStatus,proto3" json:"softwareVersionCertificationStatus,omitempty"` - Date string `protobuf:"bytes,8,opt,name=date,proto3" json:"date,omitempty"` - Reason string `protobuf:"bytes,9,opt,name=reason,proto3" json:"reason,omitempty"` - Owner string `protobuf:"bytes,10,opt,name=owner,proto3" json:"owner,omitempty"` - History []*ComplianceHistoryItem `protobuf:"bytes,11,rep,name=history,proto3" json:"history,omitempty"` - CDCertificateId string `protobuf:"bytes,12,opt,name=cDCertificateId,proto3" json:"cDCertificateId,omitempty"` - CertificationRoute string `protobuf:"bytes,13,opt,name=certificationRoute,proto3" json:"certificationRoute,omitempty"` - ProgramType string `protobuf:"bytes,14,opt,name=programType,proto3" json:"programType,omitempty"` - ProgramTypeVersion string `protobuf:"bytes,15,opt,name=programTypeVersion,proto3" json:"programTypeVersion,omitempty"` - CompliantPlatformUsed string `protobuf:"bytes,16,opt,name=compliantPlatformUsed,proto3" json:"compliantPlatformUsed,omitempty"` - CompliantPlatformVersion string `protobuf:"bytes,17,opt,name=compliantPlatformVersion,proto3" json:"compliantPlatformVersion,omitempty"` - Transport string `protobuf:"bytes,18,opt,name=transport,proto3" json:"transport,omitempty"` - FamilyId string `protobuf:"bytes,19,opt,name=familyId,proto3" json:"familyId,omitempty"` - SupportedClusters string `protobuf:"bytes,20,opt,name=supportedClusters,proto3" json:"supportedClusters,omitempty"` - OSVersion string `protobuf:"bytes,21,opt,name=OSVersion,proto3" json:"OSVersion,omitempty"` - ParentChild string `protobuf:"bytes,22,opt,name=parentChild,proto3" json:"parentChild,omitempty"` - CertificationIdOfSoftwareComponent string `protobuf:"bytes,23,opt,name=certificationIdOfSoftwareComponent,proto3" json:"certificationIdOfSoftwareComponent,omitempty"` + Vid int32 `protobuf:"varint,1,opt,name=vid,proto3" json:"vid,omitempty"` + Pid int32 `protobuf:"varint,2,opt,name=pid,proto3" json:"pid,omitempty"` + SoftwareVersion uint32 `protobuf:"varint,3,opt,name=softwareVersion,proto3" json:"softwareVersion,omitempty"` + CertificationType string `protobuf:"bytes,4,opt,name=certificationType,proto3" json:"certificationType,omitempty"` + SoftwareVersionString string `protobuf:"bytes,5,opt,name=softwareVersionString,proto3" json:"softwareVersionString,omitempty"` + CDVersionNumber uint32 `protobuf:"varint,6,opt,name=cDVersionNumber,proto3" json:"cDVersionNumber,omitempty"` + SoftwareVersionCertificationStatus uint32 `protobuf:"varint,7,opt,name=softwareVersionCertificationStatus,proto3" json:"softwareVersionCertificationStatus,omitempty"` + Date string `protobuf:"bytes,8,opt,name=date,proto3" json:"date,omitempty"` + Reason string `protobuf:"bytes,9,opt,name=reason,proto3" json:"reason,omitempty"` + Owner string `protobuf:"bytes,10,opt,name=owner,proto3" json:"owner,omitempty"` + History []*ComplianceHistoryItem `protobuf:"bytes,11,rep,name=history,proto3" json:"history,omitempty"` + CDCertificateId string `protobuf:"bytes,12,opt,name=cDCertificateId,proto3" json:"cDCertificateId,omitempty"` + CertificationRoute string `protobuf:"bytes,13,opt,name=certificationRoute,proto3" json:"certificationRoute,omitempty"` + ProgramType string `protobuf:"bytes,14,opt,name=programType,proto3" json:"programType,omitempty"` + ProgramTypeVersion string `protobuf:"bytes,15,opt,name=programTypeVersion,proto3" json:"programTypeVersion,omitempty"` + CompliantPlatformUsed string `protobuf:"bytes,16,opt,name=compliantPlatformUsed,proto3" json:"compliantPlatformUsed,omitempty"` + CompliantPlatformVersion string `protobuf:"bytes,17,opt,name=compliantPlatformVersion,proto3" json:"compliantPlatformVersion,omitempty"` + Transport string `protobuf:"bytes,18,opt,name=transport,proto3" json:"transport,omitempty"` + FamilyId string `protobuf:"bytes,19,opt,name=familyId,proto3" json:"familyId,omitempty"` + SupportedClusters string `protobuf:"bytes,20,opt,name=supportedClusters,proto3" json:"supportedClusters,omitempty"` + OSVersion string `protobuf:"bytes,21,opt,name=OSVersion,proto3" json:"OSVersion,omitempty"` + ParentChild string `protobuf:"bytes,22,opt,name=parentChild,proto3" json:"parentChild,omitempty"` + CertificationIdOfSoftwareComponent string `protobuf:"bytes,23,opt,name=certificationIdOfSoftwareComponent,proto3" json:"certificationIdOfSoftwareComponent,omitempty"` + SchemaVersion uint32 `protobuf:"varint,24,opt,name=schemaVersion,proto3" json:"schemaVersion,omitempty"` } func (m *ComplianceInfo) Reset() { *m = ComplianceInfo{} } @@ -243,6 +244,13 @@ func (m *ComplianceInfo) GetCertificationIdOfSoftwareComponent() string { return "" } +func (m *ComplianceInfo) GetSchemaVersion() uint32 { + if m != nil { + return m.SchemaVersion + } + return 0 +} + func init() { proto.RegisterType((*ComplianceInfo)(nil), "zigbeealliance.distributedcomplianceledger.compliance.ComplianceInfo") } @@ -250,45 +258,46 @@ func init() { func init() { proto.RegisterFile("compliance/compliance_info.proto", fileDescriptor_96709118384d66e8) } var fileDescriptor_96709118384d66e8 = []byte{ - // 601 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0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x72, 0x68, 0x1d, 0x16, 0x79, - 0x43, 0x76, 0x6b, 0x47, 0x46, 0x13, 0x8e, 0xec, 0x36, 0x0e, 0xec, 0x7a, 0x4f, 0x46, 0x9f, 0x27, - 0xfe, 0xa9, 0xc8, 0x8c, 0x0b, 0xd0, 0xc3, 0x15, 0xf7, 0x0d, 0x3d, 0xf9, 0x13, 0x00, 0x00, 0xff, - 0xff, 0x04, 0x7c, 0x3a, 0x53, 0x26, 0x05, 0x00, 0x00, + // 614 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xcb, 0x6e, 0x13, 0x31, + 0x14, 0xed, 0xd0, 0xb7, 0x4b, 0x5f, 0xa6, 0x2d, 0xa6, 0x42, 0x51, 0x54, 0xb1, 0xc8, 0x82, 0x4c, + 0x24, 0x1e, 0x1b, 0x76, 0x34, 0x2c, 0x88, 0x40, 0x2d, 0x9a, 0x00, 0x0b, 0x36, 0x95, 0x33, 0xbe, + 0x93, 0x58, 0x9a, 0xb1, 0x47, 0xb6, 0x87, 0x12, 0xbe, 0x82, 0x8f, 0x61, 0xc9, 0x07, 0xb0, 0xac, + 0x58, 0xb1, 0x44, 0xed, 0x8f, 0x20, 0xdb, 0x33, 0x9d, 0x34, 0x09, 0x52, 0xc5, 0xce, 0xf7, 0x9c, + 0xfb, 0x38, 0xf6, 0x3d, 0x33, 0xa8, 0x19, 0xcb, 0x2c, 0x4f, 0x39, 0x15, 0x31, 0x74, 0xea, 0xe3, + 0x19, 0x17, 0x89, 0x0c, 0x73, 0x25, 0x8d, 0xc4, 0xcf, 0xbf, 0xf2, 0xe1, 0x00, 0x80, 0xa6, 0x9e, + 0x0a, 0x19, 0xd7, 0x46, 0xf1, 0x41, 0x61, 0x80, 0xd5, 0x05, 0x29, 0xb0, 0x21, 0xa8, 0xb0, 0x06, + 0x0e, 0x5b, 0xf3, 0x1b, 0x8f, 0xb8, 0x36,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 0x4b, 0xd6, 0x90, 0x75, 0xf6, 0x8d, 0x0d, 0xf4, 0xd8, 0x69, 0xd2, 0x2f, 0x0d, + 0x6c, 0x0d, 0x20, 0x05, 0x08, 0x43, 0xee, 0xbb, 0xc2, 0x5b, 0x64, 0xe2, 0x47, 0x68, 0x53, 0xc7, + 0x23, 0xc8, 0x68, 0xa5, 0x89, 0xb8, 0x8f, 0xe2, 0x26, 0x78, 0x0c, 0x3f, 0x2f, 0x1b, 0xc1, 0xc5, + 0x65, 0x23, 0xf8, 0x73, 0xd9, 0x08, 0xbe, 0x5d, 0x35, 0x16, 0x2e, 0xae, 0x1a, 0x0b, 0xbf, 0xaf, + 0x1a, 0x0b, 0x9f, 0xde, 0x0c, 0xb9, 0x19, 0x15, 0x03, 0xeb, 0xc3, 0x8e, 0xb7, 0x6d, 0xbb, 0xf2, + 0x6d, 0x67, 0xc2, 0xb7, 0xed, 0xda, 0xa7, 0x6d, 0xef, 0xdc, 0xce, 0x97, 0x89, 0xbf, 0x59, 0xc7, + 0x8c, 0x73, 0xd0, 0x83, 0x15, 0xf7, 0xb3, 0x7a, 0xfa, 0x37, 0x00, 0x00, 0xff, 0xff, 0xda, 0xe4, + 0x3c, 0xef, 0x4c, 0x05, 0x00, 0x00, } func (m *ComplianceInfo) Marshal() (dAtA []byte, err error) { @@ -311,6 +320,13 @@ func (m *ComplianceInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.SchemaVersion != 0 { + i = encodeVarintComplianceInfo(dAtA, i, uint64(m.SchemaVersion)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xc0 + } if len(m.CertificationIdOfSoftwareComponent) > 0 { i -= len(m.CertificationIdOfSoftwareComponent) copy(dAtA[i:], m.CertificationIdOfSoftwareComponent) @@ -594,6 +610,9 @@ func (m *ComplianceInfo) Size() (n int) { if l > 0 { n += 2 + l + sovComplianceInfo(uint64(l)) } + if m.SchemaVersion != 0 { + n += 2 + sovComplianceInfo(uint64(m.SchemaVersion)) + } return n } @@ -1305,6 +1324,25 @@ func (m *ComplianceInfo) Unmarshal(dAtA []byte) error { } m.CertificationIdOfSoftwareComponent = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 24: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SchemaVersion", wireType) + } + m.SchemaVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowComplianceInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SchemaVersion |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipComplianceInfo(dAtA[iNdEx:]) diff --git a/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.compliance/module/rest.ts b/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.compliance/module/rest.ts index 01de71796..c824f65da 100644 --- a/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.compliance/module/rest.ts +++ b/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.compliance/module/rest.ts @@ -65,6 +65,9 @@ export interface ComplianceComplianceInfo { OSVersion?: string; parentChild?: string; certificationIdOfSoftwareComponent?: string; + + /** @format int64 */ + schemaVersion?: number; } export interface ComplianceDeviceSoftwareCompliance { diff --git a/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.compliance/module/types/compliance/compliance_info.ts b/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.compliance/module/types/compliance/compliance_info.ts index d9fe630f7..c603375d3 100644 --- a/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.compliance/module/types/compliance/compliance_info.ts +++ b/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.compliance/module/types/compliance/compliance_info.ts @@ -28,6 +28,7 @@ export interface ComplianceInfo { OSVersion: string parentChild: string certificationIdOfSoftwareComponent: string + schemaVersion: number } const baseComplianceInfo: object = { @@ -52,7 +53,8 @@ const baseComplianceInfo: object = { supportedClusters: '', OSVersion: '', parentChild: '', - certificationIdOfSoftwareComponent: '' + certificationIdOfSoftwareComponent: '', + schemaVersion: 0 } export const ComplianceInfo = { @@ -126,6 +128,9 @@ export const ComplianceInfo = { if (message.certificationIdOfSoftwareComponent !== '') { writer.uint32(186).string(message.certificationIdOfSoftwareComponent) } + if (message.schemaVersion !== 0) { + writer.uint32(192).uint32(message.schemaVersion) + } return writer }, @@ -206,6 +211,9 @@ export const ComplianceInfo = { case 23: message.certificationIdOfSoftwareComponent = reader.string() break + case 24: + message.schemaVersion = reader.uint32() + break default: reader.skipType(tag & 7) break @@ -332,6 +340,11 @@ export const ComplianceInfo = { } else { message.certificationIdOfSoftwareComponent = '' } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = Number(object.schemaVersion) + } else { + message.schemaVersion = 0 + } return message }, @@ -364,6 +377,7 @@ export const ComplianceInfo = { message.OSVersion !== undefined && (obj.OSVersion = message.OSVersion) message.parentChild !== undefined && (obj.parentChild = message.parentChild) message.certificationIdOfSoftwareComponent !== undefined && (obj.certificationIdOfSoftwareComponent = message.certificationIdOfSoftwareComponent) + message.schemaVersion !== undefined && (obj.schemaVersion = message.schemaVersion) return obj }, @@ -485,6 +499,11 @@ export const ComplianceInfo = { } else { message.certificationIdOfSoftwareComponent = '' } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = object.schemaVersion + } else { + message.schemaVersion = 0 + } return message } } diff --git a/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.compliance/module/types/compliance/tx.ts b/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.compliance/module/types/compliance/tx.ts index 1b8500e34..f63ee0dc3 100644 --- a/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.compliance/module/types/compliance/tx.ts +++ b/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.compliance/module/types/compliance/tx.ts @@ -25,6 +25,7 @@ export interface MsgCertifyModel { transport: string parentChild: string certificationIdOfSoftwareComponent: string + schemaVersion: number } export interface MsgCertifyModelResponse {} @@ -39,6 +40,7 @@ export interface MsgRevokeModel { revocationDate: string certificationType: string reason: string + schemaVersion: number } export interface MsgRevokeModelResponse {} @@ -65,6 +67,7 @@ export interface MsgProvisionModel { transport: string parentChild: string certificationIdOfSoftwareComponent: string + schemaVersion: number } export interface MsgProvisionModelResponse {} @@ -91,6 +94,7 @@ export interface MsgUpdateComplianceInfo { OSVersion: string parentChild: string certificationIdOfSoftwareComponent: string + schemaVersion: number } export interface MsgUpdateComplianceInfoResponse {} @@ -126,7 +130,8 @@ const baseMsgCertifyModel: object = { programType: '', transport: '', parentChild: '', - certificationIdOfSoftwareComponent: '' + certificationIdOfSoftwareComponent: '', + schemaVersion: 0 } export const MsgCertifyModel = { @@ -194,6 +199,9 @@ export const MsgCertifyModel = { if (message.certificationIdOfSoftwareComponent !== '') { writer.uint32(170).string(message.certificationIdOfSoftwareComponent) } + if (message.schemaVersion !== 0) { + writer.uint32(176).uint32(message.schemaVersion) + } return writer }, @@ -267,6 +275,9 @@ export const MsgCertifyModel = { case 21: message.certificationIdOfSoftwareComponent = reader.string() break + case 22: + message.schemaVersion = reader.uint32() + break default: reader.skipType(tag & 7) break @@ -382,6 +393,11 @@ export const MsgCertifyModel = { } else { message.certificationIdOfSoftwareComponent = '' } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = Number(object.schemaVersion) + } else { + message.schemaVersion = 0 + } return message }, @@ -408,6 +424,7 @@ export const MsgCertifyModel = { message.transport !== undefined && (obj.transport = message.transport) message.parentChild !== undefined && (obj.parentChild = message.parentChild) message.certificationIdOfSoftwareComponent !== undefined && (obj.certificationIdOfSoftwareComponent = message.certificationIdOfSoftwareComponent) + message.schemaVersion !== undefined && (obj.schemaVersion = message.schemaVersion) return obj }, @@ -518,6 +535,11 @@ export const MsgCertifyModel = { } else { message.certificationIdOfSoftwareComponent = '' } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = object.schemaVersion + } else { + message.schemaVersion = 0 + } return message } } @@ -569,7 +591,8 @@ const baseMsgRevokeModel: object = { cDVersionNumber: 0, revocationDate: '', certificationType: '', - reason: '' + reason: '', + schemaVersion: 0 } export const MsgRevokeModel = { @@ -601,6 +624,9 @@ export const MsgRevokeModel = { if (message.reason !== '') { writer.uint32(74).string(message.reason) } + if (message.schemaVersion !== 0) { + writer.uint32(80).uint32(message.schemaVersion) + } return writer }, @@ -638,6 +664,9 @@ export const MsgRevokeModel = { case 9: message.reason = reader.string() break + case 10: + message.schemaVersion = reader.uint32() + break default: reader.skipType(tag & 7) break @@ -693,6 +722,11 @@ export const MsgRevokeModel = { } else { message.reason = '' } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = Number(object.schemaVersion) + } else { + message.schemaVersion = 0 + } return message }, @@ -707,6 +741,7 @@ export const MsgRevokeModel = { message.revocationDate !== undefined && (obj.revocationDate = message.revocationDate) message.certificationType !== undefined && (obj.certificationType = message.certificationType) message.reason !== undefined && (obj.reason = message.reason) + message.schemaVersion !== undefined && (obj.schemaVersion = message.schemaVersion) return obj }, @@ -757,6 +792,11 @@ export const MsgRevokeModel = { } else { message.reason = '' } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = object.schemaVersion + } else { + message.schemaVersion = 0 + } return message } } @@ -820,7 +860,8 @@ const baseMsgProvisionModel: object = { programType: '', transport: '', parentChild: '', - certificationIdOfSoftwareComponent: '' + certificationIdOfSoftwareComponent: '', + schemaVersion: 0 } export const MsgProvisionModel = { @@ -888,6 +929,9 @@ export const MsgProvisionModel = { if (message.certificationIdOfSoftwareComponent !== '') { writer.uint32(170).string(message.certificationIdOfSoftwareComponent) } + if (message.schemaVersion !== 0) { + writer.uint32(176).uint32(message.schemaVersion) + } return writer }, @@ -961,6 +1005,9 @@ export const MsgProvisionModel = { case 21: message.certificationIdOfSoftwareComponent = reader.string() break + case 22: + message.schemaVersion = reader.uint32() + break default: reader.skipType(tag & 7) break @@ -1076,6 +1123,11 @@ export const MsgProvisionModel = { } else { message.certificationIdOfSoftwareComponent = '' } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = Number(object.schemaVersion) + } else { + message.schemaVersion = 0 + } return message }, @@ -1102,6 +1154,7 @@ export const MsgProvisionModel = { message.transport !== undefined && (obj.transport = message.transport) message.parentChild !== undefined && (obj.parentChild = message.parentChild) message.certificationIdOfSoftwareComponent !== undefined && (obj.certificationIdOfSoftwareComponent = message.certificationIdOfSoftwareComponent) + message.schemaVersion !== undefined && (obj.schemaVersion = message.schemaVersion) return obj }, @@ -1212,6 +1265,11 @@ export const MsgProvisionModel = { } else { message.certificationIdOfSoftwareComponent = '' } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = object.schemaVersion + } else { + message.schemaVersion = 0 + } return message } } @@ -1275,7 +1333,8 @@ const baseMsgUpdateComplianceInfo: object = { supportedClusters: '', OSVersion: '', parentChild: '', - certificationIdOfSoftwareComponent: '' + certificationIdOfSoftwareComponent: '', + schemaVersion: 0 } export const MsgUpdateComplianceInfo = { @@ -1343,6 +1402,9 @@ export const MsgUpdateComplianceInfo = { if (message.certificationIdOfSoftwareComponent !== '') { writer.uint32(170).string(message.certificationIdOfSoftwareComponent) } + if (message.schemaVersion !== 0) { + writer.uint32(176).uint32(message.schemaVersion) + } return writer }, @@ -1416,6 +1478,9 @@ export const MsgUpdateComplianceInfo = { case 21: message.certificationIdOfSoftwareComponent = reader.string() break + case 22: + message.schemaVersion = reader.uint32() + break default: reader.skipType(tag & 7) break @@ -1531,6 +1596,11 @@ export const MsgUpdateComplianceInfo = { } else { message.certificationIdOfSoftwareComponent = '' } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = Number(object.schemaVersion) + } else { + message.schemaVersion = 0 + } return message }, @@ -1557,6 +1627,7 @@ export const MsgUpdateComplianceInfo = { message.OSVersion !== undefined && (obj.OSVersion = message.OSVersion) message.parentChild !== undefined && (obj.parentChild = message.parentChild) message.certificationIdOfSoftwareComponent !== undefined && (obj.certificationIdOfSoftwareComponent = message.certificationIdOfSoftwareComponent) + message.schemaVersion !== undefined && (obj.schemaVersion = message.schemaVersion) return obj }, @@ -1667,6 +1738,11 @@ export const MsgUpdateComplianceInfo = { } else { message.certificationIdOfSoftwareComponent = '' } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = object.schemaVersion + } else { + message.schemaVersion = 0 + } return message } } diff --git a/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.model/module/rest.ts b/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.model/module/rest.ts index edc6ca0c6..db925231b 100644 --- a/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.model/module/rest.ts +++ b/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.model/module/rest.ts @@ -41,6 +41,9 @@ export interface ModelModel { /** @format int32 */ lsfRevision?: number; creator?: string; + + /** @format int64 */ + schemaVersion?: number; } export interface ModelModelVersion { @@ -74,6 +77,9 @@ export interface ModelModelVersion { maxApplicableSoftwareVersion?: number; releaseNotesUrl?: string; creator?: string; + + /** @format int64 */ + schemaVersion?: number; } export interface ModelModelVersions { diff --git a/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.model/module/types/model/model.ts b/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.model/module/types/model/model.ts index 5d26090ef..cbf673d3e 100644 --- a/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.model/module/types/model/model.ts +++ b/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.model/module/types/model/model.ts @@ -22,6 +22,7 @@ export interface Model { lsfUrl: string lsfRevision: number creator: string + schemaVersion: number } const baseModel: object = { @@ -42,7 +43,8 @@ const baseModel: object = { productUrl: '', lsfUrl: '', lsfRevision: 0, - creator: '' + creator: '', + schemaVersion: 0 } export const Model = { @@ -101,6 +103,9 @@ export const Model = { if (message.creator !== '') { writer.uint32(146).string(message.creator) } + if (message.schemaVersion !== 0) { + writer.uint32(152).uint32(message.schemaVersion) + } return writer }, @@ -165,6 +170,9 @@ export const Model = { case 18: message.creator = reader.string() break + case 19: + message.schemaVersion = reader.uint32() + break default: reader.skipType(tag & 7) break @@ -265,6 +273,11 @@ export const Model = { } else { message.creator = '' } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = Number(object.schemaVersion) + } else { + message.schemaVersion = 0 + } return message }, @@ -290,6 +303,7 @@ export const Model = { message.lsfUrl !== undefined && (obj.lsfUrl = message.lsfUrl) message.lsfRevision !== undefined && (obj.lsfRevision = message.lsfRevision) message.creator !== undefined && (obj.creator = message.creator) + message.schemaVersion !== undefined && (obj.schemaVersion = message.schemaVersion) return obj }, @@ -385,6 +399,11 @@ export const Model = { } else { message.creator = '' } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = object.schemaVersion + } else { + message.schemaVersion = 0 + } return message } } diff --git a/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.model/module/types/model/model_version.ts b/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.model/module/types/model/model_version.ts index dd83ef954..574d197c6 100644 --- a/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.model/module/types/model/model_version.ts +++ b/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.model/module/types/model/model_version.ts @@ -20,6 +20,7 @@ export interface ModelVersion { maxApplicableSoftwareVersion: number releaseNotesUrl: string creator: string + schemaVersion: number } const baseModelVersion: object = { @@ -37,7 +38,8 @@ const baseModelVersion: object = { minApplicableSoftwareVersion: 0, maxApplicableSoftwareVersion: 0, releaseNotesUrl: '', - creator: '' + creator: '', + schemaVersion: 0 } export const ModelVersion = { @@ -87,6 +89,9 @@ export const ModelVersion = { if (message.creator !== '') { writer.uint32(122).string(message.creator) } + if (message.schemaVersion !== 0) { + writer.uint32(128).uint32(message.schemaVersion) + } return writer }, @@ -142,6 +147,9 @@ export const ModelVersion = { case 15: message.creator = reader.string() break + case 16: + message.schemaVersion = reader.uint32() + break default: reader.skipType(tag & 7) break @@ -227,6 +235,11 @@ export const ModelVersion = { } else { message.creator = '' } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = Number(object.schemaVersion) + } else { + message.schemaVersion = 0 + } return message }, @@ -247,6 +260,7 @@ export const ModelVersion = { message.maxApplicableSoftwareVersion !== undefined && (obj.maxApplicableSoftwareVersion = message.maxApplicableSoftwareVersion) message.releaseNotesUrl !== undefined && (obj.releaseNotesUrl = message.releaseNotesUrl) message.creator !== undefined && (obj.creator = message.creator) + message.schemaVersion !== undefined && (obj.schemaVersion = message.schemaVersion) return obj }, @@ -327,6 +341,11 @@ export const ModelVersion = { } else { message.creator = '' } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = object.schemaVersion + } else { + message.schemaVersion = 0 + } return message } } diff --git a/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.model/module/types/model/product.ts b/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.model/module/types/model/product.ts index be21ed8f7..aee3de601 100644 --- a/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.model/module/types/model/product.ts +++ b/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.model/module/types/model/product.ts @@ -7,9 +7,10 @@ export interface Product { pid: number name: string partNumber: string + schemaVersion: number } -const baseProduct: object = { pid: 0, name: '', partNumber: '' } +const baseProduct: object = { pid: 0, name: '', partNumber: '', schemaVersion: 0 } export const Product = { encode(message: Product, writer: Writer = Writer.create()): Writer { @@ -22,6 +23,9 @@ export const Product = { if (message.partNumber !== '') { writer.uint32(26).string(message.partNumber) } + if (message.schemaVersion !== 0) { + writer.uint32(32).uint32(message.schemaVersion) + } return writer }, @@ -41,6 +45,9 @@ export const Product = { case 3: message.partNumber = reader.string() break + case 4: + message.schemaVersion = reader.uint32() + break default: reader.skipType(tag & 7) break @@ -66,6 +73,11 @@ export const Product = { } else { message.partNumber = '' } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = Number(object.schemaVersion) + } else { + message.schemaVersion = 0 + } return message }, @@ -74,6 +86,7 @@ export const Product = { message.pid !== undefined && (obj.pid = message.pid) message.name !== undefined && (obj.name = message.name) message.partNumber !== undefined && (obj.partNumber = message.partNumber) + message.schemaVersion !== undefined && (obj.schemaVersion = message.schemaVersion) return obj }, @@ -94,6 +107,11 @@ export const Product = { } else { message.partNumber = '' } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = object.schemaVersion + } else { + message.schemaVersion = 0 + } return message } } diff --git a/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.model/module/types/model/tx.ts b/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.model/module/types/model/tx.ts index c6558887d..6aa6ee6ca 100644 --- a/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.model/module/types/model/tx.ts +++ b/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.model/module/types/model/tx.ts @@ -22,6 +22,7 @@ export interface MsgCreateModel { supportUrl: string productUrl: string lsfUrl: string + schemaVersion: number } export interface MsgCreateModelResponse {} @@ -41,6 +42,7 @@ export interface MsgUpdateModel { productUrl: string lsfUrl: string lsfRevision: number + schemaVersion: number } export interface MsgUpdateModelResponse {} @@ -69,6 +71,7 @@ export interface MsgCreateModelVersion { minApplicableSoftwareVersion: number maxApplicableSoftwareVersion: number releaseNotesUrl: string + schemaVersion: number } export interface MsgCreateModelVersionResponse {} @@ -85,6 +88,7 @@ export interface MsgUpdateModelVersion { releaseNotesUrl: string otaFileSize: number otaChecksum: string + schemaVersion: number } export interface MsgUpdateModelVersionResponse {} @@ -115,7 +119,8 @@ const baseMsgCreateModel: object = { userManualUrl: '', supportUrl: '', productUrl: '', - lsfUrl: '' + lsfUrl: '', + schemaVersion: 0 } export const MsgCreateModel = { @@ -171,6 +176,9 @@ export const MsgCreateModel = { if (message.lsfUrl !== '') { writer.uint32(138).string(message.lsfUrl) } + if (message.schemaVersion !== 0) { + writer.uint32(144).uint32(message.schemaVersion) + } return writer }, @@ -232,6 +240,9 @@ export const MsgCreateModel = { case 17: message.lsfUrl = reader.string() break + case 18: + message.schemaVersion = reader.uint32() + break default: reader.skipType(tag & 7) break @@ -327,6 +338,11 @@ export const MsgCreateModel = { } else { message.lsfUrl = '' } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = Number(object.schemaVersion) + } else { + message.schemaVersion = 0 + } return message }, @@ -351,6 +367,7 @@ export const MsgCreateModel = { message.supportUrl !== undefined && (obj.supportUrl = message.supportUrl) message.productUrl !== undefined && (obj.productUrl = message.productUrl) message.lsfUrl !== undefined && (obj.lsfUrl = message.lsfUrl) + message.schemaVersion !== undefined && (obj.schemaVersion = message.schemaVersion) return obj }, @@ -441,6 +458,11 @@ export const MsgCreateModel = { } else { message.lsfUrl = '' } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = object.schemaVersion + } else { + message.schemaVersion = 0 + } return message } } @@ -497,7 +519,8 @@ const baseMsgUpdateModel: object = { supportUrl: '', productUrl: '', lsfUrl: '', - lsfRevision: 0 + lsfRevision: 0, + schemaVersion: 0 } export const MsgUpdateModel = { @@ -544,6 +567,9 @@ export const MsgUpdateModel = { if (message.lsfRevision !== 0) { writer.uint32(112).int32(message.lsfRevision) } + if (message.schemaVersion !== 0) { + writer.uint32(120).uint32(message.schemaVersion) + } return writer }, @@ -596,6 +622,9 @@ export const MsgUpdateModel = { case 14: message.lsfRevision = reader.int32() break + case 15: + message.schemaVersion = reader.uint32() + break default: reader.skipType(tag & 7) break @@ -676,6 +705,11 @@ export const MsgUpdateModel = { } else { message.lsfRevision = 0 } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = Number(object.schemaVersion) + } else { + message.schemaVersion = 0 + } return message }, @@ -697,6 +731,7 @@ export const MsgUpdateModel = { message.productUrl !== undefined && (obj.productUrl = message.productUrl) message.lsfUrl !== undefined && (obj.lsfUrl = message.lsfUrl) message.lsfRevision !== undefined && (obj.lsfRevision = message.lsfRevision) + message.schemaVersion !== undefined && (obj.schemaVersion = message.schemaVersion) return obj }, @@ -772,6 +807,11 @@ export const MsgUpdateModel = { } else { message.lsfRevision = 0 } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = object.schemaVersion + } else { + message.schemaVersion = 0 + } return message } } @@ -956,7 +996,8 @@ const baseMsgCreateModelVersion: object = { otaChecksumType: 0, minApplicableSoftwareVersion: 0, maxApplicableSoftwareVersion: 0, - releaseNotesUrl: '' + releaseNotesUrl: '', + schemaVersion: 0 } export const MsgCreateModelVersion = { @@ -1006,6 +1047,9 @@ export const MsgCreateModelVersion = { if (message.releaseNotesUrl !== '') { writer.uint32(122).string(message.releaseNotesUrl) } + if (message.schemaVersion !== 0) { + writer.uint32(128).uint32(message.schemaVersion) + } return writer }, @@ -1061,6 +1105,9 @@ export const MsgCreateModelVersion = { case 15: message.releaseNotesUrl = reader.string() break + case 16: + message.schemaVersion = reader.uint32() + break default: reader.skipType(tag & 7) break @@ -1146,6 +1193,11 @@ export const MsgCreateModelVersion = { } else { message.releaseNotesUrl = '' } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = Number(object.schemaVersion) + } else { + message.schemaVersion = 0 + } return message }, @@ -1166,6 +1218,7 @@ export const MsgCreateModelVersion = { message.minApplicableSoftwareVersion !== undefined && (obj.minApplicableSoftwareVersion = message.minApplicableSoftwareVersion) message.maxApplicableSoftwareVersion !== undefined && (obj.maxApplicableSoftwareVersion = message.maxApplicableSoftwareVersion) message.releaseNotesUrl !== undefined && (obj.releaseNotesUrl = message.releaseNotesUrl) + message.schemaVersion !== undefined && (obj.schemaVersion = message.schemaVersion) return obj }, @@ -1246,6 +1299,11 @@ export const MsgCreateModelVersion = { } else { message.releaseNotesUrl = '' } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = object.schemaVersion + } else { + message.schemaVersion = 0 + } return message } } @@ -1299,7 +1357,8 @@ const baseMsgUpdateModelVersion: object = { maxApplicableSoftwareVersion: 0, releaseNotesUrl: '', otaFileSize: 0, - otaChecksum: '' + otaChecksum: '', + schemaVersion: 0 } export const MsgUpdateModelVersion = { @@ -1337,6 +1396,9 @@ export const MsgUpdateModelVersion = { if (message.otaChecksum !== '') { writer.uint32(90).string(message.otaChecksum) } + if (message.schemaVersion !== 0) { + writer.uint32(96).uint32(message.schemaVersion) + } return writer }, @@ -1380,6 +1442,9 @@ export const MsgUpdateModelVersion = { case 11: message.otaChecksum = reader.string() break + case 12: + message.schemaVersion = reader.uint32() + break default: reader.skipType(tag & 7) break @@ -1445,6 +1510,11 @@ export const MsgUpdateModelVersion = { } else { message.otaChecksum = '' } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = Number(object.schemaVersion) + } else { + message.schemaVersion = 0 + } return message }, @@ -1461,6 +1531,7 @@ export const MsgUpdateModelVersion = { message.releaseNotesUrl !== undefined && (obj.releaseNotesUrl = message.releaseNotesUrl) message.otaFileSize !== undefined && (obj.otaFileSize = message.otaFileSize) message.otaChecksum !== undefined && (obj.otaChecksum = message.otaChecksum) + message.schemaVersion !== undefined && (obj.schemaVersion = message.schemaVersion) return obj }, @@ -1521,6 +1592,11 @@ export const MsgUpdateModelVersion = { } else { message.otaChecksum = '' } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = object.schemaVersion + } else { + message.schemaVersion = 0 + } return message } } diff --git a/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.pki/module/rest.ts b/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.pki/module/rest.ts index af5d83960..a809907cf 100644 --- a/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.pki/module/rest.ts +++ b/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.pki/module/rest.ts @@ -60,6 +60,9 @@ export interface PkiCertificate { /** @format int32 */ vid?: number; isNoc?: boolean; + + /** @format int64 */ + schemaVersion?: number; } export interface PkiCertificateIdentifier { @@ -153,6 +156,9 @@ export interface PkiProposedCertificate { /** @format int32 */ vid?: number; + + /** @format int64 */ + schemaVersion?: number; } export interface PkiProposedCertificateRevocation { @@ -162,6 +168,9 @@ export interface PkiProposedCertificateRevocation { approvals?: PkiGrant[]; subjectAsText?: string; revokeChild?: boolean; + + /** @format int64 */ + schemaVersion?: number; } export interface PkiQueryAllApprovedCertificatesResponse { diff --git a/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.pki/module/types/pki/certificate.ts b/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.pki/module/types/pki/certificate.ts index d2f52ac76..ad35d3719 100644 --- a/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.pki/module/types/pki/certificate.ts +++ b/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.pki/module/types/pki/certificate.ts @@ -20,6 +20,7 @@ export interface Certificate { rejects: Grant[] vid: number isNoc: boolean + schemaVersion: number } const baseCertificate: object = { @@ -35,7 +36,8 @@ const baseCertificate: object = { subjectKeyId: '', subjectAsText: '', vid: 0, - isNoc: false + isNoc: false, + schemaVersion: 0 } export const Certificate = { @@ -85,6 +87,9 @@ export const Certificate = { if (message.isNoc === true) { writer.uint32(120).bool(message.isNoc) } + if (message.schemaVersion !== 0) { + writer.uint32(128).uint32(message.schemaVersion) + } return writer }, @@ -142,6 +147,9 @@ export const Certificate = { case 15: message.isNoc = reader.bool() break + case 16: + message.schemaVersion = reader.uint32() + break default: reader.skipType(tag & 7) break @@ -229,6 +237,11 @@ export const Certificate = { } else { message.isNoc = false } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = Number(object.schemaVersion) + } else { + message.schemaVersion = 0 + } return message }, @@ -257,6 +270,7 @@ export const Certificate = { } message.vid !== undefined && (obj.vid = message.vid) message.isNoc !== undefined && (obj.isNoc = message.isNoc) + message.schemaVersion !== undefined && (obj.schemaVersion = message.schemaVersion) return obj }, @@ -339,6 +353,11 @@ export const Certificate = { } else { message.isNoc = false } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = object.schemaVersion + } else { + message.schemaVersion = 0 + } return message } } diff --git a/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.pki/module/types/pki/pki_revocation_distribution_point.ts b/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.pki/module/types/pki/pki_revocation_distribution_point.ts index 7384ced1a..4b44bb783 100644 --- a/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.pki/module/types/pki/pki_revocation_distribution_point.ts +++ b/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.pki/module/types/pki/pki_revocation_distribution_point.ts @@ -16,6 +16,7 @@ export interface PkiRevocationDistributionPoint { dataDigest: string dataDigestType: number revocationType: number + schemaVersion: number } const basePkiRevocationDistributionPoint: object = { @@ -29,7 +30,8 @@ const basePkiRevocationDistributionPoint: object = { dataFileSize: 0, dataDigest: '', dataDigestType: 0, - revocationType: 0 + revocationType: 0, + schemaVersion: 0 } export const PkiRevocationDistributionPoint = { @@ -67,6 +69,9 @@ export const PkiRevocationDistributionPoint = { if (message.revocationType !== 0) { writer.uint32(88).uint32(message.revocationType) } + if (message.schemaVersion !== 0) { + writer.uint32(96).uint32(message.schemaVersion) + } return writer }, @@ -110,6 +115,9 @@ export const PkiRevocationDistributionPoint = { case 11: message.revocationType = reader.uint32() break + case 12: + message.schemaVersion = reader.uint32() + break default: reader.skipType(tag & 7) break @@ -175,6 +183,11 @@ export const PkiRevocationDistributionPoint = { } else { message.revocationType = 0 } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = Number(object.schemaVersion) + } else { + message.schemaVersion = 0 + } return message }, @@ -191,6 +204,7 @@ export const PkiRevocationDistributionPoint = { message.dataDigest !== undefined && (obj.dataDigest = message.dataDigest) message.dataDigestType !== undefined && (obj.dataDigestType = message.dataDigestType) message.revocationType !== undefined && (obj.revocationType = message.revocationType) + message.schemaVersion !== undefined && (obj.schemaVersion = message.schemaVersion) return obj }, @@ -251,6 +265,11 @@ export const PkiRevocationDistributionPoint = { } else { message.revocationType = 0 } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = object.schemaVersion + } else { + message.schemaVersion = 0 + } return message } } diff --git a/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.pki/module/types/pki/proposed_certificate.ts b/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.pki/module/types/pki/proposed_certificate.ts index fb0987889..a59a1ac37 100644 --- a/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.pki/module/types/pki/proposed_certificate.ts +++ b/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.pki/module/types/pki/proposed_certificate.ts @@ -14,9 +14,10 @@ export interface ProposedCertificate { subjectAsText: string rejects: Grant[] vid: number + schemaVersion: number } -const baseProposedCertificate: object = { subject: '', subjectKeyId: '', pemCert: '', serialNumber: '', owner: '', subjectAsText: '', vid: 0 } +const baseProposedCertificate: object = { subject: '', subjectKeyId: '', pemCert: '', serialNumber: '', owner: '', subjectAsText: '', vid: 0, schemaVersion: 0 } export const ProposedCertificate = { encode(message: ProposedCertificate, writer: Writer = Writer.create()): Writer { @@ -47,6 +48,9 @@ export const ProposedCertificate = { if (message.vid !== 0) { writer.uint32(72).int32(message.vid) } + if (message.schemaVersion !== 0) { + writer.uint32(80).uint32(message.schemaVersion) + } return writer }, @@ -86,6 +90,9 @@ export const ProposedCertificate = { case 9: message.vid = reader.int32() break + case 10: + message.schemaVersion = reader.uint32() + break default: reader.skipType(tag & 7) break @@ -143,6 +150,11 @@ export const ProposedCertificate = { } else { message.vid = 0 } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = Number(object.schemaVersion) + } else { + message.schemaVersion = 0 + } return message }, @@ -165,6 +177,7 @@ export const ProposedCertificate = { obj.rejects = [] } message.vid !== undefined && (obj.vid = message.vid) + message.schemaVersion !== undefined && (obj.schemaVersion = message.schemaVersion) return obj }, @@ -217,6 +230,11 @@ export const ProposedCertificate = { } else { message.vid = 0 } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = object.schemaVersion + } else { + message.schemaVersion = 0 + } return message } } diff --git a/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.pki/module/types/pki/tx.ts b/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.pki/module/types/pki/tx.ts index ee423a7fe..4d407518c 100644 --- a/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.pki/module/types/pki/tx.ts +++ b/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.pki/module/types/pki/tx.ts @@ -10,6 +10,7 @@ export interface MsgProposeAddX509RootCert { info: string time: number vid: number + schemaVersion: number } export interface MsgProposeAddX509RootCertResponse {} @@ -29,6 +30,7 @@ export interface MsgAddX509Cert { cert: string info: string time: number + schemaVersion: number } export interface MsgAddX509CertResponse {} @@ -91,6 +93,7 @@ export interface MsgAddPkiRevocationDistributionPoint { dataDigest: string dataDigestType: number revocationType: number + schemaVersion: number } export interface MsgAddPkiRevocationDistributionPointResponse {} @@ -105,6 +108,7 @@ export interface MsgUpdatePkiRevocationDistributionPoint { dataFileSize: number dataDigest: string dataDigestType: number + schemaVersion: number } export interface MsgUpdatePkiRevocationDistributionPointResponse {} @@ -130,6 +134,7 @@ export interface MsgAssignVidResponse {} export interface MsgAddNocX509RootCert { signer: string cert: string + schemaVersion: number } export interface MsgAddNocX509RootCertResponse {} @@ -146,6 +151,7 @@ export interface MsgRemoveX509CertResponse {} export interface MsgAddNocX509Cert { signer: string cert: string + schemaVersion: number } export interface MsgAddNocX509CertResponse {} @@ -174,7 +180,7 @@ export interface MsgRevokeNocX509Cert { export interface MsgRevokeNocX509CertResponse {} -const baseMsgProposeAddX509RootCert: object = { signer: '', cert: '', info: '', time: 0, vid: 0 } +const baseMsgProposeAddX509RootCert: object = { signer: '', cert: '', info: '', time: 0, vid: 0, schemaVersion: 0 } export const MsgProposeAddX509RootCert = { encode(message: MsgProposeAddX509RootCert, writer: Writer = Writer.create()): Writer { @@ -193,6 +199,9 @@ export const MsgProposeAddX509RootCert = { if (message.vid !== 0) { writer.uint32(40).int32(message.vid) } + if (message.schemaVersion !== 0) { + writer.uint32(48).uint32(message.schemaVersion) + } return writer }, @@ -218,6 +227,9 @@ export const MsgProposeAddX509RootCert = { case 5: message.vid = reader.int32() break + case 6: + message.schemaVersion = reader.uint32() + break default: reader.skipType(tag & 7) break @@ -253,6 +265,11 @@ export const MsgProposeAddX509RootCert = { } else { message.vid = 0 } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = Number(object.schemaVersion) + } else { + message.schemaVersion = 0 + } return message }, @@ -263,6 +280,7 @@ export const MsgProposeAddX509RootCert = { message.info !== undefined && (obj.info = message.info) message.time !== undefined && (obj.time = message.time) message.vid !== undefined && (obj.vid = message.vid) + message.schemaVersion !== undefined && (obj.schemaVersion = message.schemaVersion) return obj }, @@ -293,6 +311,11 @@ export const MsgProposeAddX509RootCert = { } else { message.vid = 0 } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = object.schemaVersion + } else { + message.schemaVersion = 0 + } return message } } @@ -496,7 +519,7 @@ export const MsgApproveAddX509RootCertResponse = { } } -const baseMsgAddX509Cert: object = { signer: '', cert: '', info: '', time: 0 } +const baseMsgAddX509Cert: object = { signer: '', cert: '', info: '', time: 0, schemaVersion: 0 } export const MsgAddX509Cert = { encode(message: MsgAddX509Cert, writer: Writer = Writer.create()): Writer { @@ -512,6 +535,9 @@ export const MsgAddX509Cert = { if (message.time !== 0) { writer.uint32(32).int64(message.time) } + if (message.schemaVersion !== 0) { + writer.uint32(40).uint32(message.schemaVersion) + } return writer }, @@ -534,6 +560,9 @@ export const MsgAddX509Cert = { case 4: message.time = longToNumber(reader.int64() as Long) break + case 5: + message.schemaVersion = reader.uint32() + break default: reader.skipType(tag & 7) break @@ -564,6 +593,11 @@ export const MsgAddX509Cert = { } else { message.time = 0 } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = Number(object.schemaVersion) + } else { + message.schemaVersion = 0 + } return message }, @@ -573,6 +607,7 @@ export const MsgAddX509Cert = { message.cert !== undefined && (obj.cert = message.cert) message.info !== undefined && (obj.info = message.info) message.time !== undefined && (obj.time = message.time) + message.schemaVersion !== undefined && (obj.schemaVersion = message.schemaVersion) return obj }, @@ -598,6 +633,11 @@ export const MsgAddX509Cert = { } else { message.time = 0 } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = object.schemaVersion + } else { + message.schemaVersion = 0 + } return message } } @@ -1381,7 +1421,8 @@ const baseMsgAddPkiRevocationDistributionPoint: object = { dataFileSize: 0, dataDigest: '', dataDigestType: 0, - revocationType: 0 + revocationType: 0, + schemaVersion: 0 } export const MsgAddPkiRevocationDistributionPoint = { @@ -1422,6 +1463,9 @@ export const MsgAddPkiRevocationDistributionPoint = { if (message.revocationType !== 0) { writer.uint32(96).uint32(message.revocationType) } + if (message.schemaVersion !== 0) { + writer.uint32(104).uint32(message.schemaVersion) + } return writer }, @@ -1468,6 +1512,9 @@ export const MsgAddPkiRevocationDistributionPoint = { case 12: message.revocationType = reader.uint32() break + case 13: + message.schemaVersion = reader.uint32() + break default: reader.skipType(tag & 7) break @@ -1538,6 +1585,11 @@ export const MsgAddPkiRevocationDistributionPoint = { } else { message.revocationType = 0 } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = Number(object.schemaVersion) + } else { + message.schemaVersion = 0 + } return message }, @@ -1555,6 +1607,7 @@ export const MsgAddPkiRevocationDistributionPoint = { message.dataDigest !== undefined && (obj.dataDigest = message.dataDigest) message.dataDigestType !== undefined && (obj.dataDigestType = message.dataDigestType) message.revocationType !== undefined && (obj.revocationType = message.revocationType) + message.schemaVersion !== undefined && (obj.schemaVersion = message.schemaVersion) return obj }, @@ -1620,6 +1673,11 @@ export const MsgAddPkiRevocationDistributionPoint = { } else { message.revocationType = 0 } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = object.schemaVersion + } else { + message.schemaVersion = 0 + } return message } } @@ -1671,7 +1729,8 @@ const baseMsgUpdatePkiRevocationDistributionPoint: object = { dataURL: '', dataFileSize: 0, dataDigest: '', - dataDigestType: 0 + dataDigestType: 0, + schemaVersion: 0 } export const MsgUpdatePkiRevocationDistributionPoint = { @@ -1703,6 +1762,9 @@ export const MsgUpdatePkiRevocationDistributionPoint = { if (message.dataDigestType !== 0) { writer.uint32(72).uint32(message.dataDigestType) } + if (message.schemaVersion !== 0) { + writer.uint32(80).uint32(message.schemaVersion) + } return writer }, @@ -1740,6 +1802,9 @@ export const MsgUpdatePkiRevocationDistributionPoint = { case 9: message.dataDigestType = reader.uint32() break + case 10: + message.schemaVersion = reader.uint32() + break default: reader.skipType(tag & 7) break @@ -1795,6 +1860,11 @@ export const MsgUpdatePkiRevocationDistributionPoint = { } else { message.dataDigestType = 0 } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = Number(object.schemaVersion) + } else { + message.schemaVersion = 0 + } return message }, @@ -1809,6 +1879,7 @@ export const MsgUpdatePkiRevocationDistributionPoint = { message.dataFileSize !== undefined && (obj.dataFileSize = message.dataFileSize) message.dataDigest !== undefined && (obj.dataDigest = message.dataDigest) message.dataDigestType !== undefined && (obj.dataDigestType = message.dataDigestType) + message.schemaVersion !== undefined && (obj.schemaVersion = message.schemaVersion) return obj }, @@ -1859,6 +1930,11 @@ export const MsgUpdatePkiRevocationDistributionPoint = { } else { message.dataDigestType = 0 } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = object.schemaVersion + } else { + message.schemaVersion = 0 + } return message } } @@ -2189,7 +2265,7 @@ export const MsgAssignVidResponse = { } } -const baseMsgAddNocX509RootCert: object = { signer: '', cert: '' } +const baseMsgAddNocX509RootCert: object = { signer: '', cert: '', schemaVersion: 0 } export const MsgAddNocX509RootCert = { encode(message: MsgAddNocX509RootCert, writer: Writer = Writer.create()): Writer { @@ -2199,6 +2275,9 @@ export const MsgAddNocX509RootCert = { if (message.cert !== '') { writer.uint32(18).string(message.cert) } + if (message.schemaVersion !== 0) { + writer.uint32(24).uint32(message.schemaVersion) + } return writer }, @@ -2215,6 +2294,9 @@ export const MsgAddNocX509RootCert = { case 2: message.cert = reader.string() break + case 3: + message.schemaVersion = reader.uint32() + break default: reader.skipType(tag & 7) break @@ -2235,6 +2317,11 @@ export const MsgAddNocX509RootCert = { } else { message.cert = '' } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = Number(object.schemaVersion) + } else { + message.schemaVersion = 0 + } return message }, @@ -2242,6 +2329,7 @@ export const MsgAddNocX509RootCert = { const obj: any = {} message.signer !== undefined && (obj.signer = message.signer) message.cert !== undefined && (obj.cert = message.cert) + message.schemaVersion !== undefined && (obj.schemaVersion = message.schemaVersion) return obj }, @@ -2257,6 +2345,11 @@ export const MsgAddNocX509RootCert = { } else { message.cert = '' } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = object.schemaVersion + } else { + message.schemaVersion = 0 + } return message } } @@ -2443,7 +2536,7 @@ export const MsgRemoveX509CertResponse = { } } -const baseMsgAddNocX509Cert: object = { signer: '', cert: '' } +const baseMsgAddNocX509Cert: object = { signer: '', cert: '', schemaVersion: 0 } export const MsgAddNocX509Cert = { encode(message: MsgAddNocX509Cert, writer: Writer = Writer.create()): Writer { @@ -2453,6 +2546,9 @@ export const MsgAddNocX509Cert = { if (message.cert !== '') { writer.uint32(18).string(message.cert) } + if (message.schemaVersion !== 0) { + writer.uint32(24).uint32(message.schemaVersion) + } return writer }, @@ -2469,6 +2565,9 @@ export const MsgAddNocX509Cert = { case 2: message.cert = reader.string() break + case 3: + message.schemaVersion = reader.uint32() + break default: reader.skipType(tag & 7) break @@ -2489,6 +2588,11 @@ export const MsgAddNocX509Cert = { } else { message.cert = '' } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = Number(object.schemaVersion) + } else { + message.schemaVersion = 0 + } return message }, @@ -2496,6 +2600,7 @@ export const MsgAddNocX509Cert = { const obj: any = {} message.signer !== undefined && (obj.signer = message.signer) message.cert !== undefined && (obj.cert = message.cert) + message.schemaVersion !== undefined && (obj.schemaVersion = message.schemaVersion) return obj }, @@ -2511,6 +2616,11 @@ export const MsgAddNocX509Cert = { } else { message.cert = '' } + if (object.schemaVersion !== undefined && object.schemaVersion !== null) { + message.schemaVersion = object.schemaVersion + } else { + message.schemaVersion = 0 + } return message } } diff --git a/x/common/flags.go b/x/common/flags.go new file mode 100644 index 000000000..d9e607b2b --- /dev/null +++ b/x/common/flags.go @@ -0,0 +1,19 @@ +// Copyright 2020 DSR Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package common + +const ( + FlagSchemaVersion = "schemaVersion" +) diff --git a/x/common/schema_version.go b/x/common/schema_version.go new file mode 100644 index 000000000..b39dce824 --- /dev/null +++ b/x/common/schema_version.go @@ -0,0 +1,14 @@ +package common + +type SchemaVersion interface { + GetSchemaVersion() uint32 +} + +func GetSchemaVersionOrDefault(schemaVersion SchemaVersion) uint32 { + currentVersion := schemaVersion.GetSchemaVersion() + if currentVersion == 0 { + return 1 + } + + return currentVersion +} diff --git a/x/compliance/client/cli/tx_certify_model.go b/x/compliance/client/cli/tx_certify_model.go index dfd53360e..efa49c1e3 100644 --- a/x/compliance/client/cli/tx_certify_model.go +++ b/x/compliance/client/cli/tx_certify_model.go @@ -8,6 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/tx" "github.com/spf13/cobra" "github.com/zigbee-alliance/distributed-compliance-ledger/utils/cli" + "github.com/zigbee-alliance/distributed-compliance-ledger/x/common" "github.com/zigbee-alliance/distributed-compliance-ledger/x/compliance/types" ) @@ -35,6 +36,7 @@ func CmdCertifyModel() *cobra.Command { transport string parentChild string certificationIDOfSoftwareComponent string + schemaVersion uint32 ) cmd := &cobra.Command{ @@ -69,6 +71,7 @@ func CmdCertifyModel() *cobra.Command { transport, parentChild, certificationIDOfSoftwareComponent, + schemaVersion, ) // validate basic will be called in GenerateOrBroadcastTxCLI @@ -119,6 +122,7 @@ func CmdCertifyModel() *cobra.Command { "Parent or Child of the PFC certification route") cmd.Flags().StringVar(&certificationIDOfSoftwareComponent, FlagCertificationIDOfSoftwareComponent, "", "certification ID of software component") + cmd.Flags().Uint32Var(&schemaVersion, common.FlagSchemaVersion, 1, "Schema version") _ = cmd.MarkFlagRequired(FlagVID) _ = cmd.MarkFlagRequired(FlagPID) diff --git a/x/compliance/client/cli/tx_provision_model.go b/x/compliance/client/cli/tx_provision_model.go index 542bc1067..000ac3100 100644 --- a/x/compliance/client/cli/tx_provision_model.go +++ b/x/compliance/client/cli/tx_provision_model.go @@ -8,6 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/tx" "github.com/spf13/cobra" "github.com/zigbee-alliance/distributed-compliance-ledger/utils/cli" + "github.com/zigbee-alliance/distributed-compliance-ledger/x/common" "github.com/zigbee-alliance/distributed-compliance-ledger/x/compliance/types" ) @@ -35,6 +36,7 @@ func CmdProvisionModel() *cobra.Command { transport string parentChild string certificationIDOfSoftwareComponent string + schemaVersion uint32 ) cmd := &cobra.Command{ @@ -69,6 +71,7 @@ func CmdProvisionModel() *cobra.Command { transport, parentChild, certificationIDOfSoftwareComponent, + schemaVersion, ) // validate basic will be called in GenerateOrBroadcastTxCLI @@ -120,6 +123,7 @@ func CmdProvisionModel() *cobra.Command { "Parent or Child of the PFC certification route") cmd.Flags().StringVar(&certificationIDOfSoftwareComponent, FlagCertificationIDOfSoftwareComponent, "", "certification ID of software component") + cmd.Flags().Uint32Var(&schemaVersion, common.FlagSchemaVersion, 1, "Schema version") _ = cmd.MarkFlagRequired(FlagVID) _ = cmd.MarkFlagRequired(FlagPID) diff --git a/x/compliance/client/cli/tx_revoke_model.go b/x/compliance/client/cli/tx_revoke_model.go index 1eb6f6012..b3897018a 100644 --- a/x/compliance/client/cli/tx_revoke_model.go +++ b/x/compliance/client/cli/tx_revoke_model.go @@ -8,6 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/tx" "github.com/spf13/cobra" "github.com/zigbee-alliance/distributed-compliance-ledger/utils/cli" + "github.com/zigbee-alliance/distributed-compliance-ledger/x/common" "github.com/zigbee-alliance/distributed-compliance-ledger/x/compliance/types" ) @@ -23,6 +24,7 @@ func CmdRevokeModel() *cobra.Command { certificationType string reason string cdVersionNumber uint32 + schemaVersion uint32 ) cmd := &cobra.Command{ @@ -45,6 +47,7 @@ func CmdRevokeModel() *cobra.Command { revocationDate, certificationType, reason, + schemaVersion, ) // validate basic will be called in GenerateOrBroadcastTxCLI @@ -71,6 +74,7 @@ func CmdRevokeModel() *cobra.Command { "The date of model revocation (rfc3339 encoded), for example 2019-10-12T07:20:50.52Z") cmd.Flags().StringVar(&reason, FlagReason, "", "Optional comment describing the reason of revocation") + cmd.Flags().Uint32Var(&schemaVersion, common.FlagSchemaVersion, 1, "Schema version") _ = cmd.MarkFlagRequired(FlagVID) _ = cmd.MarkFlagRequired(FlagPID) diff --git a/x/compliance/client/cli/tx_update_compliance_info.go b/x/compliance/client/cli/tx_update_compliance_info.go index 630f698c8..998341ce7 100644 --- a/x/compliance/client/cli/tx_update_compliance_info.go +++ b/x/compliance/client/cli/tx_update_compliance_info.go @@ -8,6 +8,8 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" "github.com/spf13/cobra" + + "github.com/zigbee-alliance/distributed-compliance-ledger/x/common" "github.com/zigbee-alliance/distributed-compliance-ledger/x/compliance/types" ) @@ -35,6 +37,7 @@ func CmdUpdateComplianceInfo() *cobra.Command { OSVersion string parentChild string certificationIDOfSoftwareComponent string + schemaVersion uint32 ) cmd := &cobra.Command{ @@ -69,6 +72,7 @@ func CmdUpdateComplianceInfo() *cobra.Command { OSVersion, parentChild, certificationIDOfSoftwareComponent, + schemaVersion, ) if err := msg.ValidateBasic(); err != nil { @@ -117,6 +121,7 @@ func CmdUpdateComplianceInfo() *cobra.Command { "Parent or Child of the PFC certification route") cmd.Flags().StringVar(&certificationIDOfSoftwareComponent, FlagCertificationIDOfSoftwareComponent, "", "certification ID of software component") + cmd.Flags().Uint32Var(&schemaVersion, common.FlagSchemaVersion, 1, "Schema version") _ = cmd.MarkFlagRequired(FlagVID) _ = cmd.MarkFlagRequired(FlagPID) diff --git a/x/compliance/handler_test.go b/x/compliance/handler_test.go index 8ee017d92..13ee37ae7 100644 --- a/x/compliance/handler_test.go +++ b/x/compliance/handler_test.go @@ -354,6 +354,7 @@ func checkDeviceSoftwareCompliance( require.Equal(t, info.Transport, receivedComplianceInfo.Transport) require.Equal(t, info.ParentChild, receivedComplianceInfo.ParentChild) require.Equal(t, info.CertificationIdOfSoftwareComponent, receivedComplianceInfo.CertificationIdOfSoftwareComponent) + require.Equal(t, info.SchemaVersion, receivedComplianceInfo.SchemaVersion) } func checkRevokedModelInfo( @@ -426,6 +427,7 @@ func newMsgUpdateComplianceInfo( OSVersion: "", ParentChild: "", CertificationIdOfSoftwareComponent: "", + SchemaVersion: testconstants.SchemaVersion, } } @@ -458,6 +460,7 @@ func newMsgUpdateComplianceInfoWithAllOptionalFlags( OSVersion: "new OSVersion", ParentChild: "new ParentChild", CertificationIdOfSoftwareComponent: "new CertificationIdOfSoftwareComponent", + SchemaVersion: testconstants.SchemaVersion, } } diff --git a/x/compliance/handler_update_compliance_info_test.go b/x/compliance/handler_update_compliance_info_test.go index 831e43604..e9dc107fa 100644 --- a/x/compliance/handler_update_compliance_info_test.go +++ b/x/compliance/handler_update_compliance_info_test.go @@ -31,6 +31,7 @@ func (setup *TestSetup) checkAllComplianceInfoFieldsUpdated(t *testing.T, origin require.NotEqual(t, originalComplianceInfo.Reason, updatedComplianceInfo.Reason) require.NotEqual(t, originalComplianceInfo.SupportedClusters, updatedComplianceInfo.SupportedClusters) require.NotEqual(t, originalComplianceInfo.Transport, updatedComplianceInfo.Transport) + require.Equal(t, originalComplianceInfo.SchemaVersion, updatedComplianceInfo.SchemaVersion) } func (setup *TestSetup) checkDeviceSoftwareComplianceUpdated(t *testing.T, originalComplianceInfo *dclcompltypes.ComplianceInfo, updatedDeviceSoftwareCompliance *types.DeviceSoftwareCompliance, isUpdatedMinimally bool) { diff --git a/x/compliance/keeper/msg_server_certify_model.go b/x/compliance/keeper/msg_server_certify_model.go index bfe12ed9c..84e34340d 100644 --- a/x/compliance/keeper/msg_server_certify_model.go +++ b/x/compliance/keeper/msg_server_certify_model.go @@ -8,6 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" dclcompltypes "github.com/zigbee-alliance/distributed-compliance-ledger/types/compliance" + "github.com/zigbee-alliance/distributed-compliance-ledger/x/common" "github.com/zigbee-alliance/distributed-compliance-ledger/x/compliance/types" dclauthtypes "github.com/zigbee-alliance/distributed-compliance-ledger/x/dclauth/types" modeltypes "github.com/zigbee-alliance/distributed-compliance-ledger/x/model/types" @@ -94,6 +95,7 @@ func (k msgServer) CertifyModel(goCtx context.Context, msg *types.MsgCertifyMode History: []*dclcompltypes.ComplianceHistoryItem{}, CDVersionNumber: msg.CDVersionNumber, CDCertificateId: msg.CDCertificateId, + SchemaVersion: common.GetSchemaVersionOrDefault(msg), } } diff --git a/x/compliance/keeper/msg_server_provision_model.go b/x/compliance/keeper/msg_server_provision_model.go index 096b76690..69f8ef7f0 100644 --- a/x/compliance/keeper/msg_server_provision_model.go +++ b/x/compliance/keeper/msg_server_provision_model.go @@ -6,6 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" dclcompltypes "github.com/zigbee-alliance/distributed-compliance-ledger/types/compliance" + "github.com/zigbee-alliance/distributed-compliance-ledger/x/common" "github.com/zigbee-alliance/distributed-compliance-ledger/x/compliance/types" dclauthtypes "github.com/zigbee-alliance/distributed-compliance-ledger/x/dclauth/types" modeltypes "github.com/zigbee-alliance/distributed-compliance-ledger/x/model/types" @@ -81,6 +82,7 @@ func (k msgServer) ProvisionModel(goCtx context.Context, msg *types.MsgProvision Transport: msg.Transport, ParentChild: msg.ParentChild, CertificationIdOfSoftwareComponent: msg.CertificationIdOfSoftwareComponent, + SchemaVersion: common.GetSchemaVersionOrDefault(msg), } // store compliance info diff --git a/x/compliance/keeper/msg_server_revoke_model.go b/x/compliance/keeper/msg_server_revoke_model.go index 7e7d30898..e7ca0a4f9 100644 --- a/x/compliance/keeper/msg_server_revoke_model.go +++ b/x/compliance/keeper/msg_server_revoke_model.go @@ -8,6 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" dclcompltypes "github.com/zigbee-alliance/distributed-compliance-ledger/types/compliance" + "github.com/zigbee-alliance/distributed-compliance-ledger/x/common" "github.com/zigbee-alliance/distributed-compliance-ledger/x/compliance/types" dclauthtypes "github.com/zigbee-alliance/distributed-compliance-ledger/x/dclauth/types" modeltypes "github.com/zigbee-alliance/distributed-compliance-ledger/x/model/types" @@ -122,6 +123,7 @@ func (k msgServer) RevokeModel(goCtx context.Context, msg *types.MsgRevokeModel) SoftwareVersionCertificationStatus: dclcompltypes.CodeRevoked, History: []*dclcompltypes.ComplianceHistoryItem{}, CDVersionNumber: msg.CDVersionNumber, + SchemaVersion: common.GetSchemaVersionOrDefault(msg), } } diff --git a/x/compliance/keeper/msg_server_update_compliance_info.go b/x/compliance/keeper/msg_server_update_compliance_info.go index 50e147f98..d4dee734d 100644 --- a/x/compliance/keeper/msg_server_update_compliance_info.go +++ b/x/compliance/keeper/msg_server_update_compliance_info.go @@ -6,6 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/zigbee-alliance/distributed-compliance-ledger/x/common" "github.com/zigbee-alliance/distributed-compliance-ledger/x/compliance/types" dclauthtypes "github.com/zigbee-alliance/distributed-compliance-ledger/x/dclauth/types" modeltypes "github.com/zigbee-alliance/distributed-compliance-ledger/x/model/types" @@ -104,6 +105,8 @@ func (k msgServer) UpdateComplianceInfo(goCtx context.Context, msg *types.MsgUpd complianceInfo.Transport = msg.Transport } + complianceInfo.SchemaVersion = common.GetSchemaVersionOrDefault(msg) + //nolint:nestif if msg.CDCertificateId != "" && msg.CDCertificateId != complianceInfo.CDCertificateId { // remove the compliance info from a device software compliance with its old cd certificate id diff --git a/x/compliance/types/device_software_compliance.pb.go b/x/compliance/types/device_software_compliance.pb.go index 054a7573a..c58f7f66a 100644 --- a/x/compliance/types/device_software_compliance.pb.go +++ b/x/compliance/types/device_software_compliance.pb.go @@ -9,7 +9,7 @@ import ( io "io" math "math" math_bits "math/bits" - + dclcompltypes "github.com/zigbee-alliance/distributed-compliance-ledger/types/compliance" ) @@ -25,7 +25,7 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type DeviceSoftwareCompliance struct { - CDCertificateId string `protobuf:"bytes,1,opt,name=cDCertificateId,proto3" json:"cDCertificateId,omitempty"` + CDCertificateId string `protobuf:"bytes,1,opt,name=cDCertificateId,proto3" json:"cDCertificateId,omitempty"` ComplianceInfo []*dclcompltypes.ComplianceInfo `protobuf:"bytes,2,rep,name=complianceInfo,proto3" json:"complianceInfo,omitempty"` } diff --git a/x/compliance/types/genesis.pb.go b/x/compliance/types/genesis.pb.go index 336847dd6..87fd77e37 100644 --- a/x/compliance/types/genesis.pb.go +++ b/x/compliance/types/genesis.pb.go @@ -10,7 +10,7 @@ import ( io "io" math "math" math_bits "math/bits" - + dclcompltypes "github.com/zigbee-alliance/distributed-compliance-ledger/types/compliance" ) @@ -28,10 +28,10 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the compliance module's genesis state. type GenesisState struct { ComplianceInfoList []dclcompltypes.ComplianceInfo `protobuf:"bytes,1,rep,name=complianceInfoList,proto3" json:"complianceInfoList"` - CertifiedModelList []CertifiedModel `protobuf:"bytes,2,rep,name=certifiedModelList,proto3" json:"certifiedModelList"` - RevokedModelList []RevokedModel `protobuf:"bytes,3,rep,name=revokedModelList,proto3" json:"revokedModelList"` - ProvisionalModelList []ProvisionalModel `protobuf:"bytes,4,rep,name=provisionalModelList,proto3" json:"provisionalModelList"` - DeviceSoftwareComplianceList []DeviceSoftwareCompliance `protobuf:"bytes,5,rep,name=deviceSoftwareComplianceList,proto3" json:"deviceSoftwareComplianceList"` + CertifiedModelList []CertifiedModel `protobuf:"bytes,2,rep,name=certifiedModelList,proto3" json:"certifiedModelList"` + RevokedModelList []RevokedModel `protobuf:"bytes,3,rep,name=revokedModelList,proto3" json:"revokedModelList"` + ProvisionalModelList []ProvisionalModel `protobuf:"bytes,4,rep,name=provisionalModelList,proto3" json:"provisionalModelList"` + DeviceSoftwareComplianceList []DeviceSoftwareCompliance `protobuf:"bytes,5,rep,name=deviceSoftwareComplianceList,proto3" json:"deviceSoftwareComplianceList"` } func (m *GenesisState) Reset() { *m = GenesisState{} } diff --git a/x/compliance/types/message_certify_model.go b/x/compliance/types/message_certify_model.go index ba6f9926d..3a7ce5401 100644 --- a/x/compliance/types/message_certify_model.go +++ b/x/compliance/types/message_certify_model.go @@ -18,6 +18,7 @@ func NewMsgCertifyModel( certificationDate string, certificationType string, reason string, programTypeVersion string, cDCertificateID string, familyID string, supportedClusters string, compliantPlatformUsed string, compliantPlatformVersion string, osVersion string, certificationRoute string, programType string, transport string, parentChild string, certificationIDOfSoftwareComponent string, + schemaVersion uint32, ) *MsgCertifyModel { return &MsgCertifyModel{ Signer: signer, @@ -41,6 +42,7 @@ func NewMsgCertifyModel( Transport: transport, ParentChild: parentChild, CertificationIdOfSoftwareComponent: certificationIDOfSoftwareComponent, + SchemaVersion: schemaVersion, } } diff --git a/x/compliance/types/message_provision_model.go b/x/compliance/types/message_provision_model.go index 4dfcb13a9..3c507f4a8 100644 --- a/x/compliance/types/message_provision_model.go +++ b/x/compliance/types/message_provision_model.go @@ -18,6 +18,7 @@ func NewMsgProvisionModel( provisionalDate string, certificationType string, reason string, programTypeVersion string, cDCertificateID string, familyID string, supportedClusters string, compliantPlatformUsed string, compliantPlatformVersion string, osVersion string, certificationRoute string, programType string, transport string, parentChild string, certificationIDOfSoftwareComponent string, + schemaVersion uint32, ) *MsgProvisionModel { return &MsgProvisionModel{ Signer: signer, @@ -41,6 +42,7 @@ func NewMsgProvisionModel( Transport: transport, ParentChild: parentChild, CertificationIdOfSoftwareComponent: certificationIDOfSoftwareComponent, + SchemaVersion: schemaVersion, } } diff --git a/x/compliance/types/message_revoke_model.go b/x/compliance/types/message_revoke_model.go index bfa89f4f3..72a7b51b3 100644 --- a/x/compliance/types/message_revoke_model.go +++ b/x/compliance/types/message_revoke_model.go @@ -15,7 +15,7 @@ var _ sdk.Msg = &MsgRevokeModel{} func NewMsgRevokeModel( signer string, vid int32, pid int32, softwareVersion uint32, softwareVersionString string, cdVersionNumber uint32, - revocationDate string, certificationType string, reason string, + revocationDate string, certificationType string, reason string, schemaVersion uint32, ) *MsgRevokeModel { return &MsgRevokeModel{ Signer: signer, @@ -27,6 +27,7 @@ func NewMsgRevokeModel( RevocationDate: revocationDate, CertificationType: certificationType, Reason: reason, + SchemaVersion: schemaVersion, } } diff --git a/x/compliance/types/message_update_compliance_info.go b/x/compliance/types/message_update_compliance_info.go index 6c2558316..21354c379 100644 --- a/x/compliance/types/message_update_compliance_info.go +++ b/x/compliance/types/message_update_compliance_info.go @@ -14,7 +14,11 @@ var _ sdk.Msg = &MsgUpdateComplianceInfo{} const TypeMsgUpdateComplianceInfo = "update_compliance_info" -func NewMsgUpdateComplianceInfo(creator string, vid int32, pid int32, softwareVersion uint32, certificationType string, cDVersionNumber string, date string, reason string, owner string, cDCertificateID string, certificationRoute string, programType string, programTypeVersion string, compliantPlatformUsed string, compliantPlatformVersion string, transport string, familyID string, supportedClusters string, oSVersion string, parentChild string, certificationIDOfSoftwareComponent string) *MsgUpdateComplianceInfo { +func NewMsgUpdateComplianceInfo(creator string, vid int32, pid int32, softwareVersion uint32, certificationType string, + cDVersionNumber string, date string, reason string, owner string, cDCertificateID string, certificationRoute string, + programType string, programTypeVersion string, compliantPlatformUsed string, compliantPlatformVersion string, + transport string, familyID string, supportedClusters string, oSVersion string, parentChild string, + certificationIDOfSoftwareComponent string, schemaVersion uint32) *MsgUpdateComplianceInfo { return &MsgUpdateComplianceInfo{ Creator: creator, Vid: vid, @@ -37,6 +41,7 @@ func NewMsgUpdateComplianceInfo(creator string, vid int32, pid int32, softwareVe OSVersion: oSVersion, ParentChild: parentChild, CertificationIdOfSoftwareComponent: certificationIDOfSoftwareComponent, + SchemaVersion: schemaVersion, } } diff --git a/x/compliance/types/tx.pb.go b/x/compliance/types/tx.pb.go index 77df97f40..801f0227c 100644 --- a/x/compliance/types/tx.pb.go +++ b/x/compliance/types/tx.pb.go @@ -51,6 +51,7 @@ type MsgCertifyModel struct { Transport string `protobuf:"bytes,19,opt,name=transport,proto3" json:"transport,omitempty" validate:"max=64"` ParentChild string `protobuf:"bytes,20,opt,name=parentChild,proto3" json:"parentChild,omitempty" validate:"max=64"` CertificationIdOfSoftwareComponent string `protobuf:"bytes,21,opt,name=certificationIdOfSoftwareComponent,proto3" json:"certificationIdOfSoftwareComponent,omitempty" validate:"max=64"` + SchemaVersion uint32 `protobuf:"varint,22,opt,name=schemaVersion,proto3" json:"schemaVersion,omitempty"` } func (m *MsgCertifyModel) Reset() { *m = MsgCertifyModel{} } @@ -233,6 +234,13 @@ func (m *MsgCertifyModel) GetCertificationIdOfSoftwareComponent() string { return "" } +func (m *MsgCertifyModel) GetSchemaVersion() uint32 { + if m != nil { + return m.SchemaVersion + } + return 0 +} + type MsgCertifyModelResponse struct { } @@ -279,6 +287,7 @@ type MsgRevokeModel struct { RevocationDate string `protobuf:"bytes,7,opt,name=revocationDate,proto3" json:"revocationDate,omitempty" validate:"required"` CertificationType string `protobuf:"bytes,8,opt,name=certificationType,proto3" json:"certificationType,omitempty" validate:"required,max=100"` Reason string `protobuf:"bytes,9,opt,name=reason,proto3" json:"reason,omitempty" validate:"max=102400"` + SchemaVersion uint32 `protobuf:"varint,10,opt,name=schemaVersion,proto3" json:"schemaVersion,omitempty"` } func (m *MsgRevokeModel) Reset() { *m = MsgRevokeModel{} } @@ -377,6 +386,13 @@ func (m *MsgRevokeModel) GetReason() string { return "" } +func (m *MsgRevokeModel) GetSchemaVersion() uint32 { + if m != nil { + return m.SchemaVersion + } + return 0 +} + type MsgRevokeModelResponse struct { } @@ -435,6 +451,7 @@ type MsgProvisionModel struct { Transport string `protobuf:"bytes,19,opt,name=transport,proto3" json:"transport,omitempty" validate:"max=64"` ParentChild string `protobuf:"bytes,20,opt,name=parentChild,proto3" json:"parentChild,omitempty" validate:"max=64"` CertificationIdOfSoftwareComponent string `protobuf:"bytes,21,opt,name=certificationIdOfSoftwareComponent,proto3" json:"certificationIdOfSoftwareComponent,omitempty" validate:"max=64"` + SchemaVersion uint32 `protobuf:"varint,22,opt,name=schemaVersion,proto3" json:"schemaVersion,omitempty"` } func (m *MsgProvisionModel) Reset() { *m = MsgProvisionModel{} } @@ -617,6 +634,13 @@ func (m *MsgProvisionModel) GetCertificationIdOfSoftwareComponent() string { return "" } +func (m *MsgProvisionModel) GetSchemaVersion() uint32 { + if m != nil { + return m.SchemaVersion + } + return 0 +} + type MsgProvisionModelResponse struct { } @@ -675,6 +699,7 @@ type MsgUpdateComplianceInfo struct { OSVersion string `protobuf:"bytes,19,opt,name=OSVersion,proto3" json:"OSVersion,omitempty" validate:"omitempty,max=64"` ParentChild string `protobuf:"bytes,20,opt,name=parentChild,proto3" json:"parentChild,omitempty" validate:"omitempty,max=64"` CertificationIdOfSoftwareComponent string `protobuf:"bytes,21,opt,name=certificationIdOfSoftwareComponent,proto3" json:"certificationIdOfSoftwareComponent,omitempty" validate:"omitempty,max=64"` + SchemaVersion uint32 `protobuf:"varint,22,opt,name=schemaVersion,proto3" json:"schemaVersion,omitempty"` } func (m *MsgUpdateComplianceInfo) Reset() { *m = MsgUpdateComplianceInfo{} } @@ -857,6 +882,13 @@ func (m *MsgUpdateComplianceInfo) GetCertificationIdOfSoftwareComponent() string return "" } +func (m *MsgUpdateComplianceInfo) GetSchemaVersion() uint32 { + if m != nil { + return m.SchemaVersion + } + return 0 +} + type MsgUpdateComplianceInfoResponse struct { } @@ -1021,78 +1053,79 @@ func init() { func init() { proto.RegisterFile("compliance/tx.proto", fileDescriptor_db4a0d801b7ae7cc) } var fileDescriptor_db4a0d801b7ae7cc = []byte{ - // 1131 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x99, 0x4f, 0x6f, 0xe3, 0xc4, - 0x1b, 0xc7, 0xeb, 0xed, 0xbf, 0xed, 0xa4, 0x7f, 0x36, 0xd3, 0xf6, 0xb7, 0xd3, 0xac, 0x94, 0xf4, - 0x17, 0x2e, 0x3d, 0x6c, 0x93, 0x76, 0xbb, 0x5d, 0x24, 0x56, 0x15, 0x6a, 0xd3, 0xc2, 0x46, 0x4b, - 0xb6, 0x25, 0xdd, 0xee, 0x01, 0x0e, 0xc8, 0x8d, 0x9f, 0x78, 0x47, 0x38, 0x1e, 0x33, 0x33, 0xe9, - 0xb6, 0x1c, 0x11, 0xdc, 0x79, 0x0f, 0x48, 0x9c, 0x10, 0x27, 0xce, 0x48, 0xdc, 0x10, 0xa7, 0x15, - 0x27, 0x4e, 0x11, 0x6a, 0xdf, 0x41, 0x5e, 0x01, 0xb2, 0x9d, 0x38, 0xb6, 0xe3, 0xb8, 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x57, 0xe1, 0x84, 0x7d, 0x0e, 0x43, 0x40, 0xdf, 0x22, 0xa0, 0xdf, 0x47, 0xb3, - 0x1c, 0x4e, 0x58, 0x72, 0x3a, 0x87, 0xc2, 0x6f, 0x1f, 0xcd, 0x79, 0x82, 0xfe, 0x17, 0x5c, 0x4b, - 0xde, 0x32, 0xfb, 0x2a, 0x85, 0xd2, 0x15, 0xa1, 0x1f, 0x70, 0x76, 0x42, 0xed, 0x3e, 0x0f, 0x57, - 0xda, 0x2d, 0xae, 0xb4, 0x6d, 0x34, 0x67, 0x75, 0x27, 0x42, 0x35, 0x92, 0x2c, 0xb5, 0x70, 0xfc, - 0xf0, 0x1a, 0x30, 0xbc, 0x06, 0x0c, 0xaf, 0x01, 0xff, 0xb6, 0x6b, 0xc0, 0x03, 0xb4, 0xd4, 0xc7, - 0x60, 0x8f, 0xd0, 0x3f, 0xa6, 0x9c, 0x4b, 0xc2, 0x91, 0x65, 0xfb, 0x96, 0xbc, 0x67, 0xbe, 0xb2, - 0x59, 0x67, 0xb8, 0x8c, 0x26, 0x6b, 0x1c, 0x54, 0xc9, 0xae, 0x0c, 0xea, 0xae, 0xfe, 0x1f, 0x46, - 0xea, 0x8f, 0xa2, 0x30, 0x96, 0x8c, 0xd2, 0x11, 0x14, 0x2b, 0x47, 0x13, 0xba, 0x0f, 0x89, 0xac, - 0x41, 0x25, 0x34, 0x2c, 0x79, 0xe6, 0x87, 0x49, 0x10, 0xd1, 0x18, 0x8d, 0x69, 0x1e, 0x97, 0xab, - 0xce, 0x67, 0xfc, 0xd4, 0x83, 0xa4, 0x0b, 0xda, 0x77, 0xda, 0xad, 0x5c, 0x6e, 0x90, 0x6b, 0x18, - 0x97, 0x05, 0x34, 0xce, 0xde, 0xd8, 0x27, 0xad, 0x0b, 0x58, 0x32, 0x70, 0xa6, 0xdc, 0x30, 0xb7, - 0x2f, 0x41, 0x2e, 0xa2, 0xc4, 0x7d, 0x09, 0x82, 0x71, 0x3f, 0x72, 0x2f,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0xc6, 0x67, 0x57, 0xcf, 0x10, 0x74, 0xca, 0x1c, 0xdc, 0x94, 0x93, 0x57, 0xee, 0xcf, - 0x0a, 0x5a, 0x88, 0xbc, 0x3d, 0x5d, 0x63, 0xf6, 0xa2, 0xfc, 0x32, 0xaf, 0x6e, 0xd6, 0x2f, 0xd0, - 0x81, 0x48, 0x54, 0x5c, 0xa3, 0x03, 0x51, 0x7e, 0xd7, 0xe9, 0x40, 0xdc, 0x3e, 0xdc, 0x81, 0x5f, - 0xcf, 0xb3, 0xca, 0xdb, 0xf3, 0xac, 0xf2, 0xe7, 0x79, 0x56, 0xf9, 0xf6, 0x22, 0x3b, 0xf2, 0xf6, - 0x22, 0x3b, 0xf2, 0xc7, 0x45, 0x76, 0xe4, 0x93, 0xe7, 0x3a, 0x95, 0xaf, 0x9b, 0xc7, 0xb6, 0x59, - 0xd1, 0xcd, 0xbd, 0xda, 0x4d, 0x5e, 0xf4, 0x25, 0x5f, 0xed, 0x25, 0x5b, 0x75, 0xd3, 0x17, 0x4f, - 0x8b, 0xfe, 0xf7, 0x27, 0x67, 0x16, 0x88, 0xe3, 0x09, 0xe7, 0xdd, 0xc6, 0xc6, 0x5f, 0x01, 0x00, - 0x00, 0xff, 0xff, 0xc4, 0x25, 0xd9, 0xa6, 0x5a, 0x19, 0x00, 0x00, + // 1151 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x99, 0xcf, 0x4f, 0xe3, 0x46, + 0x14, 0xc7, 0xf1, 0xf2, 0x6b, 0x99, 0xf0, 0x63, 0x33, 0xc0, 0xee, 0x90, 0x95, 0x12, 0x9a, 0xf6, + 0xc0, 0x61, 0x49, 0x60, 0x59, 0xb6, 0x52, 0x57, 0xa8, 0x82, 0x40, 0xbb, 0xd1, 0x36, 0x0b, 0x0d, + 0xcb, 0x1e, 0xda, 0x43, 0x65, 0xe2, 0x17, 0x63, 0xd5, 0xf6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 0xf3, 0x3d, 0x0f, 0x57, 0xfa, 0xf0, 0x91, 0xad, 0xee, 0x06, 0xe2, 0x1d, + 0x84, 0x2d, 0x46, 0x55, 0x26, 0x1b, 0xb6, 0x83, 0xd7, 0x15, 0xe4, 0xc8, 0xe7, 0x3b, 0xed, 0x42, + 0x36, 0x2c, 0xb7, 0x17, 0x37, 0x46, 0xe0, 0xae, 0x6c, 0xc5, 0x2f, 0x08, 0xaa, 0x0a, 0xc9, 0xa4, + 0xea, 0x54, 0x54, 0x86, 0x57, 0xd1, 0xed, 0xa6, 0x6c, 0x68, 0xfa, 0x69, 0x55, 0x21, 0x93, 0x49, + 0x65, 0xf8, 0x61, 0xb8, 0x82, 0xb2, 0xbc, 0x65, 0x59, 0x94, 0x09, 0x50, 0x2a, 0x7a, 0x8b, 0x0b, + 0x60, 0x9c, 0x4c, 0x25, 0x69, 0xfb, 0xe3, 0xf1, 0x33, 0x34, 0xef, 0x3d, 0x9b, 0x62, 0x4f, 0x97, + 0x45, 0x93, 0x32, 0xe3, 0x80, 0x83, 0x42, 0xa6, 0x93, 0x8c, 0xe2, 0x35, 0xf8, 0x53, 0x44, 0xfa, + 0x3e, 0xf0, 0xd6, 0x76, 0x26, 0xc9, 0x6f, 0xa0, 0x0c, 0xaf, 0xa1, 0x89, 0xdd, 0x7d, 0xcf, 0xe3, + 0x4e, 0x92, 0x47, 0x2f, 0xce, 0xee, 0x6e, 0x68, 0x97, 0xd4, 0x69, 0x4b, 0x00, 0xc9, 0x26, 0x76, + 0xb7, 0x5f, 0x80, 0xdf, 0x47, 0x99, 0x40, 0xcf, 0x09, 0x4e, 0xd2, 0x07, 0x23, 0xed, 0xa2, 0x05, + 0x93, 0x4d, 0x6e, 0xaf, 0x35, 0x99, 0x4d, 0x2c, 0xda, 0x8f, 0x73, 0xb2, 0xc9, 0x0c, 0x4c, 0x51, + 0x39, 0xd2, 0x74, 0x85, 0xcc, 0x25, 0x67, 0xeb, 0x45, 0x62, 0x40, 0xc5, 0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 0x2d, 0xf2, 0x19, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1339,6 +1372,13 @@ func (m *MsgCertifyModel) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.SchemaVersion != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.SchemaVersion)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb0 + } if len(m.CertificationIdOfSoftwareComponent) > 0 { i -= len(m.CertificationIdOfSoftwareComponent) copy(dAtA[i:], m.CertificationIdOfSoftwareComponent) @@ -1536,6 +1576,11 @@ func (m *MsgRevokeModel) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.SchemaVersion != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.SchemaVersion)) + i-- + dAtA[i] = 0x50 + } if len(m.Reason) > 0 { i -= len(m.Reason) copy(dAtA[i:], m.Reason) @@ -1637,6 +1682,13 @@ func (m *MsgProvisionModel) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.SchemaVersion != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.SchemaVersion)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb0 + } if len(m.CertificationIdOfSoftwareComponent) > 0 { i -= len(m.CertificationIdOfSoftwareComponent) copy(dAtA[i:], m.CertificationIdOfSoftwareComponent) @@ -1834,6 +1886,13 @@ func (m *MsgUpdateComplianceInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) _ = i var l int _ = l + if m.SchemaVersion != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.SchemaVersion)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb0 + } if len(m.CertificationIdOfSoftwareComponent) > 0 { i -= len(m.CertificationIdOfSoftwareComponent) copy(dAtA[i:], m.CertificationIdOfSoftwareComponent) @@ -2185,6 +2244,9 @@ func (m *MsgCertifyModel) Size() (n int) { if l > 0 { n += 2 + l + sovTx(uint64(l)) } + if m.SchemaVersion != 0 { + n += 2 + sovTx(uint64(m.SchemaVersion)) + } return n } @@ -2235,6 +2297,9 @@ func (m *MsgRevokeModel) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } + if m.SchemaVersion != 0 { + n += 1 + sovTx(uint64(m.SchemaVersion)) + } return n } @@ -2333,6 +2398,9 @@ func (m *MsgProvisionModel) Size() (n int) { if l > 0 { n += 2 + l + sovTx(uint64(l)) } + if m.SchemaVersion != 0 { + n += 2 + sovTx(uint64(m.SchemaVersion)) + } return n } @@ -2432,6 +2500,9 @@ func (m *MsgUpdateComplianceInfo) Size() (n int) { if l > 0 { n += 2 + l + sovTx(uint64(l)) } + if m.SchemaVersion != 0 { + n += 2 + sovTx(uint64(m.SchemaVersion)) + } return n } @@ -3134,6 +3205,25 @@ func (m *MsgCertifyModel) Unmarshal(dAtA []byte) error { } m.CertificationIdOfSoftwareComponent = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 22: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SchemaVersion", wireType) + } + m.SchemaVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SchemaVersion |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -3470,6 +3560,25 @@ func (m *MsgRevokeModel) Unmarshal(dAtA []byte) error { } m.Reason = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SchemaVersion", wireType) + } + m.SchemaVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SchemaVersion |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -4190,6 +4299,25 @@ func (m *MsgProvisionModel) Unmarshal(dAtA []byte) error { } m.CertificationIdOfSoftwareComponent = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 22: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SchemaVersion", wireType) + } + m.SchemaVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SchemaVersion |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -4923,6 +5051,25 @@ func (m *MsgUpdateComplianceInfo) Unmarshal(dAtA []byte) error { } m.CertificationIdOfSoftwareComponent = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 22: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SchemaVersion", wireType) + } + m.SchemaVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SchemaVersion |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) diff --git a/x/model/client/cli/tx_model.go b/x/model/client/cli/tx_model.go index fc1d89ecd..a5b2bed47 100644 --- a/x/model/client/cli/tx_model.go +++ b/x/model/client/cli/tx_model.go @@ -7,6 +7,7 @@ import ( "github.com/spf13/cobra" "github.com/zigbee-alliance/distributed-compliance-ledger/utils" "github.com/zigbee-alliance/distributed-compliance-ledger/utils/cli" + "github.com/zigbee-alliance/distributed-compliance-ledger/x/common" "github.com/zigbee-alliance/distributed-compliance-ledger/x/model/types" ) @@ -28,6 +29,7 @@ func CmdCreateModel() *cobra.Command { supportURL string productURL string lsfURL string + schemaVersion uint32 ) cmd := &cobra.Command{ @@ -63,6 +65,7 @@ func CmdCreateModel() *cobra.Command { supportURL, productURL, lsfURL, + schemaVersion, ) // validate basic will be called in GenerateOrBroadcastTxCLI @@ -125,6 +128,7 @@ and for these values the commissioningModeSecondaryStepInstruction SHALL be set` "URL that contains product specific web page that contains details for the device model.") cmd.Flags().StringVar(&lsfURL, FlagLsfURL, "", "URL to the Localized String File of this product") cli.AddTxFlagsToCmd(cmd) + cmd.Flags().Uint32Var(&schemaVersion, common.FlagSchemaVersion, 1, "Schema version") _ = cmd.MarkFlagRequired(FlagVid) _ = cmd.MarkFlagRequired(FlagPid) @@ -150,6 +154,7 @@ func CmdUpdateModel() *cobra.Command { productURL string lsfURL string lsfRevision int32 + schemaVersion uint32 ) cmd := &cobra.Command{ @@ -182,6 +187,7 @@ func CmdUpdateModel() *cobra.Command { productURL, lsfURL, lsfRevision, + schemaVersion, ) // validate basic will be called in GenerateOrBroadcastTxCLI @@ -226,6 +232,8 @@ and for these values the commissioningModeSecondaryStepInstruction SHALL be set` cmd.Flags().StringVar(&lsfURL, FlagLsfURL, "", "URL to the Localized String File of this product") cmd.Flags().Int32Var(&lsfRevision, FlagLsfRevision, 0, "LsfRevision is a monotonically increasing positive integer indicating the latest available version of Localized String File") + cmd.Flags().Uint32Var(&schemaVersion, common.FlagSchemaVersion, 1, "Schema version") + cli.AddTxFlagsToCmd(cmd) _ = cmd.MarkFlagRequired(FlagVid) diff --git a/x/model/client/cli/tx_model_version.go b/x/model/client/cli/tx_model_version.go index 8393243d6..1c45a8fc1 100644 --- a/x/model/client/cli/tx_model_version.go +++ b/x/model/client/cli/tx_model_version.go @@ -6,6 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/tx" "github.com/spf13/cobra" "github.com/zigbee-alliance/distributed-compliance-ledger/utils/cli" + "github.com/zigbee-alliance/distributed-compliance-ledger/x/common" "github.com/zigbee-alliance/distributed-compliance-ledger/x/model/types" ) @@ -25,6 +26,7 @@ func CmdCreateModelVersion() *cobra.Command { minApplicableSoftwareVersion uint32 maxApplicableSoftwareVersion uint32 releaseNotesURL string + schemaVersion uint32 ) cmd := &cobra.Command{ @@ -52,6 +54,7 @@ func CmdCreateModelVersion() *cobra.Command { minApplicableSoftwareVersion, maxApplicableSoftwareVersion, releaseNotesURL, + schemaVersion, ) // validate basic will be called in GenerateOrBroadcastTxCLI @@ -102,6 +105,7 @@ SoftwareVersion for which this image can be applied`) cmd.Flags().StringVar(&releaseNotesURL, FlagReleaseNotesURL, "", `URL that contains product specific web page that contains release notes for the device model.`) + cmd.Flags().Uint32Var(&schemaVersion, common.FlagSchemaVersion, 1, "Schema version") cli.AddTxFlagsToCmd(cmd) @@ -129,6 +133,7 @@ func CmdUpdateModelVersion() *cobra.Command { minApplicableSoftwareVersion uint32 maxApplicableSoftwareVersion uint32 releaseNotesURL string + schemaVersion uint32 ) cmd := &cobra.Command{ @@ -152,6 +157,7 @@ func CmdUpdateModelVersion() *cobra.Command { minApplicableSoftwareVersion, maxApplicableSoftwareVersion, releaseNotesURL, + schemaVersion, ) // validate basic will be called in GenerateOrBroadcastTxCLI @@ -187,6 +193,7 @@ func CmdUpdateModelVersion() *cobra.Command { `MaxApplicableSoftwareVersion should specify the highest SoftwareVersion for which this image can be applied`) cmd.Flags().StringVar(&releaseNotesURL, FlagReleaseNotesURL, "", `URL that contains product specific web page that contains release notes for the device model.`) + cmd.Flags().Uint32Var(&schemaVersion, common.FlagSchemaVersion, 1, "Schema version") cli.AddTxFlagsToCmd(cmd) diff --git a/x/model/handler_test.go b/x/model/handler_test.go index 854e241da..6d8bd2c39 100644 --- a/x/model/handler_test.go +++ b/x/model/handler_test.go @@ -170,6 +170,7 @@ func TestHandler_AddModel(t *testing.T) { require.Equal(t, msgCreateModel.Vid, receivedModel.Vid) require.Equal(t, msgCreateModel.Pid, receivedModel.Pid) require.Equal(t, msgCreateModel.DeviceTypeId, receivedModel.DeviceTypeId) + require.Equal(t, testconstants.SchemaVersion, receivedModel.SchemaVersion) } func TestHandler_UpdateModel(t *testing.T) { @@ -186,12 +187,19 @@ func TestHandler_UpdateModel(t *testing.T) { _, err = setup.Handler(setup.Ctx, msgCreateModel) require.NoError(t, err) + // query model + receivedModel, err := queryModel(setup, msgUpdateModel.Vid, msgUpdateModel.Pid) + require.NoError(t, err) + require.Equal(t, testconstants.SchemaVersion, receivedModel.SchemaVersion) + // update existing model + var newSchemaVersion uint32 = 2 + msgUpdateModel.SchemaVersion = newSchemaVersion _, err = setup.Handler(setup.Ctx, msgUpdateModel) require.NoError(t, err) // query updated model - receivedModel, err := queryModel(setup, msgUpdateModel.Vid, msgUpdateModel.Pid) + receivedModel, err = queryModel(setup, msgUpdateModel.Vid, msgUpdateModel.Pid) require.NoError(t, err) // check @@ -200,6 +208,7 @@ func TestHandler_UpdateModel(t *testing.T) { require.Equal(t, msgUpdateModel.Vid, receivedModel.Vid) require.Equal(t, msgUpdateModel.Pid, receivedModel.Pid) require.Equal(t, msgUpdateModel.ProductLabel, receivedModel.ProductLabel) + require.Equal(t, newSchemaVersion, receivedModel.SchemaVersion) } func TestHandler_UpdateModelByVendorWithProductIds(t *testing.T) { @@ -726,6 +735,7 @@ func TestHandler_AddModelVersion(t *testing.T) { // add new model version msgCreateModelVersion := NewMsgCreateModelVersion(setup.Vendor, testconstants.SoftwareVersion) + schemaVersion := msgCreateModelVersion.SchemaVersion _, err = setup.Handler(setup.Ctx, msgCreateModelVersion) require.NoError(t, err) @@ -756,6 +766,7 @@ func TestHandler_AddModelVersion(t *testing.T) { require.Equal(t, msgCreateModelVersion.Vid, receivedModelVersions.Vid) require.Equal(t, msgCreateModelVersion.Pid, receivedModelVersions.Pid) require.Equal(t, []uint32{msgCreateModelVersion.SoftwareVersion}, receivedModelVersions.SoftwareVersions) + require.Equal(t, schemaVersion, receivedModelVersion.SchemaVersion) } func TestHandler_AddMultipleModelVersions(t *testing.T) { @@ -830,7 +841,6 @@ func TestHandler_UpdateModelVersion(t *testing.T) { // try update not present model version msgUpdateModelVersion := NewMsgUpdateModelVersion(setup.Vendor) - _, err = setup.Handler(setup.Ctx, msgUpdateModelVersion) require.Error(t, err) require.True(t, types.ErrModelVersionDoesNotExist.Is(err)) @@ -841,6 +851,8 @@ func TestHandler_UpdateModelVersion(t *testing.T) { require.NoError(t, err) // update existing model version + var newSchemaVersion uint32 = 2 + msgUpdateModelVersion.SchemaVersion = newSchemaVersion _, err = setup.Handler(setup.Ctx, msgUpdateModelVersion) require.NoError(t, err) @@ -872,6 +884,8 @@ func TestHandler_UpdateModelVersion(t *testing.T) { require.Equal(t, receivedModelVersion.FirmwareInformation, msgCreateModelVersion.FirmwareInformation) require.Equal(t, receivedModelVersion.OtaChecksum, msgCreateModelVersion.OtaChecksum+"updated") require.Equal(t, receivedModelVersion.OtaChecksumType, msgCreateModelVersion.OtaChecksumType) + require.Equal(t, receivedModelVersion.OtaChecksumType, msgCreateModelVersion.OtaChecksumType) + require.Equal(t, newSchemaVersion, receivedModelVersion.SchemaVersion) // query model versions receivedModelVersions, err := queryAllModelVersions( @@ -1611,6 +1625,7 @@ func NewMsgCreateModelVersion(signer sdk.AccAddress, softwareVersion uint32) *ty MinApplicableSoftwareVersion: testconstants.MinApplicableSoftwareVersion, MaxApplicableSoftwareVersion: testconstants.MaxApplicableSoftwareVersion, ReleaseNotesUrl: testconstants.ReleaseNotesURL, + SchemaVersion: testconstants.SchemaVersion, } } diff --git a/x/model/keeper/msg_server_model.go b/x/model/keeper/msg_server_model.go index 550d6acd0..9dbb0769d 100644 --- a/x/model/keeper/msg_server_model.go +++ b/x/model/keeper/msg_server_model.go @@ -5,6 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/zigbee-alliance/distributed-compliance-ledger/x/common" "github.com/zigbee-alliance/distributed-compliance-ledger/x/model/types" ) @@ -48,6 +49,7 @@ func (k msgServer) CreateModel(goCtx context.Context, msg *types.MsgCreateModel) SupportUrl: msg.SupportUrl, ProductUrl: msg.ProductUrl, LsfUrl: msg.LsfUrl, + SchemaVersion: common.GetSchemaVersionOrDefault(msg), } // if LsfUrl is not empty, we set lsfRevision to default value of 1 @@ -63,9 +65,10 @@ func (k msgServer) CreateModel(goCtx context.Context, msg *types.MsgCreateModel) // store new product in VendorProducts k.SetVendorProduct(ctx, model.Vid, types.Product{ - Pid: model.Pid, - Name: model.ProductName, - PartNumber: model.PartNumber, + Pid: model.Pid, + Name: model.ProductName, + PartNumber: model.PartNumber, + SchemaVersion: common.GetSchemaVersionOrDefault(msg), }) return &types.MsgCreateModelResponse{}, nil @@ -131,6 +134,8 @@ func (k msgServer) UpdateModel(goCtx context.Context, msg *types.MsgUpdateModel) model.ProductUrl = msg.ProductUrl } + model.SchemaVersion = common.GetSchemaVersionOrDefault(msg) + if msg.LsfRevision > 0 { // If lsfRevision is set but no lsfURL is provided or present in model if msg.LsfUrl == "" && model.LsfUrl == "" { @@ -155,9 +160,10 @@ func (k msgServer) UpdateModel(goCtx context.Context, msg *types.MsgUpdateModel) // store updated product in VendorProducts k.SetVendorProduct(ctx, model.Vid, types.Product{ - Pid: model.Pid, - Name: model.ProductName, - PartNumber: model.PartNumber, + Pid: model.Pid, + Name: model.ProductName, + PartNumber: model.PartNumber, + SchemaVersion: common.GetSchemaVersionOrDefault(msg), }) return &types.MsgUpdateModelResponse{}, nil diff --git a/x/model/keeper/msg_server_model_version.go b/x/model/keeper/msg_server_model_version.go index ee87ac939..245c1b1f5 100644 --- a/x/model/keeper/msg_server_model_version.go +++ b/x/model/keeper/msg_server_model_version.go @@ -6,6 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" dclcompltypes "github.com/zigbee-alliance/distributed-compliance-ledger/types/compliance" + "github.com/zigbee-alliance/distributed-compliance-ledger/x/common" "github.com/zigbee-alliance/distributed-compliance-ledger/x/model/types" ) @@ -58,6 +59,7 @@ func (k msgServer) CreateModelVersion(goCtx context.Context, msg *types.MsgCreat MinApplicableSoftwareVersion: msg.MinApplicableSoftwareVersion, MaxApplicableSoftwareVersion: msg.MaxApplicableSoftwareVersion, ReleaseNotesUrl: msg.ReleaseNotesUrl, + SchemaVersion: common.GetSchemaVersionOrDefault(msg), } // store new model version @@ -133,6 +135,8 @@ func (k msgServer) UpdateModelVersion(goCtx context.Context, msg *types.MsgUpdat modelVersion.ReleaseNotesUrl = msg.ReleaseNotesUrl } + modelVersion.SchemaVersion = common.GetSchemaVersionOrDefault(msg) + // store updated model version k.SetModelVersion(ctx, modelVersion) diff --git a/x/model/types/messages_model.go b/x/model/types/messages_model.go index bc77f866e..5be279c51 100644 --- a/x/model/types/messages_model.go +++ b/x/model/types/messages_model.go @@ -32,6 +32,7 @@ func NewMsgCreateModel( supportURL string, productURL string, lsfURL string, + schemaVersion uint32, ) *MsgCreateModel { return &MsgCreateModel{ Creator: creator, @@ -51,6 +52,7 @@ func NewMsgCreateModel( SupportUrl: supportURL, ProductUrl: productURL, LsfUrl: lsfURL, + SchemaVersion: schemaVersion, } } @@ -108,6 +110,7 @@ func NewMsgUpdateModel( productURL string, lsfURL string, lsfRevision int32, + schemaVersion uint32, ) *MsgUpdateModel { return &MsgUpdateModel{ Creator: creator, @@ -124,6 +127,7 @@ func NewMsgUpdateModel( ProductUrl: productURL, LsfUrl: lsfURL, LsfRevision: lsfRevision, + SchemaVersion: schemaVersion, } } diff --git a/x/model/types/messages_model_version.go b/x/model/types/messages_model_version.go index cbc455e24..871adeb7b 100644 --- a/x/model/types/messages_model_version.go +++ b/x/model/types/messages_model_version.go @@ -30,6 +30,7 @@ func NewMsgCreateModelVersion( minApplicableSoftwareVersion uint32, maxApplicableSoftwareVersion uint32, releaseNotesURL string, + schemaVersion uint32, ) *MsgCreateModelVersion { return &MsgCreateModelVersion{ Creator: creator, @@ -47,6 +48,7 @@ func NewMsgCreateModelVersion( MinApplicableSoftwareVersion: minApplicableSoftwareVersion, MaxApplicableSoftwareVersion: maxApplicableSoftwareVersion, ReleaseNotesUrl: releaseNotesURL, + SchemaVersion: schemaVersion, } } @@ -101,6 +103,7 @@ func NewMsgUpdateModelVersion( minApplicableSoftwareVersion uint32, maxApplicableSoftwareVersion uint32, releaseNotesURL string, + schemaVersion uint32, ) *MsgUpdateModelVersion { return &MsgUpdateModelVersion{ Creator: creator, @@ -114,6 +117,7 @@ func NewMsgUpdateModelVersion( MinApplicableSoftwareVersion: minApplicableSoftwareVersion, MaxApplicableSoftwareVersion: maxApplicableSoftwareVersion, ReleaseNotesUrl: releaseNotesURL, + SchemaVersion: schemaVersion, } } diff --git a/x/model/types/model.pb.go b/x/model/types/model.pb.go index fbe2e4f6c..de6c989b6 100644 --- a/x/model/types/model.pb.go +++ b/x/model/types/model.pb.go @@ -42,6 +42,7 @@ type Model struct { LsfUrl string `protobuf:"bytes,16,opt,name=lsfUrl,proto3" json:"lsfUrl,omitempty"` LsfRevision int32 `protobuf:"varint,17,opt,name=lsfRevision,proto3" json:"lsfRevision,omitempty"` Creator string `protobuf:"bytes,18,opt,name=creator,proto3" json:"creator,omitempty"` + SchemaVersion uint32 `protobuf:"varint,19,opt,name=schemaVersion,proto3" json:"schemaVersion,omitempty"` } func (m *Model) Reset() { *m = Model{} } @@ -203,6 +204,13 @@ func (m *Model) GetCreator() string { return "" } +func (m *Model) GetSchemaVersion() uint32 { + if m != nil { + return m.SchemaVersion + } + return 0 +} + func init() { proto.RegisterType((*Model)(nil), "zigbeealliance.distributedcomplianceledger.model.Model") } @@ -210,39 +218,40 @@ func init() { func init() { proto.RegisterFile("model/model.proto", fileDescriptor_312ac5bcab6cbb43) } var fileDescriptor_312ac5bcab6cbb43 = []byte{ - // 514 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x4f, 0x6f, 0xd3, 0x30, - 0x1c, 0x5d, 0x18, 0xed, 0x98, 0xb7, 0xc2, 0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, 0x2b, 0x72, 0xf3, 0x53, 0x48, 0xae, 0x74, 0x27, 0x03, 0x18, - 0x8b, 0x60, 0x96, 0x6c, 0xc7, 0x1c, 0xd5, 0x21, 0xfc, 0x04, 0xad, 0x31, 0x0b, 0xd4, 0x6b, 0x4b, - 0x70, 0x18, 0xdd, 0x23, 0x3f, 0xbe, 0x75, 0x6f, 0xcf, 0x0b, 0xf5, 0x82, 0x73, 0x0b, 0xce, 0x0d, - 0xbd, 0x15, 0x6a, 0x34, 0x38, 0x13, 0xee, 0x7d, 0xf8, 0x3e, 0x4d, 0x93, 0xd3, 0x69, 0x9a, 0xfc, - 0x9e, 0xa6, 0xc9, 0xd7, 0x59, 0xba, 0x72, 0x3a, 0x4b, 0x57, 0x7e, 0xce, 0xd2, 0x95, 0xe3, 0xfd, - 0x91, 0xf0, 0x1f, 0xcb, 0xbc, 0xc7, 0x74, 0x91, 0x55, 0x9d, 0xee, 0x9e, 0x95, 0x3a, 0xab, 0x95, - 0xba, 0xbb, 0x68, 0x75, 0xb7, 0xaa, 0x75, 0xf6, 0xb9, 0xfa, 0x21, 0x64, 0x7e, 0x62, 0xc0, 0xe5, - 0xcd, 0x58, 0xe5, 0xa7, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xe2, 0xf9, 0xa4, 0x96, 0x2c, 0x04, + // 530 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xcd, 0x6e, 0x13, 0x31, + 0x18, 0xcc, 0x52, 0x92, 0x50, 0xb7, 0x81, 0xd6, 0x20, 0x30, 0x3d, 0xac, 0x42, 0xe1, 0x10, 0x21, + 0x25, 0x8b, 0xe0, 0xc2, 0x09, 0x89, 0x22, 0x55, 0x44, 0x6a, 0x2b, 0x94, 0x00, 0x87, 0x1e, 0x00, + 0xaf, 0xfd, 0x35, 0xb5, 0xe4, 0x5d, 0x5b, 0xb6, 0x37, 0x10, 0xee, 0xdc, 0x79, 0x18, 0x1e, 0x82, + 0x63, 0xc5, 0x89, 0x23, 0x4a, 0x5e, 0x04, 0xd9, 0x9b, 0x92, 0xac, 0x50, 0xff, 0x2e, 0x51, 0x3c, + 0x33, 0xdf, 0x97, 0x89, 0x77, 0x66, 0xd1, 0x66, 0xa6, 0x38, 0xc8, 0x24, 0x7c, 0xf6, 0xb4, 0x51, + 0x4e, 0xe1, 0x27, 0x5f, 0xc5, 0x28, 0x05, 0xa0, 0x52, 0x0a, 0x9a, 0x33, 0xe8, 0x71, 0x61, 0x9d, + 0x11, 0x69, 0xe1, 0x80, 0x33, 0x95, 0xe9, 0x12, 0x95, 0xc0, 0x47, 0x60, 0x7a, 0x61, 0x6e, 0xeb, + 0x3e, 0x53, 0x36, 0x53, 0xf6, 0x63, 0x98, 0x4f, 0xca, 0x43, 0xb9, 0x6c, 0xfb, 0x5b, 0x13, 0xd5, + 0xf7, 0xbd, 0x08, 0x6f, 0xa0, 0x95, 0xb1, 0xe0, 0x24, 0x6a, 0x47, 0x9d, 0xfa, 0xc0, 0x7f, 0xf5, + 0x88, 0x16, 0x9c, 0x5c, 0x2b, 0x11, 0x2d, 0x38, 0xde, 0x46, 0xeb, 0x1c, 0xc6, 0x82, 0xc1, 0xdb, + 0x89, 0x86, 0x3e, 0x27, 0x2b, 0x81, 0xaa, 0x60, 0xb8, 0x8d, 0xd6, 0xb4, 0x51, 0xbc, 0x60, 0xee, + 0x80, 0x66, 0x40, 0xae, 0xb7, 0xa3, 0xce, 0xea, 0x60, 0x19, 0xf2, 0x5b, 0xe6, 0xc7, 0x3d, 0x9a, + 0x82, 0x24, 0xf5, 0x20, 0xa9, 0x60, 0x38, 0x46, 0x48, 0x53, 0xe3, 0x0e, 0x8a, 0x2c, 0x05, 0x43, + 0x1a, 0x41, 0xb1, 0x84, 0xe0, 0xe7, 0xe8, 0x1e, 0x53, 0x59, 0x26, 0xac, 0x15, 0x2a, 0x17, 0xf9, + 0xe8, 0x55, 0x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xe6, 0x85, 0x7a, 0xc9, 0xb9, 0x01, 0x6b, + 0x87, 0xce, 0x88, 0x7c, 0x34, 0x38, 0x15, 0xfa, 0xff, 0x64, 0xd9, 0x31, 0x64, 0xf4, 0x3d, 0x98, + 0xb0, 0xf7, 0x76, 0xb8, 0xef, 0x2a, 0xb8, 0xf3, 0xe9, 0xe7, 0x34, 0x8e, 0x4e, 0xa6, 0x71, 0xf4, + 0x67, 0x1a, 0x47, 0xdf, 0x67, 0x71, 0xed, 0x64, 0x16, 0xd7, 0x7e, 0xcf, 0xe2, 0xda, 0xe1, 0xee, + 0x48, 0xb8, 0xe3, 0x22, 0xed, 0x31, 0x95, 0x25, 0x65, 0xf3, 0xbb, 0xa7, 0xd5, 0x4f, 0x96, 0xaa, + 0xdf, 0x5d, 0x74, 0xbf, 0x5b, 0x96, 0x3f, 0xf9, 0x52, 0xbe, 0x36, 0x12, 0x37, 0xd1, 0x60, 0xd3, + 0x46, 0x28, 0xfc, 0xb3, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x85, 0x84, 0x11, 0xc4, 0x52, 0x04, 0x00, 0x00, } @@ -266,6 +275,13 @@ func (m *Model) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.SchemaVersion != 0 { + i = encodeVarintModel(dAtA, i, uint64(m.SchemaVersion)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x98 + } if len(m.Creator) > 0 { i -= len(m.Creator) copy(dAtA[i:], m.Creator) @@ -469,6 +485,9 @@ func (m *Model) Size() (n int) { if l > 0 { n += 2 + l + sovModel(uint64(l)) } + if m.SchemaVersion != 0 { + n += 2 + sovModel(uint64(m.SchemaVersion)) + } return n } @@ -992,6 +1011,25 @@ func (m *Model) Unmarshal(dAtA []byte) error { } m.Creator = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 19: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SchemaVersion", wireType) + } + m.SchemaVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModel + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SchemaVersion |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipModel(dAtA[iNdEx:]) diff --git a/x/model/types/model_version.pb.go b/x/model/types/model_version.pb.go index 6bc923434..8b5f3d70f 100644 --- a/x/model/types/model_version.pb.go +++ b/x/model/types/model_version.pb.go @@ -39,6 +39,7 @@ type ModelVersion struct { MaxApplicableSoftwareVersion uint32 `protobuf:"varint,13,opt,name=maxApplicableSoftwareVersion,proto3" json:"maxApplicableSoftwareVersion,omitempty"` ReleaseNotesUrl string `protobuf:"bytes,14,opt,name=releaseNotesUrl,proto3" json:"releaseNotesUrl,omitempty"` Creator string `protobuf:"bytes,15,opt,name=creator,proto3" json:"creator,omitempty"` + SchemaVersion uint32 `protobuf:"varint,16,opt,name=schemaVersion,proto3" json:"schemaVersion,omitempty"` } func (m *ModelVersion) Reset() { *m = ModelVersion{} } @@ -179,6 +180,13 @@ func (m *ModelVersion) GetCreator() string { return "" } +func (m *ModelVersion) GetSchemaVersion() uint32 { + if m != nil { + return m.SchemaVersion + } + return 0 +} + func init() { proto.RegisterType((*ModelVersion)(nil), "zigbeealliance.distributedcomplianceledger.model.ModelVersion") } @@ -186,36 +194,37 @@ func init() { func init() { proto.RegisterFile("model/model_version.proto", fileDescriptor_a0324d25600a9825) } var fileDescriptor_a0324d25600a9825 = []byte{ - // 463 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x53, 0xc1, 0x6e, 0x13, 0x31, - 0x10, 0xad, 0x69, 0x93, 0xb6, 0x6e, 0x4b, 0x91, 0x29, 0xc8, 0x45, 0x68, 0xb5, 0xe2, 0xb4, 0x97, - 0x64, 0xab, 0xc2, 0x0f, 0x34, 0x48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x64, 0xed, 0x6e, 0x91, 0xac, 0xfd, 0x5e, 0x24, 0x6b, 0x9f, 0x4e, 0xa7, 0xc2, 0x5d, - 0xce, 0xca, 0x61, 0xa5, 0x55, 0x1e, 0x2d, 0x30, 0xb8, 0xf7, 0x40, 0xbe, 0xe4, 0x81, 0xc1, 0x3f, - 0x13, 0x0c, 0xa2, 0x0b, 0xf2, 0xeb, 0xe8, 0xa3, 0xdc, 0xdd, 0x34, 0x60, 0xcb, 0x7e, 0x78, 0xf9, - 0xaf, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xf0, 0x4d, 0x3f, 0xcf, 0x63, 0x03, 0x00, 0x00, + // 478 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x93, 0xc1, 0x6e, 0xd3, 0x30, + 0x18, 0xc7, 0x1b, 0xb6, 0x76, 0x9b, 0xb7, 0xb2, 0xc9, 0x0c, 0xe4, 0x21, 0x14, 0x45, 0x88, 0x43, + 0x2e, 0x6d, 0xa6, 0xc1, 0x0b, 0xac, 0x48, 0x93, 0x38, 0xb0, 0x43, 0x0a, 0x3b, 0x70, 0x19, 0x4e, + 0xfc, 0xb5, 0xb5, 0xb0, 0xeb, 0xc8, 0x76, 0xc7, 0xb6, 0xa7, 0xe0, 0x61, 0xf6, 0x10, 0x1c, 0x27, + 0x4e, 0x1c, 0x51, 0xfb, 0x22, 0xc8, 0x76, 0x2a, 0x4a, 0xd4, 0xed, 0x12, 0xc5, 0x3f, 0xff, 0xbf, + 0xbf, 0x3f, 0xe7, 0xcb, 0x1f, 0x1d, 0x49, 0xc5, 0x40, 0x64, 0xfe, 0x79, 0x79, 0x05, 0xda, 0x70, + 0x35, 0xed, 0x57, 0x5a, 0x59, 0x85, 0x8f, 0x6f, 0xf9, 0xb8, 0x00, 0xa0, 0x42, 0x70, 0x3a, 0x2d, + 0xa1, 0xcf, 0xb8, 0xb1, 0x9a,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elVersion) Marshal() (dAtA []byte, err error) { @@ -238,6 +247,13 @@ func (m *ModelVersion) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.SchemaVersion != 0 { + i = encodeVarintModelVersion(dAtA, i, uint64(m.SchemaVersion)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x80 + } if len(m.Creator) > 0 { i -= len(m.Creator) copy(dAtA[i:], m.Creator) @@ -401,6 +417,9 @@ func (m *ModelVersion) Size() (n int) { if l > 0 { n += 1 + l + sovModelVersion(uint64(l)) } + if m.SchemaVersion != 0 { + n += 2 + sovModelVersion(uint64(m.SchemaVersion)) + } return n } @@ -803,6 +822,25 @@ func (m *ModelVersion) Unmarshal(dAtA []byte) error { } m.Creator = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SchemaVersion", wireType) + } + m.SchemaVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModelVersion + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SchemaVersion |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipModelVersion(dAtA[iNdEx:]) diff --git a/x/model/types/product.pb.go b/x/model/types/product.pb.go index 207556873..9b20f41b9 100644 --- a/x/model/types/product.pb.go +++ b/x/model/types/product.pb.go @@ -23,9 +23,10 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type Product struct { - Pid int32 `protobuf:"varint,1,opt,name=pid,proto3" json:"pid,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - PartNumber string `protobuf:"bytes,3,opt,name=partNumber,proto3" json:"partNumber,omitempty"` + Pid int32 `protobuf:"varint,1,opt,name=pid,proto3" json:"pid,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + PartNumber string `protobuf:"bytes,3,opt,name=partNumber,proto3" json:"partNumber,omitempty"` + SchemaVersion uint32 `protobuf:"varint,4,opt,name=schemaVersion,proto3" json:"schemaVersion,omitempty"` } func (m *Product) Reset() { *m = Product{} } @@ -82,6 +83,13 @@ func (m *Product) GetPartNumber() string { return "" } +func (m *Product) GetSchemaVersion() uint32 { + if m != nil { + return m.SchemaVersion + } + return 0 +} + func init() { proto.RegisterType((*Product)(nil), "zigbeealliance.distributedcomplianceledger.model.Product") } @@ -89,21 +97,23 @@ func init() { func init() { proto.RegisterFile("model/product.proto", fileDescriptor_84a2bcf6440d083f) } var fileDescriptor_84a2bcf6440d083f = []byte{ - // 219 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0xcf, 0xbd, 0x4a, 0xc5, 0x30, - 0x1c, 0x05, 0xf0, 0xc6, 0xeb, 0x07, 0x66, 0x92, 0xb8, 0x74, 0x0a, 0x17, 0xa7, 0xbb, 0x34, 0x11, - 0x7c, 0x03, 0x07, 0x47, 0x95, 0x8e, 0x4e, 0xe6, 0xe3, 0x4f, 0x0d, 0x24, 0x4d, 0x48, 0x13, 0x50, - 0x9f, 0xc2, 0xc7, 0x72, 0xec, 0xe8, 0x28, 0xed, 0x8b, 0x88, 0x09, 0x62, 0xb7, 0xc3, 0x09, 0xf9, - 0xf3, 0x3b, 0xf8, 0xd2, 0x79, 0x0d, 0x96, 0x87, 0xe8, 0x75, 0x56, 0x89, 0x85, 0xe8, 0x93, 0x27, - 0xd7, 0xef, 0x66, 0x90, 0x00, 0xc2, 0x5a, 0x23, 0x46, 0x05, 0x4c, 0x9b, 0x29, 0x45, 0x23, 0x73, - 0x02, 0xad, 0xbc, 0x0b, 0xb5, 0xb5, 0xa0, 0x07, 0x88, 0xac, 0xfc, 0xbf, 0x7a, 0xc0, 0x67, 0x8f, - 0xf5, 0x04, 0xb9, 0xc0, 0xbb, 0x60, 0x74, 0x8b, 0xf6, 0xe8, 0x70, 0xd2, 0xff, 0x46, 0x42, 0xf0, - 0xf1, 0x28, 0x1c, 0xb4, 0x47, 0x7b, 0x74, 0x38, 0xef, 0x4b, 0x26, 0x14, 0xe3, 0x20, 0x62, 0xba, - 0xcf, 0x4e, 0x42, 0x6c, 0x77, 0xe5, 0x65, 0xd3, 0xdc, 0x3e, 0x7f, 0x2e, 0x14, 0xcd, 0x0b, 0x45, - 0xdf, 0x0b, 0x45, 0x1f, 0x2b, 0x6d, 0xe6, 0x95, 0x36, 0x5f, 0x2b, 0x6d, 0x9e, 0xee, 0x06, 0x93, - 0x5e, 0xb2, 0x64, 0xca, 0x3b, 0x5e, 0x9d, 0xdd, 0x1f, 0x94, 0x6f, 0xa0, 0xdd, 0xbf, 0xb4, 0xab, - 0x54, 0xfe, 0xca, 0xeb, 0xd8, 0xf4, 0x16, 0x60, 0x92, 0xa7, 0x65, 0xeb, 0xcd, 0x4f, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x2c, 0x1b, 0x69, 0x2b, 0x02, 0x01, 0x00, 0x00, + // 241 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0xbf, 0x4a, 0xc5, 0x30, + 0x14, 0xc6, 0x1b, 0xef, 0x55, 0x31, 0x70, 0x41, 0xe2, 0xd2, 0x29, 0x14, 0x71, 0xe8, 0xd2, 0x46, + 0xf0, 0x0d, 0x1c, 0x1c, 0x45, 0x3a, 0x38, 0x38, 0x99, 0x3f, 0x87, 0xde, 0x40, 0xd3, 0x84, 0x34, + 0x01, 0xf5, 0x29, 0x7c, 0x2c, 0xc7, 0x3b, 0x3a, 0x4a, 0xfb, 0x22, 0x62, 0x82, 0x58, 0xb7, 0x8f, + 0xdf, 0xe1, 0x7c, 0xf0, 0xfb, 0xf0, 0x85, 0xb1, 0x0a, 0x06, 0xe6, 0xbc, 0x55, 0x51, 0x86, 0xd6, + 0x79, 0x1b, 0x2c, 0xb9, 0x7e, 0xd3, 0xbd, 0x00, 0xe0, 0xc3, 0xa0, 0xf9, 0x28, 0xa1, 0x55, 0x7a, + 0x0a, 0x5e, 0x8b, 0x18, 0x40, 0x49, 0x6b, 0x5c, 0xa6, 0x03, 0xa8, 0x1e, 0x7c, 0x9b, 0xfe, 0x2f, + 0x23, 0x3e, 0x7d, 0xc8, 0x15, 0xe4, 0x1c, 0x6f, 0x9c, 0x56, 0x25, 0xaa, 0x50, 0x7d, 0xdc, 0xfd, + 0x44, 0x42, 0xf0, 0x76, 0xe4, 0x06, 0xca, 0xa3, 0x0a, 0xd5, 0x67, 0x5d, 0xca, 0x84, 0x62, 0xec, + 0xb8, 0x0f, 0xf7, 0xd1, 0x08, 0xf0, 0xe5, 0x26, 0x5d, 0x56, 0x84, 0x5c, 0xe1, 0xdd, 0x24, 0xf7, + 0x60, 0xf8, 0x23, 0xf8, 0x49, 0xdb, 0xb1, 0xdc, 0x56, 0xa8, 0xde, 0x75, 0xff, 0xe1, 0xed, 0xf3, + 0xc7, 0x4c, 0xd1, 0x61, 0xa6, 0xe8, 0x6b, 0xa6, 0xe8, 0x7d, 0xa1, 0xc5, 0x61, 0xa1, 0xc5, 0xe7, + 0x42, 0x8b, 0xa7, 0xbb, 0x5e, 0x87, 0x7d, 0x14, 0xad, 0xb4, 0x86, 0x65, 0x9b, 0xe6, 0x57, 0x87, + 0xad, 0x74, 0x9a, 0x3f, 0x9f, 0x26, 0x0b, 0xb1, 0x17, 0x96, 0x27, 0x09, 0xaf, 0x0e, 0x26, 0x71, + 0x92, 0x16, 0xb9, 0xf9, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x55, 0xdc, 0xff, 0x72, 0x28, 0x01, 0x00, + 0x00, } func (m *Product) Marshal() (dAtA []byte, err error) { @@ -126,6 +136,11 @@ func (m *Product) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.SchemaVersion != 0 { + i = encodeVarintProduct(dAtA, i, uint64(m.SchemaVersion)) + i-- + dAtA[i] = 0x20 + } if len(m.PartNumber) > 0 { i -= len(m.PartNumber) copy(dAtA[i:], m.PartNumber) @@ -176,6 +191,9 @@ func (m *Product) Size() (n int) { if l > 0 { n += 1 + l + sovProduct(uint64(l)) } + if m.SchemaVersion != 0 { + n += 1 + sovProduct(uint64(m.SchemaVersion)) + } return n } @@ -297,6 +315,25 @@ func (m *Product) Unmarshal(dAtA []byte) error { } m.PartNumber = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SchemaVersion", wireType) + } + m.SchemaVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProduct + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SchemaVersion |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipProduct(dAtA[iNdEx:]) diff --git a/x/model/types/tx.pb.go b/x/model/types/tx.pb.go index cbbdb094d..370c98f0b 100644 --- a/x/model/types/tx.pb.go +++ b/x/model/types/tx.pb.go @@ -47,6 +47,7 @@ type MsgCreateModel struct { SupportUrl string `protobuf:"bytes,15,opt,name=supportUrl,proto3" json:"supportUrl,omitempty" validate:"omitempty,url,startsnotwith=http:,max=256"` ProductUrl string `protobuf:"bytes,16,opt,name=productUrl,proto3" json:"productUrl,omitempty" validate:"omitempty,url,startsnotwith=http:,max=256"` LsfUrl string `protobuf:"bytes,17,opt,name=lsfUrl,proto3" json:"lsfUrl,omitempty" validate:"omitempty,url,startsnotwith=http:,max=256"` + SchemaVersion uint32 `protobuf:"varint,18,opt,name=schemaVersion,proto3" json:"schemaVersion,omitempty"` } func (m *MsgCreateModel) Reset() { *m = MsgCreateModel{} } @@ -201,6 +202,13 @@ func (m *MsgCreateModel) GetLsfUrl() string { return "" } +func (m *MsgCreateModel) GetSchemaVersion() uint32 { + if m != nil { + return m.SchemaVersion + } + return 0 +} + type MsgCreateModelResponse struct { } @@ -252,6 +260,7 @@ type MsgUpdateModel struct { ProductUrl string `protobuf:"bytes,12,opt,name=productUrl,proto3" json:"productUrl,omitempty" validate:"omitempty,url,startsnotwith=http:,max=256"` LsfUrl string `protobuf:"bytes,13,opt,name=lsfUrl,proto3" json:"lsfUrl,omitempty" validate:"omitempty,url,startsnotwith=http:,max=256"` LsfRevision int32 `protobuf:"varint,14,opt,name=lsfRevision,proto3" json:"lsfRevision,omitempty" validate:"gte=0,lte=65535"` + SchemaVersion uint32 `protobuf:"varint,15,opt,name=schemaVersion,proto3" json:"schemaVersion,omitempty"` } func (m *MsgUpdateModel) Reset() { *m = MsgUpdateModel{} } @@ -385,6 +394,13 @@ func (m *MsgUpdateModel) GetLsfRevision() int32 { return 0 } +func (m *MsgUpdateModel) GetSchemaVersion() uint32 { + if m != nil { + return m.SchemaVersion + } + return 0 +} + type MsgUpdateModelResponse struct { } @@ -533,6 +549,7 @@ type MsgCreateModelVersion struct { MinApplicableSoftwareVersion uint32 `protobuf:"varint,13,opt,name=minApplicableSoftwareVersion,proto3" json:"minApplicableSoftwareVersion,omitempty"` MaxApplicableSoftwareVersion uint32 `protobuf:"varint,14,opt,name=maxApplicableSoftwareVersion,proto3" json:"maxApplicableSoftwareVersion,omitempty" validate:"gtecsfield=MinApplicableSoftwareVersion"` ReleaseNotesUrl string `protobuf:"bytes,15,opt,name=releaseNotesUrl,proto3" json:"releaseNotesUrl,omitempty" validate:"omitempty,url,startsnotwith=http:,max=256"` + SchemaVersion uint32 `protobuf:"varint,16,opt,name=schemaVersion,proto3" json:"schemaVersion,omitempty"` } func (m *MsgCreateModelVersion) Reset() { *m = MsgCreateModelVersion{} } @@ -673,6 +690,13 @@ func (m *MsgCreateModelVersion) GetReleaseNotesUrl() string { return "" } +func (m *MsgCreateModelVersion) GetSchemaVersion() uint32 { + if m != nil { + return m.SchemaVersion + } + return 0 +} + type MsgCreateModelVersionResponse struct { } @@ -721,6 +745,7 @@ type MsgUpdateModelVersion struct { ReleaseNotesUrl string `protobuf:"bytes,9,opt,name=releaseNotesUrl,proto3" json:"releaseNotesUrl,omitempty" validate:"omitempty,url,startsnotwith=http:,max=256"` OtaFileSize uint64 `protobuf:"varint,10,opt,name=otaFileSize,proto3" json:"otaFileSize,omitempty"` OtaChecksum string `protobuf:"bytes,11,opt,name=otaChecksum,proto3" json:"otaChecksum,omitempty" validate:"max=64"` + SchemaVersion uint32 `protobuf:"varint,12,opt,name=schemaVersion,proto3" json:"schemaVersion,omitempty"` } func (m *MsgUpdateModelVersion) Reset() { *m = MsgUpdateModelVersion{} } @@ -833,6 +858,13 @@ func (m *MsgUpdateModelVersion) GetOtaChecksum() string { return "" } +func (m *MsgUpdateModelVersion) GetSchemaVersion() uint32 { + if m != nil { + return m.SchemaVersion + } + return 0 +} + type MsgUpdateModelVersionResponse struct { } @@ -991,90 +1023,91 @@ func init() { func init() { proto.RegisterFile("model/tx.proto", fileDescriptor_8898c625fa4755dc) } var fileDescriptor_8898c625fa4755dc = []byte{ - // 1315 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x99, 0xbd, 0x6f, 0xdb, 0x46, - 0x18, 0xc6, 0xc3, 0x26, 0xfe, 0x3a, 0x59, 0x71, 0x73, 0xf9, 0x62, 0xd5, 0x54, 0x74, 0x19, 0xa0, - 0x30, 0x02, 0x59, 0x72, 0xe4, 0xc8, 0x0d, 0x82, 0x0a, 0x48, 0xe4, 0x36, 0xb1, 0x81, 0x38, 0x09, - 0xe8, 0x24, 0x28, 0x02, 0x34, 0x29, 0x45, 0x9e, 0xe4, 0x43, 0x49, 0x1e, 0x7b, 0x77, 0xf4, 0x47, - 0xa6, 0x0e, 0xfd, 0x03, 0xba, 0x76, 0xe9, 0xd4, 0xb9, 0x53, 0xf7, 0xae, 0x1d, 0x83, 0x4e, 0x9d, - 0x88, 0x22, 0x59, 0x3b, 0x14, 0x9c, 0x3a, 0x74, 0x28, 0x78, 0xa2, 0x25, 0x52, 0xa2, 0x3e, 0x6c, - 0xc9, 0x43, 0xb2, 0x18, 0x26, 0x79, 0xcf, 0x73, 0xef, 0x7b, 0xf7, 0xbe, 0x3f, 0x9e, 0x24, 0x70, - 0xd6, 0x26, 0x26, 0xb2, 0x4a, 0x7c, 0xbf, 0xe8, 0x52, 0xc2, 0x09, 0x5c, 0x79, 0x89, 0x9b, 0x75, - 0x84, 0x74, 0xcb, 0xc2, 0xba, 0x63, 0xa0, 0xa2, 0x89, 0x19, 0xa7, 0xb8, 0xee, 0x71, 0x64, 0x1a, - 0xc4, 0x76, 0x5b, 0x77, 0x2d, 0x64, 0x36, 0x11, 0x2d, 0x0a, 0x69, 0xee, 0x5c, 0xcb, 0x41, 0xfc, - 0x6d, 0x99, 0xe4, 0x3e, 0x88, 0xdd, 0x7a, 0xb1, 0x8b, 0x28, 0xc3, 0xc4, 0x89, 0x1e, 0x5d, 0x68, - 0x92, 0x26, 0x11, 0xff, 0x96, 0xc2, 0xff, 0x0e, 0x05, 0x06, 0x61, 0x36, 0x61, 0x2f, 0x5a, 0x0f, - 0x5a, 0x17, 0xad, 0x47, 0xea, 0xcf, 0x19, 0x70, 0x76, 0x8b, 0x35, 0xd7, 0x29, 0xd2, 0x39, 0xda, - 0x0a, 0x1d, 0xe1, 0x26, 0x98, 0x31, 0xc2, 0x4b, 0x42, 0x65, 0x69, 0x51, 0x5a, 0x9a, 0xab, 0x95, - 0x02, 0x5f, 0x39, 0xbf, 0xab, 0x5b, 0xd8, 0xd4, 0x39, 0xba, 0xa5, 0x52, 0xf4, 0xad, 0x87, 0x29, - 0x32, 0xd5, 0x3f, 0x7e, 0x5d, 0xbe, 0x10, 0x99, 0xdd, 0x31, 0x4d, 0x8a, 0x18, 0xdb, 0xe6, 0x14, - 0x3b, 0x4d, 0xed, 0x50, 0x0f, 0x57, 0xc0, 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 0xbb, 0x22, 0xb6, 0xf8, 0x61, 0xf7, 0x78, 0xb1, 0xc5, 0x1c, - 0x8e, 0x19, 0x5b, 0xca, 0x79, 0x15, 0xfe, 0x22, 0x01, 0x98, 0x72, 0x58, 0xbd, 0x37, 0xee, 0xc6, - 0x44, 0x46, 0xb9, 0x87, 0x13, 0x32, 0x4a, 0x04, 0x9c, 0xf2, 0x06, 0xbb, 0x37, 0xee, 0x6e, 0x8d, - 0x17, 0x70, 0x7f, 0xa2, 0x88, 0x80, 0x53, 0x70, 0x72, 0x6f, 0xdc, 0x2d, 0x1c, 0x2f, 0xe0, 0xfe, - 0xed, 0x5e, 0xfb, 0xfa, 0xf7, 0xd7, 0x79, 0xe9, 0xd5, 0xeb, 0xbc, 0xf4, 0xd7, 0xeb, 0xbc, 0xf4, - 0xc3, 0x9b, 0xfc, 0xa9, 0x57, 0x6f, 0xf2, 0xa7, 0xfe, 0x7c, 0x93, 0x3f, 0xf5, 0xec, 0x6e, 0x13, - 0xf3, 0x1d, 0xaf, 0x5e, 0x34, 0x88, 0x5d, 0x6a, 0x4d, 0xba, 0x7c, 0x38, 0x6b, 0x29, 0x36, 0xeb, - 0x72, 0x67, 0xda, 0xe5, 0xd6, 0xbc, 0xa5, 0xfd, 0x52, 0xf4, 0x73, 0xc7, 0x81, 0x8b, 0x58, 0x7d, - 0x5a, 0xfc, 0xc2, 0xb0, 0xfa, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x67, 0x32, 0x63, 0xed, 0x04, - 0x19, 0x00, 0x00, + // 1339 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x99, 0x4d, 0x6f, 0xdb, 0x36, + 0x18, 0xc7, 0xab, 0x35, 0xaf, 0x74, 0x9c, 0xb4, 0xec, 0x9b, 0xe6, 0x75, 0x56, 0xa6, 0x0e, 0x43, + 0x50, 0x24, 0x71, 0xea, 0x34, 0x59, 0x51, 0xcc, 0x40, 0xeb, 0x6c, 0x6d, 0x02, 0x34, 0x6d, 0xa1, + 0xb4, 0xc5, 0x50, 0x60, 0xed, 0x64, 0x89, 0x76, 0x88, 0x49, 0xa2, 0x46, 0x52, 0x79, 0xe9, 0x79, + 0x1f, 0x60, 0xd7, 0x5d, 0x7a, 0xd8, 0x61, 0xc7, 0x9d, 0x76, 0xdf, 0x75, 0xd8, 0xa9, 0xd8, 0x69, + 0x27, 0x61, 0x68, 0xaf, 0x3b, 0x0c, 0xfa, 0x04, 0x83, 0x68, 0xd9, 0x96, 0x6c, 0xf9, 0x25, 0xb1, + 0x73, 0x48, 0x2f, 0x86, 0x45, 0xf2, 0xff, 0xe7, 0x43, 0xf2, 0x79, 0x7e, 0xa6, 0x6d, 0x30, 0x6b, + 0x13, 0x13, 0x59, 0x05, 0x7e, 0xb0, 0xec, 0x52, 0xc2, 0x09, 0x5c, 0x79, 0x85, 0x6b, 0x15, 0x84, + 0x74, 0xcb, 0xc2, 0xba, 0x63, 0xa0, 0x65, 0x13, 0x33, 0x4e, 0x71, 0xc5, 0xe3, 0xc8, 0x34, 0x88, + 0xed, 0xd6, 0x5b, 0x2d, 0x64, 0xd6, 0x10, 0x5d, 0x16, 0xd2, 0xdc, 0xf9, 0xba, 0x83, 0x78, 0xad, + 0x9b, 0xe4, 0x3e, 0x8c, 0x35, 0xbd, 0xdc, 0x43, 0x94, 0x61, 0xe2, 0x44, 0x5d, 0x17, 0x6b, 0xa4, + 0x46, 0xc4, 0xdb, 0x42, 0xf8, 0xae, 0x21, 0x30, 0x08, 0xb3, 0x09, 0x7b, 0x59, 0xef, 0xa8, 0x3f, + 0xd4, 0xbb, 0xd4, 0x3f, 0x33, 0x60, 0x76, 0x9b, 0xd5, 0x36, 0x28, 0xd2, 0x39, 0xda, 0x0e, 0x1d, + 0xe1, 0x16, 0x98, 0x34, 0xc2, 0x47, 0x42, 0x65, 0x69, 0x5e, 0x5a, 0x98, 0x2e, 0x17, 0x02,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0x0e, + 0x0a, 0xd1, 0xdf, 0x30, 0x87, 0x2e, 0x62, 0x95, 0x09, 0xf1, 0xcf, 0xc7, 0xea, 0xff, 0x01, 0x00, + 0x00, 0xff, 0xff, 0xdd, 0x6a, 0xcd, 0x41, 0x9c, 0x19, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1357,6 +1390,13 @@ func (m *MsgCreateModel) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.SchemaVersion != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.SchemaVersion)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x90 + } if len(m.LsfUrl) > 0 { i -= len(m.LsfUrl) copy(dAtA[i:], m.LsfUrl) @@ -1514,6 +1554,11 @@ func (m *MsgUpdateModel) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.SchemaVersion != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.SchemaVersion)) + i-- + dAtA[i] = 0x78 + } if m.LsfRevision != 0 { i = encodeVarintTx(dAtA, i, uint64(m.LsfRevision)) i-- @@ -1715,6 +1760,13 @@ func (m *MsgCreateModelVersion) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.SchemaVersion != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.SchemaVersion)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x80 + } if len(m.ReleaseNotesUrl) > 0 { i -= len(m.ReleaseNotesUrl) copy(dAtA[i:], m.ReleaseNotesUrl) @@ -1853,6 +1905,11 @@ func (m *MsgUpdateModelVersion) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.SchemaVersion != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.SchemaVersion)) + i-- + dAtA[i] = 0x60 + } if len(m.OtaChecksum) > 0 { i -= len(m.OtaChecksum) copy(dAtA[i:], m.OtaChecksum) @@ -2094,6 +2151,9 @@ func (m *MsgCreateModel) Size() (n int) { if l > 0 { n += 2 + l + sovTx(uint64(l)) } + if m.SchemaVersion != 0 { + n += 2 + sovTx(uint64(m.SchemaVersion)) + } return n } @@ -2165,6 +2225,9 @@ func (m *MsgUpdateModel) Size() (n int) { if m.LsfRevision != 0 { n += 1 + sovTx(uint64(m.LsfRevision)) } + if m.SchemaVersion != 0 { + n += 1 + sovTx(uint64(m.SchemaVersion)) + } return n } @@ -2262,6 +2325,9 @@ func (m *MsgCreateModelVersion) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } + if m.SchemaVersion != 0 { + n += 2 + sovTx(uint64(m.SchemaVersion)) + } return n } @@ -2317,6 +2383,9 @@ func (m *MsgUpdateModelVersion) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } + if m.SchemaVersion != 0 { + n += 1 + sovTx(uint64(m.SchemaVersion)) + } return n } @@ -2861,6 +2930,25 @@ func (m *MsgCreateModel) Unmarshal(dAtA []byte) error { } m.LsfUrl = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 18: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SchemaVersion", wireType) + } + m.SchemaVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SchemaVersion |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -3370,6 +3458,25 @@ func (m *MsgUpdateModel) Unmarshal(dAtA []byte) error { break } } + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SchemaVersion", wireType) + } + m.SchemaVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SchemaVersion |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -4004,6 +4111,25 @@ func (m *MsgCreateModelVersion) Unmarshal(dAtA []byte) error { } m.ReleaseNotesUrl = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SchemaVersion", wireType) + } + m.SchemaVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SchemaVersion |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -4366,6 +4492,25 @@ func (m *MsgUpdateModelVersion) Unmarshal(dAtA []byte) error { } m.OtaChecksum = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SchemaVersion", wireType) + } + m.SchemaVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SchemaVersion |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) diff --git a/x/pki/client/cli/tx_add_noc_x_509_cert.go b/x/pki/client/cli/tx_add_noc_x_509_cert.go index 383413a73..eb82c3277 100644 --- a/x/pki/client/cli/tx_add_noc_x_509_cert.go +++ b/x/pki/client/cli/tx_add_noc_x_509_cert.go @@ -10,12 +10,16 @@ import ( "github.com/spf13/viper" "github.com/zigbee-alliance/distributed-compliance-ledger/utils/cli" + "github.com/zigbee-alliance/distributed-compliance-ledger/x/common" "github.com/zigbee-alliance/distributed-compliance-ledger/x/pki/types" ) var _ = strconv.Itoa(0) func CmdAddNocX509Cert() *cobra.Command { + var ( + schemaVersion uint32 + ) cmd := &cobra.Command{ Use: "add-noc-x509-cert", Short: "Adds NOC non-root certificate", @@ -34,6 +38,7 @@ func CmdAddNocX509Cert() *cobra.Command { msg := types.NewMsgAddNocX509Cert( clientCtx.GetFromAddress().String(), cert, + schemaVersion, ) // validate basic will be called in GenerateOrBroadcastTxCLI err = tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) @@ -47,6 +52,8 @@ func CmdAddNocX509Cert() *cobra.Command { cmd.Flags().StringP(FlagCertificate, FlagCertificateShortcut, "", "PEM encoded certificate (string or path to file containing data)") + cmd.Flags().Uint32Var(&schemaVersion, common.FlagSchemaVersion, 1, "Schema version") + cli.AddTxFlagsToCmd(cmd) _ = cmd.MarkFlagRequired(flags.FlagFrom) diff --git a/x/pki/client/cli/tx_add_noc_x_509_root_cert.go b/x/pki/client/cli/tx_add_noc_x_509_root_cert.go index 8ad412d6a..89122bbab 100644 --- a/x/pki/client/cli/tx_add_noc_x_509_root_cert.go +++ b/x/pki/client/cli/tx_add_noc_x_509_root_cert.go @@ -9,12 +9,16 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" "github.com/zigbee-alliance/distributed-compliance-ledger/utils/cli" + "github.com/zigbee-alliance/distributed-compliance-ledger/x/common" "github.com/zigbee-alliance/distributed-compliance-ledger/x/pki/types" ) var _ = strconv.Itoa(0) func CmdAddNocX509RootCert() *cobra.Command { + var ( + schemaVersion uint32 + ) cmd := &cobra.Command{ Use: "add-noc-x509-root-cert", Short: "Adds NOC root certificate", @@ -33,6 +37,7 @@ func CmdAddNocX509RootCert() *cobra.Command { msg := types.NewMsgAddNocX509RootCert( clientCtx.GetFromAddress().String(), cert, + schemaVersion, ) // validate basic will be called in GenerateOrBroadcastTxCLI err = tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) @@ -46,6 +51,8 @@ func CmdAddNocX509RootCert() *cobra.Command { cmd.Flags().StringP(FlagCertificate, FlagCertificateShortcut, "", "PEM encoded certificate (string or path to file containing data)") + cmd.Flags().Uint32Var(&schemaVersion, common.FlagSchemaVersion, 1, "Schema version") + cli.AddTxFlagsToCmd(cmd) _ = cmd.MarkFlagRequired(flags.FlagFrom) diff --git a/x/pki/client/cli/tx_add_pki_revocation_distribution_point.go b/x/pki/client/cli/tx_add_pki_revocation_distribution_point.go index 8b3cc3198..c29652538 100644 --- a/x/pki/client/cli/tx_add_pki_revocation_distribution_point.go +++ b/x/pki/client/cli/tx_add_pki_revocation_distribution_point.go @@ -9,6 +9,7 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" "github.com/zigbee-alliance/distributed-compliance-ledger/utils/cli" + "github.com/zigbee-alliance/distributed-compliance-ledger/x/common" "github.com/zigbee-alliance/distributed-compliance-ledger/x/pki/types" ) @@ -27,6 +28,7 @@ func CmdAddPkiRevocationDistributionPoint() *cobra.Command { dataDigest string dataDigestType uint32 revocationType uint32 + schemaVersion uint32 ) cmd := &cobra.Command{ @@ -57,6 +59,7 @@ func CmdAddPkiRevocationDistributionPoint() *cobra.Command { dataDigest, dataDigestType, revocationType, + schemaVersion, ) // validate basic will be called in GenerateOrBroadcastTxCLI @@ -82,6 +85,8 @@ func CmdAddPkiRevocationDistributionPoint() *cobra.Command { cmd.Flags().StringVar(&dataDigest, FlagDataDigest, "", "Digest of the entire contents of the associated file downloaded from the DataURL. Must be omitted if RevocationType is 1. Must be provided if and only if the DataFileSize field is present") cmd.Flags().Uint32Var(&dataDigestType, FlagDataDigestType, 0, "The type of digest used in the DataDigest field from the list of [1, 7, 8, 10, 11, 12] (IANA Named Information Hash Algorithm Registry). Must be provided if and only if the DataDigest field is present") //TODO: will give error if omitted cmd.Flags().Uint32Var(&revocationType, FlagRevocationType, 1, "The type of file found at the DataURL for this entry. Supported types: 1 - RFC5280 Certificate Revocation List (CRL)") + cmd.Flags().Uint32Var(&schemaVersion, common.FlagSchemaVersion, 1, "Schema version") + flags.AddTxFlagsToCmd(cmd) _ = cmd.MarkFlagRequired(FlagVid) diff --git a/x/pki/client/cli/tx_add_x_509_cert.go b/x/pki/client/cli/tx_add_x_509_cert.go index 999913130..057830f97 100644 --- a/x/pki/client/cli/tx_add_x_509_cert.go +++ b/x/pki/client/cli/tx_add_x_509_cert.go @@ -9,12 +9,17 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" "github.com/zigbee-alliance/distributed-compliance-ledger/utils/cli" + "github.com/zigbee-alliance/distributed-compliance-ledger/x/common" "github.com/zigbee-alliance/distributed-compliance-ledger/x/pki/types" ) var _ = strconv.Itoa(0) func CmdAddX509Cert() *cobra.Command { + var ( + schemaVersion uint32 + ) + cmd := &cobra.Command{ Use: "add-x509-cert", Short: "Adds an intermediate or leaf certificate signed by a chain " + @@ -34,6 +39,7 @@ func CmdAddX509Cert() *cobra.Command { msg := types.NewMsgAddX509Cert( clientCtx.GetFromAddress().String(), cert, + schemaVersion, ) // validate basic will be called in GenerateOrBroadcastTxCLI err = tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) @@ -47,6 +53,8 @@ func CmdAddX509Cert() *cobra.Command { cmd.Flags().StringP(FlagCertificate, FlagCertificateShortcut, "", "PEM encoded certificate (string or path to file containing data)") + cmd.Flags().Uint32Var(&schemaVersion, common.FlagSchemaVersion, 1, "Schema version") + cli.AddTxFlagsToCmd(cmd) _ = cmd.MarkFlagRequired(flags.FlagFrom) diff --git a/x/pki/client/cli/tx_propose_add_x_509_root_cert.go b/x/pki/client/cli/tx_propose_add_x_509_root_cert.go index ca5f62b45..d22543a37 100644 --- a/x/pki/client/cli/tx_propose_add_x_509_root_cert.go +++ b/x/pki/client/cli/tx_propose_add_x_509_root_cert.go @@ -9,12 +9,17 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" "github.com/zigbee-alliance/distributed-compliance-ledger/utils/cli" + "github.com/zigbee-alliance/distributed-compliance-ledger/x/common" "github.com/zigbee-alliance/distributed-compliance-ledger/x/pki/types" ) var _ = strconv.Itoa(0) func CmdProposeAddX509RootCert() *cobra.Command { + var ( + schemaVersion uint32 + ) + cmd := &cobra.Command{ Use: "propose-add-x509-root-cert", Short: "Proposes a new self-signed root certificate", @@ -38,6 +43,7 @@ func CmdProposeAddX509RootCert() *cobra.Command { cert, info, vid, + schemaVersion, ) // validate basic will be called in GenerateOrBroadcastTxCLI err = tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) @@ -53,6 +59,8 @@ func CmdProposeAddX509RootCert() *cobra.Command { "PEM encoded certificate (string or path to file containing data)") cmd.Flags().String(FlagInfo, "", FlagInfoUsage) cmd.Flags().Int32(FlagVid, 0, "Model vendor ID (positive non-zero uint16)") + cmd.Flags().Uint32Var(&schemaVersion, common.FlagSchemaVersion, 1, "Schema version") + cli.AddTxFlagsToCmd(cmd) _ = cmd.MarkFlagRequired(flags.FlagFrom) diff --git a/x/pki/client/cli/tx_update_pki_revocation_distribution_point.go b/x/pki/client/cli/tx_update_pki_revocation_distribution_point.go index 0c4c70bb4..3ae44e63e 100644 --- a/x/pki/client/cli/tx_update_pki_revocation_distribution_point.go +++ b/x/pki/client/cli/tx_update_pki_revocation_distribution_point.go @@ -9,6 +9,7 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" "github.com/zigbee-alliance/distributed-compliance-ledger/utils/cli" + "github.com/zigbee-alliance/distributed-compliance-ledger/x/common" "github.com/zigbee-alliance/distributed-compliance-ledger/x/pki/types" ) @@ -24,6 +25,7 @@ func CmdUpdatePkiRevocationDistributionPoint() *cobra.Command { dataFileSize uint64 dataDigest string dataDigestType uint32 + schemaVersion uint32 ) cmd := &cobra.Command{ @@ -51,6 +53,7 @@ func CmdUpdatePkiRevocationDistributionPoint() *cobra.Command { dataFileSize, dataDigest, dataDigestType, + schemaVersion, ) // validate basic will be called in GenerateOrBroadcastTxCLI @@ -72,6 +75,8 @@ func CmdUpdatePkiRevocationDistributionPoint() *cobra.Command { cmd.Flags().Uint64Var(&dataFileSize, FlagDataFileSize, 0, "Total size in bytes of the file found at the DataURL. Must be omitted if RevocationType is 1") cmd.Flags().StringVar(&dataDigest, FlagDataDigest, "", "Digest of the entire contents of the associated file downloaded from the DataURL. Must be omitted if RevocationType is 1. Must be provided if and only if the DataFileSize field is present") cmd.Flags().Uint32Var(&dataDigestType, FlagDataDigestType, 0, "The type of digest used in the DataDigest field from the list of [1, 7, 8, 10, 11, 12] (IANA Named Information Hash Algorithm Registry). Must be provided if and only if the DataDigest field is present") //TODO: will give error if omitted + cmd.Flags().Uint32Var(&schemaVersion, common.FlagSchemaVersion, 1, "Schema version") + flags.AddTxFlagsToCmd(cmd) _ = cmd.MarkFlagRequired(FlagVid) diff --git a/x/pki/handler_add_noc_cert_test.go b/x/pki/handler_add_noc_cert_test.go index 9fcd1a763..40e7a412f 100644 --- a/x/pki/handler_add_noc_cert_test.go +++ b/x/pki/handler_add_noc_cert_test.go @@ -16,7 +16,7 @@ import ( func TestHandler_AddNocX509Cert_SenderNotVendor(t *testing.T) { setup := Setup(t) - addNocX509Cert := types.NewMsgAddNocX509Cert(setup.Trustee1.String(), testconstants.NocCert1) + addNocX509Cert := types.NewMsgAddNocX509Cert(setup.Trustee1.String(), testconstants.NocCert1, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addNocX509Cert) require.ErrorIs(t, err, sdkerrors.ErrUnauthorized) @@ -33,7 +33,7 @@ func TestHandler_AddNocX509Cert_AddNew(t *testing.T) { addNocRootCertificate(setup, accAddress, testconstants.NocRootCert1, vid) // add the new NOC certificate - nocX509Cert := types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocCert1) + nocX509Cert := types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocCert1, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, nocX509Cert) require.NoError(t, err) @@ -43,6 +43,7 @@ func TestHandler_AddNocX509Cert_AddNew(t *testing.T) { require.Equal(t, testconstants.NocCert1Subject, approvedCertificate.Subject) require.Equal(t, testconstants.NocCert1SubjectKeyID, approvedCertificate.SubjectKeyId) require.Equal(t, testconstants.NocCert1SerialNumber, approvedCertificate.SerialNumber) + require.Equal(t, testconstants.SchemaVersion, approvedCertificate.SchemaVersion) // query noc root certificate by SubjectKeyID approvedCertificatesBySubjectKeyID, err := queryAllApprovedCertificatesBySubjectKeyID(setup, testconstants.NocCert1SubjectKeyID) @@ -95,6 +96,7 @@ func TestHandler_AddNocX509Cert_Renew(t *testing.T) { testconstants.NocRootCert1SubjectKeyID, accAddress.String(), vid, + testconstants.SchemaVersion, ) newNocCertificate.SerialNumber = testconstants.TestSerialNumber @@ -110,7 +112,7 @@ func TestHandler_AddNocX509Cert_Renew(t *testing.T) { setup.Keeper.SetUniqueCertificate(setup.Ctx, uniqueCertificate) // add the new NOC certificate - addNocX509Cert := types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocCert1) + addNocX509Cert := types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocCert1, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addNocX509Cert) require.NoError(t, err) @@ -157,7 +159,7 @@ func TestHandler_AddNocX509Cert_Root_VID_Does_Not_Equal_To_AccountVID(t *testing setup.AddAccount(newAccAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, 1111) // try to add NOC certificate - nocX509Cert := types.NewMsgAddNocX509Cert(newAccAddress.String(), testconstants.NocCert1) + nocX509Cert := types.NewMsgAddNocX509Cert(newAccAddress.String(), testconstants.NocCert1, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, nocX509Cert) require.ErrorIs(t, err, pkitypes.ErrCertVidNotEqualAccountVid) } @@ -170,7 +172,7 @@ func TestHandler_AddNocX509Cert_ForInvalidCertificate(t *testing.T) { setup.AddAccount(accAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, vid) // add x509 certificate - addX509Cert := types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.StubCertPem) + addX509Cert := types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.StubCertPem, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addX509Cert) require.ErrorIs(t, err, pkitypes.ErrInvalidCertificate) } @@ -183,7 +185,7 @@ func TestHandler_AddXNoc509Cert_ForNocRootCertificate(t *testing.T) { setup.AddAccount(accAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, vid) // try to add root certificate x509 certificate - addX509Cert := types.NewMsgAddX509Cert(accAddress.String(), testconstants.NocRootCert1) + addX509Cert := types.NewMsgAddX509Cert(accAddress.String(), testconstants.NocRootCert1, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addX509Cert) require.ErrorIs(t, err, pkitypes.ErrNonRootCertificateSelfSigned) } @@ -206,7 +208,7 @@ func TestHandler_AddXNoc509Cert_ForRootNonNocCertificate(t *testing.T) { proposeAndApproveRootCertificate(setup, setup.Trustee1, rootCertOptions) // try to add root certificate x509 certificate - addX509Cert := types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.IntermediateCertWithVid1) + addX509Cert := types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.IntermediateCertWithVid1, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addX509Cert) require.ErrorIs(t, err, pkitypes.ErrInappropriateCertificateType) } @@ -219,7 +221,7 @@ func TestHandler_AddXNoc509Cert_WhenNocRootCertIsAbsent(t *testing.T) { setup.AddAccount(accAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, vid) // add the new NOC certificate - addNocX509Cert := types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocCert1) + addNocX509Cert := types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocCert1, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addNocX509Cert) require.ErrorIs(t, err, pkitypes.ErrInvalidCertificate) @@ -350,7 +352,7 @@ func TestHandler_AddNocX509Cert_CertificateExist(t *testing.T) { } setup.Keeper.SetUniqueCertificate(setup.Ctx, uniqueCertificate) - addNocX509Cert := types.NewMsgAddNocX509Cert(accAddress.String(), tc.nocCert) + addNocX509Cert := types.NewMsgAddNocX509Cert(accAddress.String(), tc.nocCert, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addNocX509Cert) require.ErrorIs(t, err, tc.err) }) @@ -359,7 +361,7 @@ func TestHandler_AddNocX509Cert_CertificateExist(t *testing.T) { func addNocRootCertificate(setup *TestSetup, address sdk.AccAddress, pemCert string, vid int32) { //nolint:unparam // add the new NOC root certificate - addNocX509RootCert := types.NewMsgAddNocX509RootCert(address.String(), pemCert) + addNocX509RootCert := types.NewMsgAddNocX509RootCert(address.String(), pemCert, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addNocX509RootCert) require.NoError(setup.T, err) diff --git a/x/pki/handler_add_noc_root_cert_test.go b/x/pki/handler_add_noc_root_cert_test.go index 75eebc910..933de763e 100644 --- a/x/pki/handler_add_noc_root_cert_test.go +++ b/x/pki/handler_add_noc_root_cert_test.go @@ -14,7 +14,7 @@ import ( func TestHandler_AddNocX509RootCert_SenderNotVendor(t *testing.T) { setup := Setup(t) - addNocX509RootCert := types.NewMsgAddNocX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem) + addNocX509RootCert := types.NewMsgAddNocX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addNocX509RootCert) require.Error(t, err) @@ -59,7 +59,7 @@ func TestHandler_AddNocX509RootCert_InvalidCertificate(t *testing.T) { setup := Setup(t) setup.AddAccount(accAddress, []dclauthtypes.AccountRole{tc.accountRole}, tc.accountVid) - addNocX509RootCert := types.NewMsgAddNocX509RootCert(accAddress.String(), tc.nocRoorCert) + addNocX509RootCert := types.NewMsgAddNocX509RootCert(accAddress.String(), tc.nocRoorCert, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addNocX509RootCert) require.ErrorIs(t, err, tc.err) }) @@ -151,7 +151,7 @@ func TestHandler_AddNocX509RootCert_CertificateExist(t *testing.T) { } setup.Keeper.SetUniqueCertificate(setup.Ctx, uniqueCertificate) - addNocX509RootCert := types.NewMsgAddNocX509RootCert(accAddress.String(), tc.nocRoorCert) + addNocX509RootCert := types.NewMsgAddNocX509RootCert(accAddress.String(), tc.nocRoorCert, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addNocX509RootCert) require.ErrorIs(t, err, tc.err) }) @@ -171,7 +171,7 @@ func TestHandler_AddNocX509RootCert_AddNew(t *testing.T) { newNocCertificate.Rejects = nil // add the new NOC root certificate - addNocX509RootCert := types.NewMsgAddNocX509RootCert(accAddress.String(), newNocCertificate.PemCert) + addNocX509RootCert := types.NewMsgAddNocX509RootCert(accAddress.String(), newNocCertificate.PemCert, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addNocX509RootCert) require.NoError(t, err) @@ -231,7 +231,7 @@ func TestHandler_AddNocX509RootCert_Renew(t *testing.T) { newNocCertificate.Rejects = nil // add the new NOC root certificate - addNocX509RootCert := types.NewMsgAddNocX509RootCert(accAddress.String(), newNocCertificate.PemCert) + addNocX509RootCert := types.NewMsgAddNocX509RootCert(accAddress.String(), newNocCertificate.PemCert, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addNocX509RootCert) require.NoError(t, err) diff --git a/x/pki/handler_add_non_root_cert_test.go b/x/pki/handler_add_non_root_cert_test.go index 34aeda65a..c28236a0d 100644 --- a/x/pki/handler_add_non_root_cert_test.go +++ b/x/pki/handler_add_non_root_cert_test.go @@ -24,7 +24,7 @@ func TestHandler_AddX509Cert(t *testing.T) { setup.AddAccount(accAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, 1) // add x509 certificate - addX509Cert := types.NewMsgAddX509Cert(accAddress.String(), testconstants.IntermediateCertPem) + addX509Cert := types.NewMsgAddX509Cert(accAddress.String(), testconstants.IntermediateCertPem, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addX509Cert) require.NoError(t, err) @@ -46,6 +46,7 @@ func TestHandler_AddX509Cert(t *testing.T) { require.Equal(t, testconstants.IntermediateSubject, cert.Subject) require.Equal(t, testconstants.IntermediateSubjectKeyID, cert.SubjectKeyId) require.Equal(t, testconstants.IntermediateSerialNumber, cert.SerialNumber) + require.Equal(t, testconstants.SchemaVersion, cert.SchemaVersion) require.False(t, cert.IsRoot) require.Equal(t, testconstants.IntermediateIssuer, cert.Issuer) require.Equal(t, testconstants.IntermediateAuthorityKeyID, cert.AuthorityKeyId) @@ -81,7 +82,7 @@ func TestHandler_AddX509Cert_ForInvalidCertificate(t *testing.T) { setup.AddAccount(accAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, 1) // add x509 certificate - addX509Cert := types.NewMsgAddX509Cert(accAddress.String(), testconstants.StubCertPem) + addX509Cert := types.NewMsgAddX509Cert(accAddress.String(), testconstants.StubCertPem, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addX509Cert) require.ErrorIs(t, err, pkitypes.ErrInvalidCertificate) } @@ -93,7 +94,7 @@ func TestHandler_AddX509Cert_ForRootCertificate(t *testing.T) { setup.AddAccount(accAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, 1) // add root certificate as leaf x509 certificate - addX509Cert := types.NewMsgAddX509Cert(accAddress.String(), testconstants.RootCertPem) + addX509Cert := types.NewMsgAddX509Cert(accAddress.String(), testconstants.RootCertPem, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addX509Cert) require.ErrorIs(t, err, pkitypes.ErrNonRootCertificateSelfSigned) } @@ -109,7 +110,7 @@ func TestHandler_AddX509Cert_ForDuplicate(t *testing.T) { setup.AddAccount(accAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, 1) // store intermediate certificate - addX509Cert := types.NewMsgAddX509Cert(accAddress.String(), testconstants.IntermediateCertPem) + addX509Cert := types.NewMsgAddX509Cert(accAddress.String(), testconstants.IntermediateCertPem, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addX509Cert) require.NoError(t, err) @@ -143,7 +144,7 @@ func TestHandler_AddX509Cert_ForExistingNocCertificate(t *testing.T) { setup.Keeper.SetUniqueCertificate(setup.Ctx, uniqueCertificate) // store intermediate certificate - addX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateCertPem) + addX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateCertPem, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addX509Cert) require.ErrorIs(t, err, pkitypes.ErrInappropriateCertificateType) } @@ -159,7 +160,7 @@ func TestHandler_AddX509Cert_NoRootCert(t *testing.T) { setup.Keeper.AddApprovedCertificate(setup.Ctx, intermediateCertificate) // add leaf x509 certificate - addX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.LeafCertPem) + addX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.LeafCertPem, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addX509Cert) require.ErrorIs(t, err, pkitypes.ErrInvalidCertificate) } @@ -171,12 +172,12 @@ func TestHandler_AddX509Cert_RootIsNoc(t *testing.T) { setup.AddAccount(accAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, testconstants.IntermediateCertWithVid1Vid) // Add NOC root certificate - addNocX509RootCert := types.NewMsgAddNocX509RootCert(accAddress.String(), testconstants.RootCertPem) + addNocX509RootCert := types.NewMsgAddNocX509RootCert(accAddress.String(), testconstants.RootCertPem, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addNocX509RootCert) require.NoError(t, err) // add x509 certificate - addX509Cert := types.NewMsgAddX509Cert(accAddress.String(), testconstants.IntermediateCertPem) + addX509Cert := types.NewMsgAddX509Cert(accAddress.String(), testconstants.IntermediateCertPem, testconstants.SchemaVersion) _, err = setup.Handler(setup.Ctx, addX509Cert) require.ErrorIs(t, err, pkitypes.ErrInappropriateCertificateType) } @@ -201,7 +202,7 @@ func TestHandler_AddX509Cert_ForDifferentSerialNumber(t *testing.T) { setup.Keeper.AddApprovedCertificate(setup.Ctx, intermediateCertificate) // store intermediate certificate second time - addX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateCertPem) + addX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateCertPem, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addX509Cert) require.NoError(t, err) @@ -232,7 +233,7 @@ func TestHandler_AddX509Cert_ForAbsentDirectParentCert(t *testing.T) { setup.AddAccount(vendorAccAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, testconstants.Vid) // add intermediate x509 certificate - addX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateCertPem) + addX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateCertPem, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addX509Cert) require.ErrorIs(t, err, pkitypes.ErrInvalidCertificate) } @@ -243,14 +244,14 @@ func TestHandler_AddX509Cert_ForFailedCertificateVerification(t *testing.T) { // add invalid root invalidRootCertificate := types.NewRootCertificate(testconstants.StubCertPem, testconstants.RootSubject, testconstants.RootSubjectAsText, testconstants.RootSubjectKeyID, - testconstants.RootSerialNumber, setup.Trustee1.String(), []*types.Grant{}, []*types.Grant{}, testconstants.Vid) + testconstants.RootSerialNumber, setup.Trustee1.String(), []*types.Grant{}, []*types.Grant{}, testconstants.Vid, testconstants.SchemaVersion) setup.Keeper.AddApprovedCertificate(setup.Ctx, invalidRootCertificate) vendorAccAddress := GenerateAccAddress() setup.AddAccount(vendorAccAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, testconstants.Vid) // add intermediate x509 certificate - addX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateCertPem) + addX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateCertPem, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addX509Cert) require.ErrorIs(t, err, pkitypes.ErrInvalidCertificate) } @@ -266,12 +267,12 @@ func TestHandler_AddX509Cert_ForTree(t *testing.T) { setup.AddAccount(vendorAccAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, testconstants.Vid) // add intermediate x509 certificate - addIntermediateX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateCertPem) + addIntermediateX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateCertPem, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addIntermediateX509Cert) require.NoError(t, err) // add leaf x509 certificate - addLeafX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.LeafCertPem) + addLeafX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.LeafCertPem, testconstants.SchemaVersion) _, err = setup.Handler(setup.Ctx, addLeafX509Cert) require.NoError(t, err) @@ -350,12 +351,12 @@ func TestHandler_AddX509Cert_EachChildCertRefersToTwoParentCerts(t *testing.T) { setup.Keeper.SetChildCertificates(setup.Ctx, rootChildCertificates) // store second intermediate certificate (it refers to two parent certificates) - addX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateCertPem) + addX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateCertPem, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addX509Cert) require.NoError(t, err) // store leaf certificate (it refers to two parent certificates) - addX509Cert = types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.LeafCertPem) + addX509Cert = types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.LeafCertPem, testconstants.SchemaVersion) _, err = setup.Handler(setup.Ctx, addX509Cert) require.NoError(t, err) @@ -422,7 +423,7 @@ func TestHandler_AddX509Cert_ByNotOwnerButSameVendor(t *testing.T) { setup.AddAccount(vendorAccAddress2, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, testconstants.Vid) // add an intermediate certificate with the same subject and SKID by second vendor account - addX509Cert := types.NewMsgAddX509Cert(vendorAccAddress2.String(), testconstants.IntermediateCertPem) + addX509Cert := types.NewMsgAddX509Cert(vendorAccAddress2.String(), testconstants.IntermediateCertPem, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addX509Cert) require.NoError(t, err) } @@ -453,7 +454,7 @@ func TestHandler_AddX509Cert_ByOtherVendor(t *testing.T) { setup.AddAccount(vendorAccAddress2, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, testconstants.VendorID1) // add an intermediate certificate with the same subject and SKID by second vendor account - addX509Cert := types.NewMsgAddX509Cert(vendorAccAddress2.String(), testconstants.IntermediateCertPem) + addX509Cert := types.NewMsgAddX509Cert(vendorAccAddress2.String(), testconstants.IntermediateCertPem, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addX509Cert) require.ErrorIs(t, err, sdkerrors.ErrUnauthorized) } @@ -466,7 +467,7 @@ func TestHandler_AddX509Cert_SenderNotVendor(t *testing.T) { proposeAndApproveRootCertificate(setup, setup.Trustee1, rootCertOptions) // add x509 certificate - addX509Cert := types.NewMsgAddX509Cert(setup.Trustee1.String(), testconstants.IntermediateCertWithVid1) + addX509Cert := types.NewMsgAddX509Cert(setup.Trustee1.String(), testconstants.IntermediateCertWithVid1, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addX509Cert) require.ErrorIs(t, err, sdkerrors.ErrUnauthorized) } @@ -482,7 +483,7 @@ func TestHandler_AddX509Cert_VIDScopedRoot(t *testing.T) { setup.AddAccount(accAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, testconstants.PAACertWithNumericVidVid) // add x509 certificate - addX509Cert := types.NewMsgAddX509Cert(accAddress.String(), testconstants.PAICertWithNumericPidVid) + addX509Cert := types.NewMsgAddX509Cert(accAddress.String(), testconstants.PAICertWithNumericPidVid, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addX509Cert) require.NoError(t, err) @@ -534,7 +535,7 @@ func TestHandler_AddX509Cert_NonVIDScopedRoot(t *testing.T) { setup.AddAccount(accAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, tc.accountVid) // add x509 certificate - addX509Cert := types.NewMsgAddX509Cert(accAddress.String(), tc.childCert) + addX509Cert := types.NewMsgAddX509Cert(accAddress.String(), tc.childCert, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addX509Cert) require.NoError(t, err) @@ -585,7 +586,7 @@ func TestHandler_AddX509Cert_VIDScopedRoot_NegativeCases(t *testing.T) { setup.AddAccount(accAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, tc.accountVid) // add x509 certificate - addX509Cert := types.NewMsgAddX509Cert(accAddress.String(), tc.childCert) + addX509Cert := types.NewMsgAddX509Cert(accAddress.String(), tc.childCert, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addX509Cert) require.ErrorIs(t, err, tc.err) }) @@ -628,7 +629,7 @@ func TestHandler_AddX509Cert_NonVIDScopedRoot_NegativeCases(t *testing.T) { setup.AddAccount(accAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, tc.accountVid) // add x509 certificate - addX509Cert := types.NewMsgAddX509Cert(accAddress.String(), tc.childCert) + addX509Cert := types.NewMsgAddX509Cert(accAddress.String(), tc.childCert, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addX509Cert) require.ErrorIs(t, err, tc.err) }) diff --git a/x/pki/handler_add_revocation_test.go b/x/pki/handler_add_revocation_test.go index 76e0a0ef8..8ea6d8a5d 100644 --- a/x/pki/handler_add_revocation_test.go +++ b/x/pki/handler_add_revocation_test.go @@ -148,26 +148,31 @@ func TestHandler_AddPkiRevocationDistributionPoint_PositiveCases(t *testing.T) { name string rootCertOptions *rootCertOptions addRevocation *types.MsgAddPkiRevocationDistributionPoint + SchemaVersion uint32 }{ { name: "PAAWithVid", rootCertOptions: createPAACertWithNumericVidOptions(), addRevocation: createAddRevocationMessageWithPAACertWithNumericVid(vendorAcc.String()), + SchemaVersion: 0, }, { name: "PAIWithNumericVidPid", rootCertOptions: createPAACertWithNumericVidOptions(), addRevocation: createAddRevocationMessageWithPAICertWithNumericVidPid(vendorAcc.String()), + SchemaVersion: 1, }, { name: "PAIWithStringVidPid", rootCertOptions: createPAACertNoVidOptions(testconstants.PAICertWithPidVidVid), addRevocation: createAddRevocationMessageWithPAICertWithVidPid(vendorAcc.String()), + SchemaVersion: 2, }, { name: "PAANoVid", rootCertOptions: createPAACertNoVidOptions(testconstants.VendorID1), addRevocation: createAddRevocationMessageWithPAACertNoVid(vendorAcc.String(), testconstants.VendorID1), + SchemaVersion: 1000000, }, { name: "PAIWithVid", @@ -183,6 +188,7 @@ func TestHandler_AddPkiRevocationDistributionPoint_PositiveCases(t *testing.T) { IssuerSubjectKeyID: testconstants.SubjectKeyIDWithoutColons, RevocationType: types.CRLRevocationType, }, + SchemaVersion: 999999999, }, } @@ -192,7 +198,7 @@ func TestHandler_AddPkiRevocationDistributionPoint_PositiveCases(t *testing.T) { setup.AddAccount(vendorAcc, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, tc.addRevocation.Vid) proposeAndApproveRootCertificate(setup, setup.Trustee1, tc.rootCertOptions) - + tc.addRevocation.SchemaVersion = tc.SchemaVersion _, err := setup.Handler(setup.Ctx, tc.addRevocation) require.NoError(t, err) diff --git a/x/pki/handler_remove_non_root_cert_test.go b/x/pki/handler_remove_non_root_cert_test.go index 445c20bc0..af07a4541 100644 --- a/x/pki/handler_remove_non_root_cert_test.go +++ b/x/pki/handler_remove_non_root_cert_test.go @@ -30,17 +30,17 @@ func TestHandler_RemoveX509Cert_BySerialNumber(t *testing.T) { setup.AddAccount(vendorAccAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, testconstants.RootCertWithVidVid) // Add intermediate certificates - addIntermediateX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateWithSameSubjectAndSKID1) + addIntermediateX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateWithSameSubjectAndSKID1, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addIntermediateX509Cert) require.NoError(t, err) // Add intermediate certificates with sam subject and SKID but different serial number - addIntermediateX509Cert = types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateWithSameSubjectAndSKID2) + addIntermediateX509Cert = types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateWithSameSubjectAndSKID2, testconstants.SchemaVersion) _, err = setup.Handler(setup.Ctx, addIntermediateX509Cert) require.NoError(t, err) // Add a leaf certificate - addLeafX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.LeafCertWithSameSubjectAndSKID) + addLeafX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.LeafCertWithSameSubjectAndSKID, testconstants.SchemaVersion) _, err = setup.Handler(setup.Ctx, addLeafX509Cert) require.NoError(t, err) @@ -114,7 +114,7 @@ func TestHandler_RemoveX509Cert_RevokedAndApprovedCertificate(t *testing.T) { setup.AddAccount(vendorAccAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, testconstants.RootCertWithVidVid) // Add an intermediate certificate - addIntermediateX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateWithSameSubjectAndSKID1) + addIntermediateX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateWithSameSubjectAndSKID1, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addIntermediateX509Cert) require.NoError(t, err) @@ -135,7 +135,7 @@ func TestHandler_RemoveX509Cert_RevokedAndApprovedCertificate(t *testing.T) { require.NoError(t, err) // Add an intermediate certificate with new serial number - addIntermediateX509Cert = types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateWithSameSubjectAndSKID2) + addIntermediateX509Cert = types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateWithSameSubjectAndSKID2, testconstants.SchemaVersion) _, err = setup.Handler(setup.Ctx, addIntermediateX509Cert) require.NoError(t, err) @@ -188,7 +188,7 @@ func TestHandler_RemoveX509Cert_RevokedCertificate(t *testing.T) { setup.AddAccount(vendorAccAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, testconstants.RootCertWithVidVid) // Add two intermediate certificates again - addIntermediateX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateCertPem) + addIntermediateX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateCertPem, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addIntermediateX509Cert) require.NoError(t, err) @@ -292,7 +292,7 @@ func TestHandler_RemoveX509Cert_ByNotOwnerButSameVendor(t *testing.T) { setup.AddAccount(vendorAccAddress1, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, testconstants.Vid) // add x509 certificate by fist vendor account - addX509Cert := types.NewMsgAddX509Cert(vendorAccAddress1.String(), testconstants.IntermediateCertPem) + addX509Cert := types.NewMsgAddX509Cert(vendorAccAddress1.String(), testconstants.IntermediateCertPem, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addX509Cert) require.NoError(t, err) @@ -342,7 +342,7 @@ func TestHandler_RemoveX509Cert_ByOtherVendor(t *testing.T) { setup.AddAccount(vendorAccAddress1, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, testconstants.Vid) // add x509 certificate by `setup.Trustee` - addX509Cert := types.NewMsgAddX509Cert(vendorAccAddress1.String(), testconstants.IntermediateCertPem) + addX509Cert := types.NewMsgAddX509Cert(vendorAccAddress1.String(), testconstants.IntermediateCertPem, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addX509Cert) require.NoError(t, err) @@ -370,7 +370,7 @@ func TestHandler_RemoveX509Cert_SenderNotVendor(t *testing.T) { setup.AddAccount(vendorAccAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, testconstants.RootCertWithVidVid) // add x509 certificate - addX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateCertWithVid1) + addX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateCertWithVid1, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addX509Cert) require.NoError(t, err) @@ -408,7 +408,7 @@ func TestHandler_RemoveX509Cert_InvalidSerialNumber(t *testing.T) { vendorAccAddress := GenerateAccAddress() setup.AddAccount(vendorAccAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, testconstants.Vid) - addX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateCertPem) + addX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateCertPem, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addX509Cert) require.NoError(t, err) @@ -436,15 +436,15 @@ func TestHandler_RemoveX509Cert_BySubjectAndSKID(t *testing.T) { setup.AddAccount(vendorAccAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, testconstants.RootCertWithVidVid) // Add two intermediate certificates - addIntermediateX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateWithSameSubjectAndSKID1) + addIntermediateX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateWithSameSubjectAndSKID1, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addIntermediateX509Cert) require.NoError(t, err) - addIntermediateX509Cert = types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateWithSameSubjectAndSKID2) + addIntermediateX509Cert = types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateWithSameSubjectAndSKID2, testconstants.SchemaVersion) _, err = setup.Handler(setup.Ctx, addIntermediateX509Cert) require.NoError(t, err) // Add a leaf certificate - addLeafX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.LeafCertWithSameSubjectAndSKID) + addLeafX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.LeafCertWithSameSubjectAndSKID, testconstants.SchemaVersion) _, err = setup.Handler(setup.Ctx, addLeafX509Cert) require.NoError(t, err) diff --git a/x/pki/handler_revoke_noc_cert_test.go b/x/pki/handler_revoke_noc_cert_test.go index ef1a06a5a..152aab674 100644 --- a/x/pki/handler_revoke_noc_cert_test.go +++ b/x/pki/handler_revoke_noc_cert_test.go @@ -21,7 +21,7 @@ func TestHandler_RevokeNocX509Cert_SenderNotVendor(t *testing.T) { setup.AddAccount(accAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, testconstants.Vid) // add the new NOC root certificate - addNocX509RootCert := types.NewMsgAddNocX509RootCert(accAddress.String(), testconstants.NocRootCert1) + addNocX509RootCert := types.NewMsgAddNocX509RootCert(accAddress.String(), testconstants.NocRootCert1, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addNocX509RootCert) require.NoError(t, err) @@ -165,22 +165,22 @@ func TestHandler_RevokeNocX509Cert_RevokeDefault(t *testing.T) { setup.AddAccount(accAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, testconstants.Vid) // add the first NOC root certificate - addNocX509RootCert := types.NewMsgAddNocX509RootCert(accAddress.String(), testconstants.NocRootCert1) + addNocX509RootCert := types.NewMsgAddNocX509RootCert(accAddress.String(), testconstants.NocRootCert1, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addNocX509RootCert) require.NoError(t, err) // add the first NOC non-root certificate - addNocX509Cert := types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocCert1) + addNocX509Cert := types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocCert1, testconstants.SchemaVersion) _, err = setup.Handler(setup.Ctx, addNocX509Cert) require.NoError(t, err) // add the second NOC non-root certificate - addNocX509Cert = types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocCert1Copy) + addNocX509Cert = types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocCert1Copy, testconstants.SchemaVersion) _, err = setup.Handler(setup.Ctx, addNocX509Cert) require.NoError(t, err) // add the NOC leaf certificate - addNocX509Cert = types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocLeafCert1) + addNocX509Cert = types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocLeafCert1, testconstants.SchemaVersion) _, err = setup.Handler(setup.Ctx, addNocX509Cert) require.NoError(t, err) @@ -259,22 +259,22 @@ func TestHandler_RevokeNocX509Cert_RevokeWithChild(t *testing.T) { setup.AddAccount(accAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, testconstants.Vid) // add the first NOC root certificate - addNocX509RootCert := types.NewMsgAddNocX509RootCert(accAddress.String(), testconstants.NocRootCert1) + addNocX509RootCert := types.NewMsgAddNocX509RootCert(accAddress.String(), testconstants.NocRootCert1, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addNocX509RootCert) require.NoError(t, err) // add the first NOC non-root certificate - addNocX509Cert := types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocCert1) + addNocX509Cert := types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocCert1, testconstants.SchemaVersion) _, err = setup.Handler(setup.Ctx, addNocX509Cert) require.NoError(t, err) // add the second NOC non-root certificate - addNocX509Cert = types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocCert1Copy) + addNocX509Cert = types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocCert1Copy, testconstants.SchemaVersion) _, err = setup.Handler(setup.Ctx, addNocX509Cert) require.NoError(t, err) // add the NOC leaf certificate - addNocX509Cert = types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocLeafCert1) + addNocX509Cert = types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocLeafCert1, testconstants.SchemaVersion) _, err = setup.Handler(setup.Ctx, addNocX509Cert) require.NoError(t, err) @@ -360,22 +360,22 @@ func TestHandler_RevokeNocX509Cert_RevokeBySerialNumber(t *testing.T) { setup.AddAccount(accAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, testconstants.Vid) // add the first NOC root certificate - addNocX509RootCert := types.NewMsgAddNocX509RootCert(accAddress.String(), testconstants.NocRootCert1) + addNocX509RootCert := types.NewMsgAddNocX509RootCert(accAddress.String(), testconstants.NocRootCert1, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addNocX509RootCert) require.NoError(t, err) // add the first NOC non-root certificate - addNocX509Cert := types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocCert1) + addNocX509Cert := types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocCert1, testconstants.SchemaVersion) _, err = setup.Handler(setup.Ctx, addNocX509Cert) require.NoError(t, err) // add the second NOC non-root certificate - addNocX509Cert = types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocCert1Copy) + addNocX509Cert = types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocCert1Copy, testconstants.SchemaVersion) _, err = setup.Handler(setup.Ctx, addNocX509Cert) require.NoError(t, err) // add the NOC leaf certificate - addNocX509Cert = types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocLeafCert1) + addNocX509Cert = types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocLeafCert1, testconstants.SchemaVersion) _, err = setup.Handler(setup.Ctx, addNocX509Cert) require.NoError(t, err) @@ -453,22 +453,22 @@ func TestHandler_RevokeNocX509Cert_RevokeBySerialNumberAndWithChild(t *testing.T setup.AddAccount(accAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, testconstants.Vid) // add the first NOC root certificate - addNocX509RootCert := types.NewMsgAddNocX509RootCert(accAddress.String(), testconstants.NocRootCert1) + addNocX509RootCert := types.NewMsgAddNocX509RootCert(accAddress.String(), testconstants.NocRootCert1, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addNocX509RootCert) require.NoError(t, err) // add the first NOC non-root certificate - addNocX509Cert := types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocCert1) + addNocX509Cert := types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocCert1, testconstants.SchemaVersion) _, err = setup.Handler(setup.Ctx, addNocX509Cert) require.NoError(t, err) // add the second NOC non-root certificate - addNocX509Cert = types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocCert1Copy) + addNocX509Cert = types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocCert1Copy, testconstants.SchemaVersion) _, err = setup.Handler(setup.Ctx, addNocX509Cert) require.NoError(t, err) // add the NOC leaf certificate - addNocX509Cert = types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocLeafCert1) + addNocX509Cert = types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocLeafCert1, testconstants.SchemaVersion) _, err = setup.Handler(setup.Ctx, addNocX509Cert) require.NoError(t, err) diff --git a/x/pki/handler_revoke_noc_root_cert_test.go b/x/pki/handler_revoke_noc_root_cert_test.go index 560b38c35..41ef73306 100644 --- a/x/pki/handler_revoke_noc_root_cert_test.go +++ b/x/pki/handler_revoke_noc_root_cert_test.go @@ -21,7 +21,7 @@ func TestHandler_RevokeNocX509RootCert_SenderNotVendor(t *testing.T) { setup.AddAccount(accAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, testconstants.Vid) // add the new NOC root certificate - addNocX509RootCert := types.NewMsgAddNocX509RootCert(accAddress.String(), testconstants.NocRootCert1) + addNocX509RootCert := types.NewMsgAddNocX509RootCert(accAddress.String(), testconstants.NocRootCert1, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addNocX509RootCert) require.NoError(t, err) @@ -165,27 +165,27 @@ func TestHandler_RevokeNocX509RootCert_RevokeDefault(t *testing.T) { setup.AddAccount(accAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, testconstants.Vid) // add the first NOC root certificate - addNocX509RootCert := types.NewMsgAddNocX509RootCert(accAddress.String(), testconstants.NocRootCert1) + addNocX509RootCert := types.NewMsgAddNocX509RootCert(accAddress.String(), testconstants.NocRootCert1, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addNocX509RootCert) require.NoError(t, err) // add the second NOC root certificate - addNocX509RootCert = types.NewMsgAddNocX509RootCert(accAddress.String(), testconstants.NocRootCert1Copy) + addNocX509RootCert = types.NewMsgAddNocX509RootCert(accAddress.String(), testconstants.NocRootCert1Copy, testconstants.SchemaVersion) _, err = setup.Handler(setup.Ctx, addNocX509RootCert) require.NoError(t, err) // add the third NOC root certificate - addNocX509RootCert = types.NewMsgAddNocX509RootCert(accAddress.String(), testconstants.NocRootCert2) + addNocX509RootCert = types.NewMsgAddNocX509RootCert(accAddress.String(), testconstants.NocRootCert2, testconstants.SchemaVersion) _, err = setup.Handler(setup.Ctx, addNocX509RootCert) require.NoError(t, err) // add the first NOC non-root certificate - addNocX509Cert := types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocCert1) + addNocX509Cert := types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocCert1, testconstants.SchemaVersion) _, err = setup.Handler(setup.Ctx, addNocX509Cert) require.NoError(t, err) // add the second NOC non-root certificate - addNocX509Cert = types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocCert2) + addNocX509Cert = types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocCert2, testconstants.SchemaVersion) _, err = setup.Handler(setup.Ctx, addNocX509Cert) require.NoError(t, err) @@ -269,17 +269,17 @@ func TestHandler_RevokeNocX509RootCert_RevokeWithChild(t *testing.T) { setup.AddAccount(accAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, testconstants.Vid) // add the first NOC root certificate - addNocX509RootCert := types.NewMsgAddNocX509RootCert(accAddress.String(), testconstants.NocRootCert1) + addNocX509RootCert := types.NewMsgAddNocX509RootCert(accAddress.String(), testconstants.NocRootCert1, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addNocX509RootCert) require.NoError(t, err) // add the second NOC root certificate - addNocX509RootCert = types.NewMsgAddNocX509RootCert(accAddress.String(), testconstants.NocRootCert1Copy) + addNocX509RootCert = types.NewMsgAddNocX509RootCert(accAddress.String(), testconstants.NocRootCert1Copy, testconstants.SchemaVersion) _, err = setup.Handler(setup.Ctx, addNocX509RootCert) require.NoError(t, err) // add the first NOC non-root certificate - addNocX509Cert := types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocCert1) + addNocX509Cert := types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocCert1, testconstants.SchemaVersion) _, err = setup.Handler(setup.Ctx, addNocX509Cert) require.NoError(t, err) @@ -372,17 +372,17 @@ func TestHandler_RevokeNocX509RootCert_RevokeWithSerialNumber(t *testing.T) { setup.AddAccount(accAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, testconstants.Vid) // add the first NOC root certificate - addNocX509RootCert := types.NewMsgAddNocX509RootCert(accAddress.String(), testconstants.NocRootCert1) + addNocX509RootCert := types.NewMsgAddNocX509RootCert(accAddress.String(), testconstants.NocRootCert1, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addNocX509RootCert) require.NoError(t, err) // add the second NOC root certificate - addNocX509RootCert = types.NewMsgAddNocX509RootCert(accAddress.String(), testconstants.NocRootCert1Copy) + addNocX509RootCert = types.NewMsgAddNocX509RootCert(accAddress.String(), testconstants.NocRootCert1Copy, testconstants.SchemaVersion) _, err = setup.Handler(setup.Ctx, addNocX509RootCert) require.NoError(t, err) // add the first NOC non-root certificate - addNocX509Cert := types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocCert1) + addNocX509Cert := types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocCert1, testconstants.SchemaVersion) _, err = setup.Handler(setup.Ctx, addNocX509Cert) require.NoError(t, err) @@ -462,17 +462,17 @@ func TestHandler_RevokeNocX509RootCert_RevokeWithSerialNumberAndChild(t *testing setup.AddAccount(accAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, testconstants.Vid) // add the first NOC root certificate - addNocX509RootCert := types.NewMsgAddNocX509RootCert(accAddress.String(), testconstants.NocRootCert1) + addNocX509RootCert := types.NewMsgAddNocX509RootCert(accAddress.String(), testconstants.NocRootCert1, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addNocX509RootCert) require.NoError(t, err) // add the second NOC root certificate - addNocX509RootCert = types.NewMsgAddNocX509RootCert(accAddress.String(), testconstants.NocRootCert1Copy) + addNocX509RootCert = types.NewMsgAddNocX509RootCert(accAddress.String(), testconstants.NocRootCert1Copy, testconstants.SchemaVersion) _, err = setup.Handler(setup.Ctx, addNocX509RootCert) require.NoError(t, err) // add the first NOC non-root certificate - addNocX509Cert := types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocCert1) + addNocX509Cert := types.NewMsgAddNocX509Cert(accAddress.String(), testconstants.NocCert1, testconstants.SchemaVersion) _, err = setup.Handler(setup.Ctx, addNocX509Cert) require.NoError(t, err) diff --git a/x/pki/handler_revoke_non_root_cert_test.go b/x/pki/handler_revoke_non_root_cert_test.go index 9395210d4..a0076bafd 100644 --- a/x/pki/handler_revoke_non_root_cert_test.go +++ b/x/pki/handler_revoke_non_root_cert_test.go @@ -45,7 +45,7 @@ func TestHandler_RevokeX509Cert_CertificateDoesNotExistBySerialNumber(t *testing setup.AddAccount(vendorAccAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, testconstants.Vid) // Add intermediate certificate - addIntermediateX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateCertPem) + addIntermediateX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateCertPem, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addIntermediateX509Cert) require.NoError(t, err) @@ -100,12 +100,12 @@ func TestHandler_RevokeX509Cert_ForTree(t *testing.T) { setup.AddAccount(vendorAccAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, testconstants.Vid) // add intermediate x509 certificate - addIntermediateX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateCertPem) + addIntermediateX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateCertPem, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addIntermediateX509Cert) require.NoError(t, err) // add leaf x509 certificate - addLeafX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.LeafCertPem) + addLeafX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.LeafCertPem, testconstants.SchemaVersion) _, err = setup.Handler(setup.Ctx, addLeafX509Cert) require.NoError(t, err) @@ -187,7 +187,7 @@ func TestHandler_RevokeX509Cert_ByNotOwnerButSameVendor(t *testing.T) { setup.AddAccount(vendorAccAddress1, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, testconstants.Vid) // add x509 certificate by first vendor account - addX509Cert := types.NewMsgAddX509Cert(vendorAccAddress1.String(), testconstants.IntermediateCertPem) + addX509Cert := types.NewMsgAddX509Cert(vendorAccAddress1.String(), testconstants.IntermediateCertPem, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addX509Cert) require.NoError(t, err) @@ -246,7 +246,7 @@ func TestHandler_RevokeX509Cert_ByOtherVendor(t *testing.T) { setup.AddAccount(vendorAccAddress1, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, testconstants.Vid) // add x509 certificate by first vendor account - addX509Cert := types.NewMsgAddX509Cert(vendorAccAddress1.String(), testconstants.IntermediateCertPem) + addX509Cert := types.NewMsgAddX509Cert(vendorAccAddress1.String(), testconstants.IntermediateCertPem, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addX509Cert) require.NoError(t, err) @@ -280,7 +280,7 @@ func TestHandler_RevokeX509Cert_SenderNotVendor(t *testing.T) { setup.AddAccount(vendorAccAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, testconstants.RootCertWithVidVid) // add x509 certificate - addX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateCertWithVid1) + addX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateCertWithVid1, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addX509Cert) require.NoError(t, err) @@ -309,7 +309,7 @@ func TestHandler_RevokeX509Cert(t *testing.T) { setup.AddAccount(vendorAccAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, testconstants.Vid) // add x509 certificate - addX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateCertPem) + addX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateCertPem, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addX509Cert) require.NoError(t, err) @@ -371,7 +371,7 @@ func TestHandler_RevokeX509Cert_BySerialNumber(t *testing.T) { setup.AddAccount(vendorAccAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, testconstants.Vid) // Add two intermediate certificates - addIntermediateX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateCertPem) + addIntermediateX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateCertPem, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addIntermediateX509Cert) require.NoError(t, err) intermediateCertificate := intermediateCertificate(vendorAccAddress) @@ -383,7 +383,7 @@ func TestHandler_RevokeX509Cert_BySerialNumber(t *testing.T) { uniqueCertificate(intermediateCertificate.Issuer, intermediateCertificate.SerialNumber), ) // Add a leaf certificate - addLeafX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.LeafCertPem) + addLeafX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.LeafCertPem, testconstants.SchemaVersion) _, err = setup.Handler(setup.Ctx, addLeafX509Cert) require.NoError(t, err) diff --git a/x/pki/handler_test.go b/x/pki/handler_test.go index 6aca06b82..cb3369129 100644 --- a/x/pki/handler_test.go +++ b/x/pki/handler_test.go @@ -147,7 +147,7 @@ func TestHandler_ProposeAddX509RootCert_ByNotTrustee(t *testing.T) { setup.AddAccount(accAddress, []dclauthtypes.AccountRole{role}, 1) // propose x509 root certificate - proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(accAddress.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid) + proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(accAddress.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, proposeAddX509RootCert) require.ErrorIs(t, err, sdkerrors.ErrUnauthorized) } @@ -157,7 +157,7 @@ func TestHandler_ProposeAddAndRejectX509RootCert_ByTrustee(t *testing.T) { setup := Setup(t) // propose x509 root certificate - proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid) + proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, proposeAddX509RootCert) require.NoError(t, err) @@ -177,7 +177,7 @@ func TestHandler_ProposeAddAndRejectX509RootCert_ByAnotherTrustee(t *testing.T) setup := Setup(t) // propose x509 root certificate - proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid) + proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, proposeAddX509RootCert) require.NoError(t, err) @@ -207,9 +207,9 @@ func TestHandler_ProposeAddAndRejectX509RootCertWithApproval_ByTrustee(t *testin accAddress := GenerateAccAddress() setup.AddAccount(accAddress, []dclauthtypes.AccountRole{dclauthtypes.Trustee}, 1) - + var schemaVersion uint32 = 2 // propose x509 root certificate - proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid) + proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid, schemaVersion) _, err := setup.Handler(setup.Ctx, proposeAddX509RootCert) require.NoError(t, err) @@ -233,6 +233,7 @@ func TestHandler_ProposeAddAndRejectX509RootCertWithApproval_ByTrustee(t *testin require.Equal(t, testconstants.RootSubject, proposedCertificate.Subject) require.Equal(t, testconstants.RootSubjectKeyID, proposedCertificate.SubjectKeyId) require.Equal(t, testconstants.RootSerialNumber, proposedCertificate.SerialNumber) + require.Equal(t, schemaVersion, proposedCertificate.SchemaVersion) require.True(t, proposedCertificate.HasRejectFrom(setup.Trustee1.String())) require.True(t, proposedCertificate.HasApprovalFrom(setup.Trustee2.String())) @@ -245,7 +246,7 @@ func TestHandler_ProposeAddX509RootCert_ByTrustee(t *testing.T) { setup := Setup(t) // propose x509 root certificate - proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid) + proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, proposeAddX509RootCert) require.NoError(t, err) @@ -274,7 +275,7 @@ func TestHandler_ProposeAddX509RootCert_ForInvalidCertificate(t *testing.T) { setup := Setup(t) // propose x509 root certificate - proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.StubCertPem, testconstants.Info, testconstants.Vid) + proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.StubCertPem, testconstants.Info, testconstants.Vid, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, proposeAddX509RootCert) require.Error(t, err) require.True(t, pkitypes.ErrInvalidCertificate.Is(err)) @@ -284,7 +285,7 @@ func TestHandler_ProposeAddX509RootCert_ForNonRootCertificate(t *testing.T) { setup := Setup(t) // propose x509 leaf certificate as root - proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.LeafCertPem, testconstants.Info, testconstants.Vid) + proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.LeafCertPem, testconstants.Info, testconstants.Vid, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, proposeAddX509RootCert) require.Error(t, err) require.True(t, pkitypes.ErrInappropriateCertificateType.Is(err)) @@ -294,7 +295,7 @@ func TestHandler_ProposeAddX509RootCert_ProposedCertificateAlreadyExists(t *test setup := Setup(t) // propose adding of x509 root certificate - proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid) + proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, proposeAddX509RootCert) require.NoError(t, err) @@ -303,7 +304,7 @@ func TestHandler_ProposeAddX509RootCert_ProposedCertificateAlreadyExists(t *test setup.AddAccount(anotherAccount, []dclauthtypes.AccountRole{dclauthtypes.Trustee}, 1) // propose adding of the same x509 root certificate again - proposeAddX509RootCert = types.NewMsgProposeAddX509RootCert(anotherAccount.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid) + proposeAddX509RootCert = types.NewMsgProposeAddX509RootCert(anotherAccount.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid, testconstants.SchemaVersion) _, err = setup.Handler(setup.Ctx, proposeAddX509RootCert) require.Error(t, err) require.True(t, pkitypes.ErrProposedCertificateAlreadyExists.Is(err)) @@ -321,7 +322,7 @@ func TestHandler_ProposeAddX509RootCert_CertificateAlreadyExists(t *testing.T) { setup.Keeper.AddApprovedCertificate(setup.Ctx, rootCertificate) // propose adding of the same x509 root certificate - proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid) + proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, proposeAddX509RootCert) require.Error(t, err) require.True(t, pkitypes.ErrCertificateAlreadyExists.Is(err)) @@ -350,7 +351,7 @@ func TestHandler_ProposeAddX509RootCert_ForNocCertificate(t *testing.T) { setup.Keeper.SetUniqueCertificate(setup.Ctx, uniqueCertificate) // propose a new root certificate - proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid) + proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, proposeAddX509RootCert) require.True(t, pkitypes.ErrInappropriateCertificateType.Is(err)) } @@ -368,7 +369,7 @@ func TestHandler_ProposeAddX509RootCert_ForDifferentSerialNumber(t *testing.T) { setup.Keeper.AddApprovedCertificate(setup.Ctx, rootCertificate) // propose second root certificate - proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid) + proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, proposeAddX509RootCert) require.NoError(t, err) @@ -398,7 +399,7 @@ func TestHandler_ProposeAddX509RootCert_ForDifferentSerialNumberDifferentSigner( setup.Keeper.AddApprovedCertificate(setup.Ctx, rootCertificate) // propose second root certificate - proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid) + proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, proposeAddX509RootCert) require.Error(t, err) require.True(t, sdkerrors.ErrUnauthorized.Is(err)) @@ -412,7 +413,7 @@ func TestHandler_ApproveAddX509RootCert_ForNotEnoughApprovals(t *testing.T) { setup.AddAccount(nonTrustee, []dclauthtypes.AccountRole{dclauthtypes.Trustee}, 1) // propose x509 root certificate by account without trustee role - proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(nonTrustee.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid) + proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(nonTrustee.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, proposeAddX509RootCert) require.NoError(t, err) @@ -460,7 +461,7 @@ func TestHandler_TwoThirdApprovalsNeededForAddingRootCertification(t *testing.T) setup := Setup(t) // propose x509 root certificate by account without trustee role - proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid) + proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, proposeAddX509RootCert) require.NoError(t, err) @@ -513,7 +514,7 @@ func TestHandler_TwoThirdApprovalsNeededForRevokingRootCertification(t *testing. setup := Setup(t) // propose x509 root certificate by account without trustee role - proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid) + proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, proposeAddX509RootCert) require.NoError(t, err) @@ -594,8 +595,9 @@ func TestHandler_TwoThirdApprovalsNeededForRevokingRootCertification(t *testing. func TestHandler_ApproveAddX509RootCert_ForEnoughApprovals(t *testing.T) { setup := Setup(t) + var schemaVersion uint32 = 0 // propose add x509 root certificate by trustee - proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid) + proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid, schemaVersion) _, err := setup.Handler(setup.Ctx, proposeAddX509RootCert) require.NoError(t, err) @@ -617,6 +619,8 @@ func TestHandler_ApproveAddX509RootCert_ForEnoughApprovals(t *testing.T) { require.Equal(t, testconstants.RootSubject, approvedCertificate.Subject) require.Equal(t, testconstants.RootSubjectKeyID, approvedCertificate.SubjectKeyId) require.Equal(t, testconstants.RootSerialNumber, approvedCertificate.SerialNumber) + // Check that `schemaVersion` should be changed to 1 + require.Equal(t, schemaVersion+1, approvedCertificate.SchemaVersion) require.True(t, approvedCertificate.IsRoot) require.Empty(t, approvedCertificate.RootSubject) require.Empty(t, approvedCertificate.RootSubjectKeyId) @@ -643,7 +647,7 @@ func TestHandler_ApproveAddX509RootCert_ByNotTrustee(t *testing.T) { setup := Setup(t) // propose add x509 root certificate - proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid) + proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, proposeAddX509RootCert) require.NoError(t, err) @@ -672,7 +676,7 @@ func TestHandler_ApproveAddX509RootCert_Twice(t *testing.T) { setup.AddAccount(accAddress, []dclauthtypes.AccountRole{dclauthtypes.Trustee}, 1) // propose add x509 root certificate - proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(accAddress.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid) + proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(accAddress.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, proposeAddX509RootCert) require.NoError(t, err) @@ -841,7 +845,7 @@ func TestHandler_ProposeRevokeX509RootCert_ForProposedCertificate(t *testing.T) setup := Setup(t) // propose x509 root certificate - proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid) + proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, proposeAddX509RootCert) require.NoError(t, err) @@ -894,7 +898,7 @@ func TestHandler_ProposeRevokeX509RootCert_ForNonRootCertificate(t *testing.T) { setup.AddAccount(vendorAccAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, testconstants.Vid) // store x509 intermediate certificate - addX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateCertPem) + addX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateCertPem, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addX509Cert) require.NoError(t, err) @@ -1013,7 +1017,7 @@ func TestHandler_ApproveRevokeX509RootCert_BySerialNumber(t *testing.T) { setup.AddAccount(vendorAccAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, testconstants.Vid) // Add an intermediate certificate - addIntermediateX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateWithSameSubjectAndSKID1) + addIntermediateX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateWithSameSubjectAndSKID1, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addIntermediateX509Cert) require.NoError(t, err) @@ -1174,12 +1178,12 @@ func TestHandler_ApproveRevokeX509RootCert_ForTree(t *testing.T) { setup.AddAccount(vendorAccAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, testconstants.Vid) // add intermediate x509 certificate - addIntermediateX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateCertPem) + addIntermediateX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateCertPem, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addIntermediateX509Cert) require.NoError(t, err) // add leaf x509 certificate - addLeafX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.LeafCertPem) + addLeafX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.LeafCertPem, testconstants.SchemaVersion) _, err = setup.Handler(setup.Ctx, addLeafX509Cert) require.NoError(t, err) @@ -1292,7 +1296,7 @@ func TestHandler_RejectX509RootCert_TwoRejectApprovalsAreNeeded(t *testing.T) { setup := Setup(t) // propose x509 root certificate by account Trustee1 - proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid) + proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, proposeAddX509RootCert) require.NoError(t, err) @@ -1347,7 +1351,7 @@ func TestHandler_RejectX509RootCert_ByNotTrustee(t *testing.T) { setup := Setup(t) // propose add x509 root certificate - proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid) + proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, proposeAddX509RootCert) require.NoError(t, err) @@ -1372,7 +1376,7 @@ func TestHandler_Duplicate_RejectX509RootCert_FromTheSameTrustee(t *testing.T) { setup := Setup(t) // propose add x509 root certificate - proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid) + proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, proposeAddX509RootCert) require.NoError(t, err) @@ -1390,7 +1394,7 @@ func TestHandler_Duplicate_RejectX509RootCert_FromTheSameTrustee(t *testing.T) { func TestHandler_ApproveX509RootCertAndRejectX509RootCert_FromTheSameTrustee(t *testing.T) { setup := Setup(t) // propose add x509 root certificate - proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid) + proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, proposeAddX509RootCert) require.NoError(t, err) @@ -1423,7 +1427,7 @@ func TestHandler_ApproveX509RootCertAndRejectX509RootCert_FromTheSameTrustee(t * func TestHandler_RejectX509RootCertAndApproveX509RootCert_FromTheSameTrustee(t *testing.T) { setup := Setup(t) // propose add x509 root certificate - proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid) + proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, proposeAddX509RootCert) require.NoError(t, err) @@ -1457,7 +1461,7 @@ func TestHandler_DoubleTimeRejectX509RootCert(t *testing.T) { setup := Setup(t) // propose x509 root certificate by account Trustee1 - proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid) + proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, proposeAddX509RootCert) require.NoError(t, err) @@ -1508,7 +1512,7 @@ func TestHandler_DoubleTimeRejectX509RootCert(t *testing.T) { require.Equal(t, testconstants.Info, rejectedCertificate.Rejects[1].Info) // propose x509 root certificate by account Trustee1 - proposeAddX509RootCert = types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid) + proposeAddX509RootCert = types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid, testconstants.SchemaVersion) _, err = setup.Handler(setup.Ctx, proposeAddX509RootCert) require.NoError(t, err) @@ -1601,7 +1605,7 @@ func proposeAndApproveRootCertificate(setup *TestSetup, ownerTrustee sdk.AccAddr require.True(setup.T, setup.DclauthKeeper.HasRole(setup.Ctx, ownerTrustee, types.RootCertificateApprovalRole)) // propose x509 root certificate by `ownerTrustee` - proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(ownerTrustee.String(), options.pemCert, options.info, options.vid) + proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(ownerTrustee.String(), options.pemCert, options.info, options.vid, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, proposeAddX509RootCert) require.NoError(setup.T, err) @@ -1632,7 +1636,7 @@ func TestHandler_RejectX509RootCert_TwoRejectApprovalsAreNeeded_FiveTrustees(t * setup.AddAccount(fifthTrustee, []dclauthtypes.AccountRole{dclauthtypes.Trustee}, 1) // propose x509 root certificate by account Trustee1 - proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid) + proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, proposeAddX509RootCert) require.NoError(t, err) @@ -1683,7 +1687,7 @@ func TestHandler_ApproveX509RootCert_FourApprovalsAreNeeded_FiveTrustees(t *test setup.AddAccount(fifthTrustee, []dclauthtypes.AccountRole{dclauthtypes.Trustee}, 1) // propose x509 root certificate by account Trustee1 - proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid) + proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.RootCertPem, testconstants.Info, testconstants.Vid, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, proposeAddX509RootCert) require.NoError(t, err) @@ -1737,7 +1741,7 @@ func TestHandler_RevocationPointsByIssuerSubjectKeyID(t *testing.T) { setup.AddAccount(vendorAcc, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, 65521) // propose x509 root certificate by account Trustee1 - proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.PAACertWithNumericVid, testconstants.Info, testconstants.Vid) + proposeAddX509RootCert := types.NewMsgProposeAddX509RootCert(setup.Trustee1.String(), testconstants.PAACertWithNumericVid, testconstants.Info, testconstants.Vid, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, proposeAddX509RootCert) require.NoError(t, err) @@ -1865,7 +1869,7 @@ func TestHandler_AssignVid_ForNonRootCertificate(t *testing.T) { setup.AddAccount(vendorAccAddress, []dclauthtypes.AccountRole{dclauthtypes.Vendor}, testconstants.Vid) // add x509 intermediate certificate - addX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateCertPem) + addX509Cert := types.NewMsgAddX509Cert(vendorAccAddress.String(), testconstants.IntermediateCertPem, testconstants.SchemaVersion) _, err := setup.Handler(setup.Ctx, addX509Cert) require.NoError(t, err) @@ -2299,6 +2303,7 @@ func rootCertificate(address sdk.AccAddress) types.Certificate { []*types.Grant{}, []*types.Grant{}, testconstants.Vid, + testconstants.SchemaVersion, ) } @@ -2314,6 +2319,7 @@ func intermediateCertificate(address sdk.AccAddress) types.Certificate { testconstants.RootSubject, testconstants.RootSubjectKeyID, address.String(), + testconstants.SchemaVersion, ) } diff --git a/x/pki/handler_update_revocation_test.go b/x/pki/handler_update_revocation_test.go index 946403ac8..c362ab090 100644 --- a/x/pki/handler_update_revocation_test.go +++ b/x/pki/handler_update_revocation_test.go @@ -377,6 +377,7 @@ func TestHandler_UpdatePkiRevocationDistributionPoint_PAA_VID(t *testing.T) { Label: addedRevocation.Label, DataURL: addedRevocation.DataURL, IssuerSubjectKeyID: addedRevocation.IssuerSubjectKeyID, + SchemaVersion: 2, }, }, { @@ -386,6 +387,7 @@ func TestHandler_UpdatePkiRevocationDistributionPoint_PAA_VID(t *testing.T) { Vid: addedRevocation.Vid, Label: addedRevocation.Label, IssuerSubjectKeyID: addedRevocation.IssuerSubjectKeyID, + SchemaVersion: 2, }, }, { @@ -396,6 +398,7 @@ func TestHandler_UpdatePkiRevocationDistributionPoint_PAA_VID(t *testing.T) { Label: addedRevocation.Label, DataURL: addedRevocation.DataURL + "/new", IssuerSubjectKeyID: addedRevocation.IssuerSubjectKeyID, + SchemaVersion: 2, }, }, } @@ -424,6 +427,7 @@ func TestHandler_UpdatePkiRevocationDistributionPoint_PAA_VID(t *testing.T) { require.Equal(t, updatedPoint.Label, addedRevocation.Label) require.Equal(t, updatedPoint.IssuerSubjectKeyID, addedRevocation.IssuerSubjectKeyID) require.Equal(t, updatedPoint.RevocationType, addedRevocation.RevocationType) + require.Equal(t, updatedPoint.SchemaVersion, uint32(2)) compareUpdatedStringFields(t, addedRevocation.DataURL, tc.updatedRevocation.DataURL, updatedPoint.DataURL) compareUpdatedStringFields(t, addedRevocation.DataDigest, tc.updatedRevocation.DataDigest, updatedPoint.DataDigest) diff --git a/x/pki/keeper/msg_server_add_noc_x_509_cert.go b/x/pki/keeper/msg_server_add_noc_x_509_cert.go index 7eb9ae6d5..52d661dc8 100644 --- a/x/pki/keeper/msg_server_add_noc_x_509_cert.go +++ b/x/pki/keeper/msg_server_add_noc_x_509_cert.go @@ -6,6 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" pkitypes "github.com/zigbee-alliance/distributed-compliance-ledger/types/pki" + "github.com/zigbee-alliance/distributed-compliance-ledger/x/common" dclauthtypes "github.com/zigbee-alliance/distributed-compliance-ledger/x/dclauth/types" "github.com/zigbee-alliance/distributed-compliance-ledger/x/pki/types" "github.com/zigbee-alliance/distributed-compliance-ledger/x/pki/x509" @@ -98,6 +99,7 @@ func (k msgServer) AddNocX509Cert(goCtx context.Context, msg *types.MsgAddNocX50 rootCert.SubjectKeyID, msg.Signer, accountVid, + common.GetSchemaVersionOrDefault(msg), ) // Add a NOC certificate to the list of NOC certificates with the same VID diff --git a/x/pki/keeper/msg_server_add_noc_x_509_root_cert.go b/x/pki/keeper/msg_server_add_noc_x_509_root_cert.go index 813b22e83..f4ac3c022 100644 --- a/x/pki/keeper/msg_server_add_noc_x_509_root_cert.go +++ b/x/pki/keeper/msg_server_add_noc_x_509_root_cert.go @@ -5,6 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" pkitypes "github.com/zigbee-alliance/distributed-compliance-ledger/types/pki" + "github.com/zigbee-alliance/distributed-compliance-ledger/x/common" dclauthtypes "github.com/zigbee-alliance/distributed-compliance-ledger/x/dclauth/types" "github.com/zigbee-alliance/distributed-compliance-ledger/x/pki/types" "github.com/zigbee-alliance/distributed-compliance-ledger/x/pki/x509" @@ -81,6 +82,7 @@ func (k msgServer) AddNocX509RootCert(goCtx context.Context, msg *types.MsgAddNo x509Certificate.SerialNumber, msg.Signer, signerVid, + common.GetSchemaVersionOrDefault(msg), ) // Add a NOC root certificate to the list of NOC root certificates with the same VID diff --git a/x/pki/keeper/msg_server_add_pki_revocation_distribution_point.go b/x/pki/keeper/msg_server_add_pki_revocation_distribution_point.go index 52d7c365f..85f053cfc 100644 --- a/x/pki/keeper/msg_server_add_pki_revocation_distribution_point.go +++ b/x/pki/keeper/msg_server_add_pki_revocation_distribution_point.go @@ -4,9 +4,10 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" + pkitypes "github.com/zigbee-alliance/distributed-compliance-ledger/types/pki" + "github.com/zigbee-alliance/distributed-compliance-ledger/x/common" dclauthtypes "github.com/zigbee-alliance/distributed-compliance-ledger/x/dclauth/types" - "github.com/zigbee-alliance/distributed-compliance-ledger/x/pki/types" "github.com/zigbee-alliance/distributed-compliance-ledger/x/pki/x509" ) @@ -74,6 +75,7 @@ func (k msgServer) AddPkiRevocationDistributionPoint(goCtx context.Context, msg DataDigest: msg.DataDigest, DataDigestType: msg.DataDigestType, RevocationType: msg.RevocationType, + SchemaVersion: common.GetSchemaVersionOrDefault(msg), } k.SetPkiRevocationDistributionPoint(ctx, pkiRevocationDistributionPoint) diff --git a/x/pki/keeper/msg_server_add_x_509_cert.go b/x/pki/keeper/msg_server_add_x_509_cert.go index 08204c66e..ed6990a63 100644 --- a/x/pki/keeper/msg_server_add_x_509_cert.go +++ b/x/pki/keeper/msg_server_add_x_509_cert.go @@ -6,6 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" pkitypes "github.com/zigbee-alliance/distributed-compliance-ledger/types/pki" + "github.com/zigbee-alliance/distributed-compliance-ledger/x/common" dclauthtypes "github.com/zigbee-alliance/distributed-compliance-ledger/x/dclauth/types" "github.com/zigbee-alliance/distributed-compliance-ledger/x/pki/types" "github.com/zigbee-alliance/distributed-compliance-ledger/x/pki/x509" @@ -98,6 +99,7 @@ func (k msgServer) AddX509Cert(goCtx context.Context, msg *types.MsgAddX509Cert) rootCert.Subject, rootCert.SubjectKeyId, msg.Signer, + common.GetSchemaVersionOrDefault(msg), ) // append new certificate to list of certificates with the same Subject/SubjectKeyId combination and store updated list diff --git a/x/pki/keeper/msg_server_approve_add_x_509_root_cert.go b/x/pki/keeper/msg_server_approve_add_x_509_root_cert.go index 346bf8389..c844f85c6 100644 --- a/x/pki/keeper/msg_server_approve_add_x_509_root_cert.go +++ b/x/pki/keeper/msg_server_approve_add_x_509_root_cert.go @@ -72,6 +72,7 @@ func (k msgServer) ApproveAddX509RootCert(goCtx context.Context, msg *types.MsgA proposedCertificate.Approvals, proposedCertificate.Rejects, proposedCertificate.Vid, + proposedCertificate.SchemaVersion, ) // add approved certificate to stored list of certificates with the same Subject/SubjectKeyId combination diff --git a/x/pki/keeper/msg_server_propose_add_x_509_root_cert.go b/x/pki/keeper/msg_server_propose_add_x_509_root_cert.go index 1b4ec2b54..248401be7 100644 --- a/x/pki/keeper/msg_server_propose_add_x_509_root_cert.go +++ b/x/pki/keeper/msg_server_propose_add_x_509_root_cert.go @@ -6,6 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" pkitypes "github.com/zigbee-alliance/distributed-compliance-ledger/types/pki" + "github.com/zigbee-alliance/distributed-compliance-ledger/x/common" "github.com/zigbee-alliance/distributed-compliance-ledger/x/pki/types" "github.com/zigbee-alliance/distributed-compliance-ledger/x/pki/x509" ) @@ -94,6 +95,7 @@ func (k msgServer) ProposeAddX509RootCert(goCtx context.Context, msg *types.MsgP Owner: msg.Signer, Approvals: []*types.Grant{}, Vid: msg.Vid, + SchemaVersion: common.GetSchemaVersionOrDefault(msg), } proposedCertificate.Approvals = append(proposedCertificate.Approvals, &grant) diff --git a/x/pki/keeper/msg_server_update_pki_revocation_distribution_point.go b/x/pki/keeper/msg_server_update_pki_revocation_distribution_point.go index eb3bdcc1e..722bb6c4f 100644 --- a/x/pki/keeper/msg_server_update_pki_revocation_distribution_point.go +++ b/x/pki/keeper/msg_server_update_pki_revocation_distribution_point.go @@ -5,6 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" pkitypes "github.com/zigbee-alliance/distributed-compliance-ledger/types/pki" + "github.com/zigbee-alliance/distributed-compliance-ledger/x/common" dclauthtypes "github.com/zigbee-alliance/distributed-compliance-ledger/x/dclauth/types" "github.com/zigbee-alliance/distributed-compliance-ledger/x/pki/types" "github.com/zigbee-alliance/distributed-compliance-ledger/x/pki/x509" @@ -62,6 +63,8 @@ func (k msgServer) UpdatePkiRevocationDistributionPoint(goCtx context.Context, m pkiRevocationDistributionPoint.DataDigestType = msg.DataDigestType } + pkiRevocationDistributionPoint.SchemaVersion = common.GetSchemaVersionOrDefault(msg) + revocationList, isFound := k.GetPkiRevocationDistributionPointsByIssuerSubjectKeyID(ctx, msg.IssuerSubjectKeyID) if isFound { for _, revocationPoint := range revocationList.Points { diff --git a/x/pki/types/certificate.go b/x/pki/types/certificate.go index 2685aa849..7294c1bb3 100644 --- a/x/pki/types/certificate.go +++ b/x/pki/types/certificate.go @@ -1,7 +1,7 @@ package types func NewRootCertificate(pemCert string, subject string, subjectAsText string, subjectKeyID string, - serialNumber string, owner string, approvals []*Grant, rejects []*Grant, vid int32, + serialNumber string, owner string, approvals []*Grant, rejects []*Grant, vid int32, schemaVersion uint32, ) Certificate { return Certificate{ PemCert: pemCert, @@ -14,6 +14,7 @@ func NewRootCertificate(pemCert string, subject string, subjectAsText string, su Approvals: approvals, Rejects: rejects, Vid: vid, + SchemaVersion: schemaVersion, } } @@ -21,6 +22,7 @@ func NewNonRootCertificate(pemCert string, subject string, subjectAsText string, issuer string, authorityKeyID string, rootSubject string, rootSubjectKeyID string, owner string, + schemaVersion uint32, ) Certificate { return Certificate{ PemCert: pemCert, @@ -34,6 +36,7 @@ func NewNonRootCertificate(pemCert string, subject string, subjectAsText string, RootSubjectKeyId: rootSubjectKeyID, IsRoot: false, Owner: owner, + SchemaVersion: schemaVersion, } } @@ -45,6 +48,7 @@ func NewNocRootCertificate( serialNumber string, owner string, vid int32, + schemaVersion uint32, ) Certificate { return Certificate{ PemCert: pemCert, @@ -56,6 +60,7 @@ func NewNocRootCertificate( Owner: owner, Vid: vid, IsNoc: true, + SchemaVersion: schemaVersion, } } @@ -71,6 +76,7 @@ func NewNocCertificate( rootSubjectKeyID string, owner string, vid int32, + schemaVersion uint32, ) Certificate { return Certificate{ PemCert: pemCert, @@ -86,6 +92,7 @@ func NewNocCertificate( Owner: owner, IsRoot: false, IsNoc: true, + SchemaVersion: schemaVersion, } } diff --git a/x/pki/types/certificate.pb.go b/x/pki/types/certificate.pb.go index 8eb7c3462..f9611b06a 100644 --- a/x/pki/types/certificate.pb.go +++ b/x/pki/types/certificate.pb.go @@ -40,6 +40,7 @@ type Certificate struct { Rejects []*Grant `protobuf:"bytes,13,rep,name=rejects,proto3" json:"rejects,omitempty"` Vid int32 `protobuf:"varint,14,opt,name=vid,proto3" json:"vid,omitempty" validate:"gte=1,lte=65535"` IsNoc bool `protobuf:"varint,15,opt,name=isNoc,proto3" json:"isNoc,omitempty"` + SchemaVersion uint32 `protobuf:"varint,16,opt,name=schemaVersion,proto3" json:"schemaVersion,omitempty"` } func (m *Certificate) Reset() { *m = Certificate{} } @@ -180,6 +181,13 @@ func (m *Certificate) GetIsNoc() bool { return false } +func (m *Certificate) GetSchemaVersion() uint32 { + if m != nil { + return m.SchemaVersion + } + return 0 +} + func init() { proto.RegisterType((*Certificate)(nil), "zigbeealliance.distributedcomplianceledger.pki.Certificate") } @@ -187,38 +195,40 @@ func init() { func init() { proto.RegisterFile("pki/certificate.proto", fileDescriptor_2657e3d88fce7825) } var fileDescriptor_2657e3d88fce7825 = []byte{ - // 495 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x92, 0xcf, 0x8e, 0xd3, 0x3c, - 0x14, 0xc5, 0x9b, 0xaf, 0xd3, 0x76, 0xea, 0xce, 0x9f, 0x4f, 0x56, 0x41, 0xa6, 0x8b, 0x10, 0x55, - 0x08, 0x55, 0x88, 0x26, 0xc0, 0xa8, 0x2c, 0x90, 0x66, 0x31, 0x05, 0x09, 0x21, 0xa4, 0x41, 0x4a, - 0x59, 0xb1, 0x00, 0x39, 0xc9, 0x25, 0x63, 0x26, 0xa9, 0x23, 0xdb, 0x29, 0x53, 0x9e, 0x82, 0x87, - 0xe1, 0x21, 0x58, 0x8e, 0x58, 0xb1, 0x42, 0xa8, 0x7d, 0x03, 0x78, 0x01, 0x64, 0x3b, 0x55, 0x33, - 0xb0, 0x42, 0xec, 0x72, 0xce, 0xbd, 0xb9, 0xf7, 0xa7, 0x73, 0x8d, 0xae, 0x15, 0xe7, 0x2c, 0x88, - 0x41, 0x28, 0xf6, 0x96, 0xc5, 0x54, 0x81, 0x5f, 0x08, 0xae, 0x38, 0xf6, 0x3f, 0xb0, 0x34, 0x02, - 0xa0, 0x59, 0xc6, 0xe8, 0x3c, 0x06, 0x3f, 0x61, 0x52, 0x09, 0x16, 0x95, 0x0a, 0x92, 0x98, 0xe7, - 0x85, 0x75, 0x33, 0x48, 0x52, 0x10, 0x7e, 0x71, 0xce, 0x06, 0x37, 0x62, 0x2e, 0x73, 0x2e, 0xdf, - 0x98, 0xbf, 0x03, 0x2b, 0xec, 0xa8, 0x41, 0x3f, 0xe5, 0x29, 0xb7, 0xbe, 0xfe, 0xaa, 0xdc, 0x43, - 0xbd, 0x37, 0x15, 0x74, 0xae, 0xac, 0x31, 0xfc, 0xb9, 0x83, 0x7a, 0x8f, 0xb7, 0x1c, 0x98, 0xa0, - 0x4e, 0x01, 0xb9, 0x76, 0x88, 0xe3, 0x39, 0xa3, 0x6e, 0xb8, 0x91, 0x78, 0x88, 0xf6, 0x24, 0x08, - 0x46, 0xb3, 0xd3, 0x32, 0x8f, 0x40, 0x90, 0xff, 0x4c, 0xf9, 0x8a, 0x87, 0xaf, 0xa3, 0x36, 0x93, - 0xb2, 0x04, 0x41, 0x9a, 0xa6, 0x5a, 0x29, 0x7c, 0x1b, 0x1d, 0xd0, 0x52, 0x9d, 0x71, 0xc1, 0xd4, - 0xf2, 0x39, 0x2c, 0x9f, 0x25, 0x64, 0xc7, 0xd4, 0x7f, 0x73, 0xb1, 0x87, 0x7a, 0x82, 0x73, 0x35, - 0x2b, 0xa3, 0x77, 0x10, 0x2b, 0xd2, 0x32, 0x4d, 0x75, 0x0b, 0xdf, 0x41, 0xff, 0xd7, 0xa4, 0x9d, - 0xd5, 0x36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 0x6e, 0xe3, 0xeb, 0xda, 0x6d, 0xbc, 0x7a, 0x92, - 0x32, 0x75, 0x56, 0x46, 0x7e, 0xcc, 0xf3, 0xc0, 0xb2, 0x8e, 0x37, 0xb0, 0x41, 0x0d, 0x76, 0xbc, - 0xa5, 0x1d, 0x5b, 0xdc, 0xe0, 0x22, 0xd0, 0x6f, 0x5b, 0x2d, 0x0b, 0x90, 0x51, 0xdb, 0x3c, 0xee, - 0xa3, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x46, 0x06, 0x75, 0x03, 0x67, 0x03, 0x00, 0x00, + // 514 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0x41, 0x8b, 0xd3, 0x40, + 0x14, 0xc7, 0x1b, 0x6b, 0xdb, 0xed, 0x74, 0xbb, 0xbb, 0x0c, 0x55, 0xc6, 0x1e, 0x62, 0x28, 0x22, + 0x45, 0x6c, 0xa2, 0x2e, 0xf5, 0x20, 0xec, 0x61, 0xab, 0x20, 0x22, 0xac, 0x90, 0x8a, 0x07, 0x0f, + 0xca, 0x24, 0x79, 0xa6, 0xe3, 0x26, 0x9d, 0x30, 0x33, 0xa9, 0x5b, 0x3f, 0x85, 0x57, 0xbf, 0x87, + 0x1f, 0xc2, 0xe3, 0xe2, 0xc9, 0x93, 0x48, 0xfb, 0x0d, 0xfc, 0x04, 0x92, 0x99, 0x94, 0xa6, 0x7a, + 0x12, 0x6f, 0xf9, 0xff, 0xde, 0xcb, 0x7b, 0xff, 0xf7, 0x1e, 0x83, 0xae, 0x65, 0xe7, 0xcc, 0x0b, + 0x41, 0x28, 0xf6, 0x8e, 0x85, 0x54, 0x81, 0x9b, 0x09, 0xae, 0x38, 0x76, 0x3f, 0xb2, 0x38, 0x00, + 0xa0, 0x49, 0xc2, 0xe8, 0x3c, 0x04, 0x37, 0x62, 0x52, 0x09, 0x16, 0xe4, 0x0a, 0xa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0x0b, 0x50, 0xcb, 0x0c, 0x64, 0xd0, + 0xd4, 0x4f, 0xe0, 0xf8, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf7, 0xca, 0x87, 0x41, 0x8d, 0x03, + 0x00, 0x00, } func (m *Certificate) Marshal() (dAtA []byte, err error) { @@ -241,6 +251,13 @@ func (m *Certificate) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.SchemaVersion != 0 { + i = encodeVarintCertificate(dAtA, i, uint64(m.SchemaVersion)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x80 + } if m.IsNoc { i-- if m.IsNoc { @@ -445,6 +462,9 @@ func (m *Certificate) Size() (n int) { if m.IsNoc { n += 2 } + if m.SchemaVersion != 0 { + n += 2 + sovCertificate(uint64(m.SchemaVersion)) + } return n } @@ -930,6 +950,25 @@ func (m *Certificate) Unmarshal(dAtA []byte) error { } } m.IsNoc = bool(v != 0) + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SchemaVersion", wireType) + } + m.SchemaVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCertificate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SchemaVersion |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipCertificate(dAtA[iNdEx:]) diff --git a/x/pki/types/message_add_noc_x_509_cert.go b/x/pki/types/message_add_noc_x_509_cert.go index 17a3374b3..5f791c99e 100644 --- a/x/pki/types/message_add_noc_x_509_cert.go +++ b/x/pki/types/message_add_noc_x_509_cert.go @@ -12,10 +12,11 @@ const TypeMsgAddNocX509Cert = "add_noc_x_509_cert" var _ sdk.Msg = &MsgAddNocX509Cert{} -func NewMsgAddNocX509Cert(signer string, cert string) *MsgAddNocX509Cert { +func NewMsgAddNocX509Cert(signer string, cert string, schemaVersion uint32) *MsgAddNocX509Cert { return &MsgAddNocX509Cert{ - Signer: signer, - Cert: cert, + Signer: signer, + Cert: cert, + SchemaVersion: schemaVersion, } } diff --git a/x/pki/types/message_add_noc_x_509_root_cert.go b/x/pki/types/message_add_noc_x_509_root_cert.go index 8a274628c..45b88ed25 100644 --- a/x/pki/types/message_add_noc_x_509_root_cert.go +++ b/x/pki/types/message_add_noc_x_509_root_cert.go @@ -12,10 +12,11 @@ const TypeMsgAddNocX509RootCert = "add_noc_x_509_root_cert" var _ sdk.Msg = &MsgAddNocX509RootCert{} -func NewMsgAddNocX509RootCert(signer string, cert string) *MsgAddNocX509RootCert { +func NewMsgAddNocX509RootCert(signer string, cert string, schemaVersion uint32) *MsgAddNocX509RootCert { return &MsgAddNocX509RootCert{ - Signer: signer, - Cert: cert, + Signer: signer, + Cert: cert, + SchemaVersion: schemaVersion, } } diff --git a/x/pki/types/message_add_pki_revocation_distribution_point.go b/x/pki/types/message_add_pki_revocation_distribution_point.go index 04c0b96b0..00895f724 100644 --- a/x/pki/types/message_add_pki_revocation_distribution_point.go +++ b/x/pki/types/message_add_pki_revocation_distribution_point.go @@ -13,7 +13,9 @@ const TypeMsgAddPkiRevocationDistributionPoint = "add_pki_revocation_distributio var _ sdk.Msg = &MsgAddPkiRevocationDistributionPoint{} -func NewMsgAddPkiRevocationDistributionPoint(signer string, vid int32, pid int32, isPAA bool, label string, crlSignerCertificate string, issuerSubjectKeyID string, dataURL string, dataFileSize uint64, dataDigest string, dataDigestType uint32, revocationType uint32) *MsgAddPkiRevocationDistributionPoint { +func NewMsgAddPkiRevocationDistributionPoint(signer string, vid int32, pid int32, isPAA bool, label string, + crlSignerCertificate string, issuerSubjectKeyID string, dataURL string, dataFileSize uint64, dataDigest string, + dataDigestType uint32, revocationType uint32, schemaVersion uint32) *MsgAddPkiRevocationDistributionPoint { return &MsgAddPkiRevocationDistributionPoint{ Signer: signer, Vid: vid, @@ -27,6 +29,7 @@ func NewMsgAddPkiRevocationDistributionPoint(signer string, vid int32, pid int32 DataDigest: dataDigest, DataDigestType: dataDigestType, RevocationType: revocationType, + SchemaVersion: schemaVersion, } } diff --git a/x/pki/types/message_add_x_509_cert.go b/x/pki/types/message_add_x_509_cert.go index 15e50992d..6245ccb80 100644 --- a/x/pki/types/message_add_x_509_cert.go +++ b/x/pki/types/message_add_x_509_cert.go @@ -11,10 +11,11 @@ const TypeMsgAddX509Cert = "add_x_509_cert" var _ sdk.Msg = &MsgAddX509Cert{} -func NewMsgAddX509Cert(signer string, cert string) *MsgAddX509Cert { +func NewMsgAddX509Cert(signer string, cert string, schemaVersion uint32) *MsgAddX509Cert { return &MsgAddX509Cert{ - Signer: signer, - Cert: cert, + Signer: signer, + Cert: cert, + SchemaVersion: schemaVersion, } } diff --git a/x/pki/types/message_propose_add_x_509_root_cert.go b/x/pki/types/message_propose_add_x_509_root_cert.go index bf47ebcdc..dae0e8060 100644 --- a/x/pki/types/message_propose_add_x_509_root_cert.go +++ b/x/pki/types/message_propose_add_x_509_root_cert.go @@ -15,13 +15,14 @@ const TypeMsgProposeAddX509RootCert = "propose_add_x_509_root_cert" var _ sdk.Msg = &MsgProposeAddX509RootCert{} -func NewMsgProposeAddX509RootCert(signer string, cert string, info string, vid int32) *MsgProposeAddX509RootCert { +func NewMsgProposeAddX509RootCert(signer string, cert string, info string, vid int32, schemaVersion uint32) *MsgProposeAddX509RootCert { return &MsgProposeAddX509RootCert{ - Signer: signer, - Cert: cert, - Info: info, - Time: time.Now().Unix(), - Vid: vid, + Signer: signer, + Cert: cert, + Info: info, + Time: time.Now().Unix(), + Vid: vid, + SchemaVersion: schemaVersion, } } diff --git a/x/pki/types/message_update_pki_revocation_distribution_point.go b/x/pki/types/message_update_pki_revocation_distribution_point.go index d4ce72aaa..1b868ae31 100644 --- a/x/pki/types/message_update_pki_revocation_distribution_point.go +++ b/x/pki/types/message_update_pki_revocation_distribution_point.go @@ -12,7 +12,8 @@ const TypeMsgUpdatePkiRevocationDistributionPoint = "update_pki_revocation_distr var _ sdk.Msg = &MsgUpdatePkiRevocationDistributionPoint{} -func NewMsgUpdatePkiRevocationDistributionPoint(signer string, vid int32, label string, crlSignerCertificate string, issuerSubjectKeyID string, dataURL string, dataFileSize uint64, dataDigest string, dataDigestType uint32) *MsgUpdatePkiRevocationDistributionPoint { +func NewMsgUpdatePkiRevocationDistributionPoint(signer string, vid int32, label string, crlSignerCertificate string, + issuerSubjectKeyID string, dataURL string, dataFileSize uint64, dataDigest string, dataDigestType uint32, schemaVersion uint32) *MsgUpdatePkiRevocationDistributionPoint { return &MsgUpdatePkiRevocationDistributionPoint{ Signer: signer, Vid: vid, @@ -23,6 +24,7 @@ func NewMsgUpdatePkiRevocationDistributionPoint(signer string, vid int32, label DataFileSize: dataFileSize, DataDigest: dataDigest, DataDigestType: dataDigestType, + SchemaVersion: schemaVersion, } } diff --git a/x/pki/types/pki_revocation_distribution_point.pb.go b/x/pki/types/pki_revocation_distribution_point.pb.go index 746912638..1b6bc47f7 100644 --- a/x/pki/types/pki_revocation_distribution_point.pb.go +++ b/x/pki/types/pki_revocation_distribution_point.pb.go @@ -34,6 +34,7 @@ type PkiRevocationDistributionPoint struct { DataDigest string `protobuf:"bytes,9,opt,name=dataDigest,proto3" json:"dataDigest,omitempty"` DataDigestType uint32 `protobuf:"varint,10,opt,name=dataDigestType,proto3" json:"dataDigestType,omitempty"` RevocationType uint32 `protobuf:"varint,11,opt,name=revocationType,proto3" json:"revocationType,omitempty"` + SchemaVersion uint32 `protobuf:"varint,12,opt,name=schemaVersion,proto3" json:"schemaVersion,omitempty"` } func (m *PkiRevocationDistributionPoint) Reset() { *m = PkiRevocationDistributionPoint{} } @@ -146,6 +147,13 @@ func (m *PkiRevocationDistributionPoint) GetRevocationType() uint32 { return 0 } +func (m *PkiRevocationDistributionPoint) GetSchemaVersion() uint32 { + if m != nil { + return m.SchemaVersion + } + return 0 +} + func init() { proto.RegisterType((*PkiRevocationDistributionPoint)(nil), "zigbeealliance.distributedcomplianceledger.pki.PkiRevocationDistributionPoint") } @@ -155,31 +163,32 @@ func init() { } var fileDescriptor_35504fa19b856908 = []byte{ - // 374 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xbb, 0x8a, 0xdb, 0x40, - 0x14, 0x86, 0x3d, 0xf1, 0x7d, 0x72, 0x21, 0x0c, 0x2e, 0xa6, 0x1a, 0x84, 0x8b, 0x20, 0x08, 0x96, - 0x20, 0x79, 0x02, 0x27, 0x22, 0x10, 0x92, 0xc2, 0xc8, 0x49, 0x93, 0x22, 0x46, 0x97, 0x13, 0xe5, - 0xac, 0x64, 0x69, 0x18, 0x8d, 0xcc, 0xda, 0xe5, 0x3e, 0xc1, 0x3e, 0xd6, 0x96, 0x2e, 0xb7, 0x5c, - 0xec, 0x17, 0x59, 0xa4, 0xc1, 0xb7, 0xc5, 0xdd, 0xfc, 0xff, 0xfc, 0x7c, 0xcd, 0x77, 0xe8, 0x47, - 0x99, 0xa2, 0x2b, 0x53, 0x5c, 0x28, 0x58, 0x15, 0x51, 0xa0, 0xb1, 0xc8, 0x17, 0x31, 0x96, 0x5a, - 0x61, 0x58, 0x35, 0x41, 0x16, 0x98, 0x6b, 0x47, 0xaa, 0x42, 0x17, 0xcc, 0xd9, 0x60, 0x12, 0x02, - 0x04, 0x59, 0x86, 0x41, 0x1e, 0x81, 0x73, 0x1c, 0x42, 0x1c, 0x15, 0x4b, 0x69, 0xda, 0x0c, 0xe2, - 0x04, 0x94, 0x23, 0x53, 0x1c, 0xdf, 0xb5, 0xa9, 0x98, 0xa5, 0xe8, 0x1f, 0xd1, 0xde, 0x19, 0x79, - 0x56, 0x83, 0xd9, 0x7b, 0xda, 0x5e, 0x61, 0xcc, 0x89, 0x45, 0xec, 0xae, 0x5f, 0x3f, 0xd9, 0x88, - 0x76, 0xb3, 0x20, 0x84, 0x8c, 0xbf, 0xb2, 0x88, 0x3d, 0xf4, 0x4d, 0x60, 0x0e, 0x65, 0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28, 0xc3, 0x5e, 0x73, 0x1b, 0x9f, 0x9f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xed, 0x64, - 0x00, 0x15, 0x4a, 0x02, 0x00, 0x00, + // 396 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xcd, 0x6e, 0x13, 0x31, + 0x14, 0x85, 0x63, 0xd2, 0xf4, 0xc7, 0xb4, 0x08, 0x59, 0x5d, 0x78, 0x65, 0x8d, 0x2a, 0x84, 0x46, + 0x42, 0x99, 0x91, 0xe0, 0x09, 0x0a, 0x11, 0x12, 0x82, 0x45, 0x34, 0x01, 0x16, 0x2c, 0xa8, 0x3c, + 0x9e, 0xcb, 0xf4, 0x92, 0xc9, 0xd8, 0xb2, 0x3d, 0x15, 0xe9, 0x53, 0xf0, 0x18, 0x3c, 0x0a, 0xcb, + 0x2e, 0x59, 0xa2, 0xe4, 0x45, 0xd0, 0xd8, 0x6a, 0x93, 0xa0, 0xec, 0x7c, 0x8e, 0x3f, 0x7d, 0x9b, + 0x7b, 0xe8, 0x0b, 0x33, 0xc7, 0xdc, 0xcc, 0xf1, 0xca, 0xc2, 0x8d, 0x56, 0xd2, 0xa3, 0x6e, 0xaf, + 0x2a, 0x74, 0xde, 0x62, 0xd9, 0x85, 0x60, 0x34, 0xb6, 0x3e, 0x33, 0x56, 0x7b, 0xcd, 0xb2, 0x5b, + 0xac, 0x4b, 0x00, 0xd9, 0x34, 0x28, 0x5b, 0x05, 0xd9, 0x03, 0x08, 0x95, 0xd2, 0x0b, 0x13, 0xdb, + 0x06, 0xaa, 0x1a, 0x6c, 0x66, 0xe6, 0x78, 0xf1, 0x6b, 0x48, 0xc5, 0x74, 0x8e, 0xc5, 0x83, 0x7a, + 0xb2, 0x65, 0x9e, 0xf6, 0x62, 0xf6, 0x94, 0x0e, 0x6f, 0xb0, 0xe2, 0x24, 0x21, 0xe9, 0xa8, 0x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3f, 0x6b, 0x31, 0xf8, 0x32, 0xa9, 0xd1, 0x5f, 0x77, 0x65, 0xa6, + 0xf4, 0x22, 0x8f, 0xf7, 0x1f, 0xdf, 0x0f, 0x20, 0xdf, 0x1a, 0xc0, 0x78, 0xb3, 0x80, 0x71, 0x9c, + 0x40, 0xfe, 0xa3, 0x1f, 0x56, 0xee, 0x97, 0x06, 0x5c, 0x79, 0x18, 0x16, 0xf4, 0xea, 0x5f, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xb4, 0x5c, 0x42, 0x90, 0x70, 0x02, 0x00, 0x00, } func (m *PkiRevocationDistributionPoint) Marshal() (dAtA []byte, err error) { @@ -202,6 +211,11 @@ func (m *PkiRevocationDistributionPoint) MarshalToSizedBuffer(dAtA []byte) (int, _ = i var l int _ = l + if m.SchemaVersion != 0 { + i = encodeVarintPkiRevocationDistributionPoint(dAtA, i, uint64(m.SchemaVersion)) + i-- + dAtA[i] = 0x60 + } if m.RevocationType != 0 { i = encodeVarintPkiRevocationDistributionPoint(dAtA, i, uint64(m.RevocationType)) i-- @@ -330,6 +344,9 @@ func (m *PkiRevocationDistributionPoint) Size() (n int) { if m.RevocationType != 0 { n += 1 + sovPkiRevocationDistributionPoint(uint64(m.RevocationType)) } + if m.SchemaVersion != 0 { + n += 1 + sovPkiRevocationDistributionPoint(uint64(m.SchemaVersion)) + } return n } @@ -643,6 +660,25 @@ func (m *PkiRevocationDistributionPoint) Unmarshal(dAtA []byte) error { break } } + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SchemaVersion", wireType) + } + m.SchemaVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPkiRevocationDistributionPoint + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SchemaVersion |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipPkiRevocationDistributionPoint(dAtA[iNdEx:]) diff --git a/x/pki/types/proposed_certificate.pb.go b/x/pki/types/proposed_certificate.pb.go index de2e71851..bca63e787 100644 --- a/x/pki/types/proposed_certificate.pb.go +++ b/x/pki/types/proposed_certificate.pb.go @@ -34,6 +34,7 @@ type ProposedCertificate struct { SubjectAsText string `protobuf:"bytes,7,opt,name=subjectAsText,proto3" json:"subjectAsText,omitempty"` Rejects []*Grant `protobuf:"bytes,8,rep,name=rejects,proto3" json:"rejects,omitempty"` Vid int32 `protobuf:"varint,9,opt,name=vid,proto3" json:"vid,omitempty" validate:"gte=1,lte=65535"` + SchemaVersion uint32 `protobuf:"varint,10,opt,name=schemaVersion,proto3" json:"schemaVersion,omitempty"` } func (m *ProposedCertificate) Reset() { *m = ProposedCertificate{} } @@ -132,6 +133,13 @@ func (m *ProposedCertificate) GetVid() int32 { return 0 } +func (m *ProposedCertificate) GetSchemaVersion() uint32 { + if m != nil { + return m.SchemaVersion + } + return 0 +} + func init() { proto.RegisterType((*ProposedCertificate)(nil), "zigbeealliance.distributedcomplianceledger.pki.ProposedCertificate") } @@ -139,34 +147,35 @@ func init() { func init() { proto.RegisterFile("pki/proposed_certificate.proto", fileDescriptor_589d443e04a789ec) } var fileDescriptor_589d443e04a789ec = []byte{ - // 424 bytes of a gzipped FileDescriptorProto + // 442 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x92, 0xb1, 0x6e, 0x13, 0x31, - 0x1c, 0xc6, 0x73, 0x84, 0x34, 0xc4, 0x80, 0x90, 0x4c, 0x07, 0x93, 0xc1, 0x44, 0x11, 0x43, 0x06, - 0x72, 0x07, 0x54, 0xc7, 0x80, 0xd4, 0xa1, 0x01, 0x09, 0x21, 0x24, 0x40, 0x57, 0x26, 0x06, 0x2a, - 0xdf, 0xf9, 0x8f, 0x31, 0xbd, 0x3b, 0x5b, 0xb6, 0x2f, 0xb4, 0x3c, 0x05, 0x0f, 0xc3, 0xce,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, 0x84, 0x34, 0xc4, 0x50, 0x21, 0x1d, 0x1d, 0x4c, 0x06, 0x13, 0x45, 0x0c, 0x19, + 0xc8, 0x1d, 0x50, 0x85, 0x01, 0xa9, 0x43, 0x03, 0x12, 0x42, 0x48, 0x80, 0xae, 0x88, 0x81, 0x81, + 0xca, 0x67, 0x7f, 0xb8, 0xa6, 0x77, 0x67, 0xcb, 0xf6, 0x85, 0x96, 0xa7, 0xe0, 0x61, 0x78, 0x08, + 0xc6, 0x8a, 0x89, 0x09, 0xa1, 0x44, 0xbc, 0x00, 0x4f, 0x80, 0x7c, 0xbe, 0x28, 0xcd, 0x88, 0xd8, + 0xfc, 0xfd, 0xec, 0xff, 0xe7, 0x9f, 0xad, 0x0f, 0x11, 0x7d, 0x2a, 0x53, 0x6d, 0x94, 0x56, 0x16, + 0xf8, 0x31, 0x03, 0xe3, 0xe4, 0x07, 0xc9, 0xa8, 0x83, 0x44, 0x1b, 0xe5, 0x54, 0x9c, 0x7c, 0x96, + 0x22, 0x07, 0xa0, 0x45, 0x21, 0x69, 0xc5, 0x20, 0xe1, 0xd2, 0x3a, 0x23, 0xf3, 0xda, 0x01, 0x67, + 0xaa, 0xd4, 0x81, 0x16, 0xc0, 0x05, 0x98, 0x44, 0x9f, 0xca, 0xe1, 0x6d, 0xa6, 0x6c, 0xa9, 0xec, + 0x71, 0x93, 0x4e, 0x43, 0x11, 0x5a, 0x0d, 0xf7, 0x84, 0x12, 0x2a, 0x70, 0xbf, 0x6a, 0xe9, 0x4d, + 0x2f, 0x20, 0x0c, 0xad, 0x5c, 0x00, 0xe3, 0xdf, 0x5d, 0x74, 0xeb, 0x75, 0x2b, 0xf4, 0x64, 0xe3, + 0x13, 0x63, 0xd4, 0xb7, 0x75, 0xfe, 0x11, 0x98, 0xc3, 0xd1, 0x28, 0x9a, 0x0c, 0xb2, 0x75, 0x19, + 0x8f, 0xd1, 0x8d, 0x76, 0xf9, 0x02, 0xce, 0x9f, 0x73, 0x7c, 0xa5, 0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0x91, 0xce, 0xc5, 0x8a, 0x74, 0x7e, 0xac, 0x48, 0xe7, 0xdd, 0x53, 0x21, 0xdd, 0x49, 0x9d, 0x27, + 0x4c, 0x95, 0x69, 0x70, 0x9f, 0xae, 0xe5, 0xd3, 0x4b, 0xf2, 0xd3, 0x8d, 0xfd, 0x34, 0xe8, 0xa7, + 0x67, 0xa9, 0x9f, 0x26, 0x77, 0xae, 0xc1, 0xe6, 0x3b, 0xcd, 0x38, 0xed, 0xff, 0x0d, 0x00, 0x00, + 0xff, 0xff, 0x63, 0xc6, 0x7a, 0x93, 0xe2, 0x02, 0x00, 0x00, } func (m *ProposedCertificate) Marshal() (dAtA []byte, err error) { @@ -189,6 +198,11 @@ func (m *ProposedCertificate) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.SchemaVersion != 0 { + i = encodeVarintProposedCertificate(dAtA, i, uint64(m.SchemaVersion)) + i-- + dAtA[i] = 0x50 + } if m.Vid != 0 { i = encodeVarintProposedCertificate(dAtA, i, uint64(m.Vid)) i-- @@ -323,6 +337,9 @@ func (m *ProposedCertificate) Size() (n int) { if m.Vid != 0 { n += 1 + sovProposedCertificate(uint64(m.Vid)) } + if m.SchemaVersion != 0 { + n += 1 + sovProposedCertificate(uint64(m.SchemaVersion)) + } return n } @@ -640,6 +657,25 @@ func (m *ProposedCertificate) Unmarshal(dAtA []byte) error { break } } + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SchemaVersion", wireType) + } + m.SchemaVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposedCertificate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SchemaVersion |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipProposedCertificate(dAtA[iNdEx:]) diff --git a/x/pki/types/tx.pb.go b/x/pki/types/tx.pb.go index 086435ce5..7c73e0c28 100644 --- a/x/pki/types/tx.pb.go +++ b/x/pki/types/tx.pb.go @@ -30,11 +30,12 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type MsgProposeAddX509RootCert struct { - Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty" validate:"required"` - Cert string `protobuf:"bytes,2,opt,name=cert,proto3" json:"cert,omitempty" validate:"required,max=10485760"` - Info string `protobuf:"bytes,3,opt,name=info,proto3" json:"info,omitempty" validate:"max=4096"` - Time int64 `protobuf:"varint,4,opt,name=time,proto3" json:"time,omitempty"` - Vid int32 `protobuf:"varint,5,opt,name=vid,proto3" json:"vid,omitempty" validate:"gte=1,lte=65535,required"` + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty" validate:"required"` + Cert string `protobuf:"bytes,2,opt,name=cert,proto3" json:"cert,omitempty" validate:"required,max=10485760"` + Info string `protobuf:"bytes,3,opt,name=info,proto3" json:"info,omitempty" validate:"max=4096"` + Time int64 `protobuf:"varint,4,opt,name=time,proto3" json:"time,omitempty"` + Vid int32 `protobuf:"varint,5,opt,name=vid,proto3" json:"vid,omitempty" validate:"gte=1,lte=65535,required"` + SchemaVersion uint32 `protobuf:"varint,6,opt,name=schemaVersion,proto3" json:"schemaVersion,omitempty"` } func (m *MsgProposeAddX509RootCert) Reset() { *m = MsgProposeAddX509RootCert{} } @@ -105,6 +106,13 @@ func (m *MsgProposeAddX509RootCert) GetVid() int32 { return 0 } +func (m *MsgProposeAddX509RootCert) GetSchemaVersion() uint32 { + if m != nil { + return m.SchemaVersion + } + return 0 +} + type MsgProposeAddX509RootCertResponse struct { } @@ -254,10 +262,11 @@ func (m *MsgApproveAddX509RootCertResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgApproveAddX509RootCertResponse proto.InternalMessageInfo type MsgAddX509Cert struct { - Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty" validate:"required"` - Cert string `protobuf:"bytes,2,opt,name=cert,proto3" json:"cert,omitempty" validate:"required,max=10485760"` - Info string `protobuf:"bytes,3,opt,name=info,proto3" json:"info,omitempty" validate:"max=4096"` - Time int64 `protobuf:"varint,4,opt,name=time,proto3" json:"time,omitempty"` + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty" validate:"required"` + Cert string `protobuf:"bytes,2,opt,name=cert,proto3" json:"cert,omitempty" validate:"required,max=10485760"` + Info string `protobuf:"bytes,3,opt,name=info,proto3" json:"info,omitempty" validate:"max=4096"` + Time int64 `protobuf:"varint,4,opt,name=time,proto3" json:"time,omitempty"` + SchemaVersion uint32 `protobuf:"varint,5,opt,name=schemaVersion,proto3" json:"schemaVersion,omitempty"` } func (m *MsgAddX509Cert) Reset() { *m = MsgAddX509Cert{} } @@ -321,6 +330,13 @@ func (m *MsgAddX509Cert) GetTime() int64 { return 0 } +func (m *MsgAddX509Cert) GetSchemaVersion() uint32 { + if m != nil { + return m.SchemaVersion + } + return 0 +} + type MsgAddX509CertResponse struct { } @@ -858,6 +874,7 @@ type MsgAddPkiRevocationDistributionPoint struct { DataDigest string `protobuf:"bytes,10,opt,name=dataDigest,proto3" json:"dataDigest,omitempty"` DataDigestType uint32 `protobuf:"varint,11,opt,name=dataDigestType,proto3" json:"dataDigestType,omitempty"` RevocationType uint32 `protobuf:"varint,12,opt,name=revocationType,proto3" json:"revocationType,omitempty" validate:"required"` + SchemaVersion uint32 `protobuf:"varint,13,opt,name=schemaVersion,proto3" json:"schemaVersion,omitempty"` } func (m *MsgAddPkiRevocationDistributionPoint) Reset() { *m = MsgAddPkiRevocationDistributionPoint{} } @@ -977,6 +994,13 @@ func (m *MsgAddPkiRevocationDistributionPoint) GetRevocationType() uint32 { return 0 } +func (m *MsgAddPkiRevocationDistributionPoint) GetSchemaVersion() uint32 { + if m != nil { + return m.SchemaVersion + } + return 0 +} + type MsgAddPkiRevocationDistributionPointResponse struct { } @@ -1027,6 +1051,7 @@ type MsgUpdatePkiRevocationDistributionPoint struct { DataFileSize uint64 `protobuf:"varint,7,opt,name=dataFileSize,proto3" json:"dataFileSize,omitempty"` DataDigest string `protobuf:"bytes,8,opt,name=dataDigest,proto3" json:"dataDigest,omitempty"` DataDigestType uint32 `protobuf:"varint,9,opt,name=dataDigestType,proto3" json:"dataDigestType,omitempty"` + SchemaVersion uint32 `protobuf:"varint,10,opt,name=schemaVersion,proto3" json:"schemaVersion,omitempty"` } func (m *MsgUpdatePkiRevocationDistributionPoint) Reset() { @@ -1127,6 +1152,13 @@ func (m *MsgUpdatePkiRevocationDistributionPoint) GetDataDigestType() uint32 { return 0 } +func (m *MsgUpdatePkiRevocationDistributionPoint) GetSchemaVersion() uint32 { + if m != nil { + return m.SchemaVersion + } + return 0 +} + type MsgUpdatePkiRevocationDistributionPointResponse struct { } @@ -1382,8 +1414,9 @@ func (m *MsgAssignVidResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgAssignVidResponse proto.InternalMessageInfo type MsgAddNocX509RootCert struct { - Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty" validate:"required"` - Cert string `protobuf:"bytes,2,opt,name=cert,proto3" json:"cert,omitempty" validate:"required,max=10485760"` + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty" validate:"required"` + Cert string `protobuf:"bytes,2,opt,name=cert,proto3" json:"cert,omitempty" validate:"required,max=10485760"` + SchemaVersion uint32 `protobuf:"varint,3,opt,name=schemaVersion,proto3" json:"schemaVersion,omitempty"` } func (m *MsgAddNocX509RootCert) Reset() { *m = MsgAddNocX509RootCert{} } @@ -1433,6 +1466,13 @@ func (m *MsgAddNocX509RootCert) GetCert() string { return "" } +func (m *MsgAddNocX509RootCert) GetSchemaVersion() uint32 { + if m != nil { + return m.SchemaVersion + } + return 0 +} + type MsgAddNocX509RootCertResponse struct { } @@ -1574,8 +1614,9 @@ func (m *MsgRemoveX509CertResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgRemoveX509CertResponse proto.InternalMessageInfo type MsgAddNocX509Cert struct { - Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty" validate:"required"` - Cert string `protobuf:"bytes,2,opt,name=cert,proto3" json:"cert,omitempty" validate:"required,max=10485760"` + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty" validate:"required"` + Cert string `protobuf:"bytes,2,opt,name=cert,proto3" json:"cert,omitempty" validate:"required,max=10485760"` + SchemaVersion uint32 `protobuf:"varint,3,opt,name=schemaVersion,proto3" json:"schemaVersion,omitempty"` } func (m *MsgAddNocX509Cert) Reset() { *m = MsgAddNocX509Cert{} } @@ -1625,6 +1666,13 @@ func (m *MsgAddNocX509Cert) GetCert() string { return "" } +func (m *MsgAddNocX509Cert) GetSchemaVersion() uint32 { + if m != nil { + return m.SchemaVersion + } + return 0 +} + type MsgAddNocX509CertResponse struct { } @@ -1955,95 +2003,97 @@ func init() { func init() { proto.RegisterFile("pki/tx.proto", fileDescriptor_badfdb2b39855d16) } var fileDescriptor_badfdb2b39855d16 = []byte{ - // 1397 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x5a, 0xdd, 0x6f, 0xdb, 0x54, - 0x14, 0x9f, 0xf3, 0xd1, 0x8f, 0xb3, 0x52, 0x69, 0x97, 0xae, 0xf3, 0xbc, 0x91, 0x64, 0xde, 0xb4, - 0x45, 0xa2, 0x4d, 0xb2, 0x6e, 0x29, 0xdb, 0xc4, 0x40, 0xe9, 0xc2, 0x3e, 0xb4, 0xb6, 0x2a, 0x6e, - 0x07, 0x08, 0x21, 0xa6, 0x24, 0xbe, 0xf3, 0x2e, 0x75, 0x62, 0x63, 0x3b, 0x55, 0xbb, 0x37, 0xfe, - 0x02, 0x90, 0x10, 0x3c, 0x0c, 0x89, 0x37, 0x40, 0xe2, 0x15, 0xc4, 0x2b, 0xaf, 0xbc, 0x20, 0x4d, - 0x08, 0x09,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44, 0xb4, - 0xd8, 0xf4, 0xe7, 0x89, 0xb2, 0xf9, 0x3b, 0x03, 0x93, 0xe6, 0x2c, 0xfb, 0xe7, 0x83, 0x22, 0x42, - 0x9e, 0x85, 0x69, 0x6f, 0x54, 0x34, 0xe0, 0x7f, 0x22, 0x70, 0xda, 0x15, 0x99, 0x80, 0x37, 0x94, - 0x75, 0x7c, 0xa8, 0x20, 0x5f, 0x05, 0x21, 0x1e, 0x26, 0x74, 0xac, 0x91, 0x92, 0xbc, 0x5c, 0xaf, - 0x96, 0xb1, 0xc6, 0x8e, 0x98, 0x40, 0x82, 0x67, 0x0c, 0xa5, 0xe0, 0xa8, 0x66, 0x91, 0x78, 0xe3, - 0x21, 0x91, 0x45, 0x76, 0x34, 0xc5, 0xa4, 0xc7, 0x84, 0xf6, 0x21, 0xfe, 0x3c, 0x9c, 0xeb, 0x46, - 0x38, 0xcd, 0xcc, 0xaf, 0x76, 0x66, 0x5a, 0x82, 0x7d, 0x21, 0x32, 0x13, 0xef, 0x27, 0x33, 0x23, - 0x5d, 0x32, 0x33, 0xba, 0x3b, 0x33, 0x2d, 0xde, 0x03, 0xe9, 0xa4, 0xbc, 0xff, 0x15, 0x81, 0x63, - 0x4b, 0xba, 0xe4, 0xce, 0x38, 0xfc, 0x0c, 0xf6, 0xe3, 0x33, 0x38, 0x65, 0x1d, 0x5b, 0x5e, 0x96, - 0x69, 0x0e, 0xbe, 0x89, 0x00, 0x6b, 0xfd, 0x6a, 0xba, 0x7d, 0x78, 0xa6, 0x05, 0x9e, 0x69, 0x3c, - 0xa4, 0x82, 0x68, 0xa2, 0x5c, 0x7e, 0x15, 0xb7, 0x85, 0x2f, 0x8a, 0x2b, 0xeb, 0xc4, 0xe4, 0xbb, - 0x52, 0x32, 0x88, 0x52, 0x2b, 0x3a, 0x57, 0x39, 0xa2, 0xd4, 0x56, 0x14, 0x52, 0x1b, 0x22, 0xaf, - 0xad, 0x2b, 0x4f, 0xa4, 0xff, 0x2b, 0x0f,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0x72, 0xd6, 0x5d, 0x73, 0xd6, 0x5e, 0x34, 0xbb, 0x99, 0xb5, 0xfe, 0xcf, 0xb2, 0xa5, 0x62, - 0xbd, 0x3c, 0x62, 0xfd, 0xe5, 0xe4, 0xd2, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xe5, 0xfe, 0x7a, - 0xee, 0xe3, 0x22, 0x00, 0x00, + // 1439 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x5a, 0xcd, 0x6f, 0x1b, 0x45, + 0x14, 0xef, 0xfa, 0x23, 0x1f, 0xaf, 0x69, 0xa4, 0x0e, 0x69, 0xba, 0x75, 0x8b, 0xed, 0x6e, 0xa3, + 0x36, 0x12, 0x89, 0x9d, 0xa6, 0x75, 0x68, 0x2b, 0x0a, 0x72, 0x6a, 0xfa, 0xa1, 0x26, 0x55, 0xd8, + 0xb4, 0x05, 0x21, 0x44, 0x65, 0xef, 0x4e, 0xb7, 0x43, 0xd6, 0xde, 0x65, 0x77, 0x1d, 0x35, 0xbd, + 0xf1, 0x17, 0x80, 0x84, 0xb8, 0x72, 0x41, 0x80, 0xc4, 0x15, 0xc4, 0x09, 0x89, 0x72, 0xe3, 0x82, + 0x54, 0x71, 0x81, 0x93, 0x55, 0x35, 0x48, 0x1c, 0x7a, 0x40, 0xf2, 0x91, 0x13, 0xda, 0x59, 0xef, + 0xac, 0xd7, 0xde, 0x4d, 0xec, 0x8d, 0x23, 0xd1, 0x34, 0xb7, 0xdd, 0xc9, 0xbc, 0xdf, 0xbc, 0xf7, + 0x7b, 0xbf, 0x99, 0x9d, 0xf7, 0x62, 0x18, 0xd3, 0xd7, 0x48, 0xde, 0x7a, 0x98, 0xd3, 0x0d, 0xcd, + 0xd2, 0x50, 0xee, 0x11, 0x51, 0x2a, 0x18, 0x97, 0x55, 0x95, 0x94, 0x6b, 0x12, 0xce, 0xc9, 0xc4, + 0xb4, 0x0c, 0x52, 0xa9, 0x5b, 0x58, 0x96, 0xb4, 0xaa, 0xee, 0x8c, 0xaa, 0x58, 0x56, 0xb0, 0x91, + 0xd3, 0xd7, 0x48, 0xea, 0x98, 0xa4, 0x99, 0x55, 0xcd, 0xbc, 0x47, 0xad, 0xf3, 0xce, 0x8b, 0x03, + 0x95, 0x9a, 0x50, 0x34, 0x45, 0x73, 0xc6, 0xed, 0x27, 0x67, 0x54, 0x78, 0x1c, 0x83, 0x63, 0xcb, + 0xa6, 0xb2, 0x62, 0x68, 0xba, 0x66, 0xe2, 0xa2, 0x2c, 0xbf, 0x57, 0x98, 0xbb, 0x28, 0x6a, 0x9a, + 0x75, 0x05, 0x1b, 0x16, 0xba, 0x06, 0x43, 0x26, 0x51, 0x6a, 0xd8, 0xe0, 0xb9, 0x2c, 0x37, 0x3d, + 0xba, 0x98, 0x6f, 0x36, 0x32, 0xaf, 0xac, 0x97, 0x55, 0x22, 0x97, 0x2d, 0x7c, 0x49, 0x30, 0xf0, + 0xc7, 0x75, 0x62, 0x60, 0x59, 0xf8, 0xfd, 0x87, 0xd9, 0x89, 0xd6, 0x62, 0x45, 0x59, 0x36, 0xb0, + 0x69, 0xae, 0x5a, 0x06, 0xa9, 0x29, 0x62, 0xcb, 0x1c, 0x5d, 0x80, 0x84, 0x84, 0x0d, 0x8b, 0x8f, + 0x51, 0x98, 0xa9, 0x66, 0x23, 0x93, 0xed, 0x86, 0x99, 0xa9, 0x96, 0x1f, 0x5e, 0x3e, 0x3b, 0x77, + 0xfe, 0x42, 0xe1, 0xf5, 0x85, 0x39, 0x41, 0xa4, 0x16, 0xe8, 0x35, 0x48, 0x90, 0xda, 0x7d, 0x8d, + 0x8f, 0x53, 0xcb, 0xa3, 0x7e, 0x07, 0x6c, 0x83, 0xf3, 0x73, 0x17, 0x17, 0x04, 0x91, 0x4e, 0x42, + 0x08, 0x12, 0x16, 0xa9, 0x62, 0x3e, 0x91, 0xe5, 0xa6, 0xe3, 0x22, 0x7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x06, 0x1f, 0x29, 0xde, 0xa2, 0xce, 0x2c, + 0x74, 0x13, 0x26, 0x24, 0x43, 0x5d, 0xa5, 0xee, 0xdb, 0xe4, 0x91, 0xfb, 0x44, 0x2a, 0x5b, 0xce, + 0x19, 0xb3, 0x85, 0x75, 0xa0, 0x11, 0xba, 0x06, 0x88, 0x98, 0x66, 0x1d, 0x1b, 0xab, 0x5e, 0xae, + 0x4b, 0xce, 0x91, 0x14, 0x0e, 0x15, 0x60, 0x82, 0x0a, 0x30, 0x2c, 0x97, 0xad, 0xf2, 0x1d, 0x71, + 0x89, 0x1f, 0xa1, 0xd6, 0xc7, 0x9b, 0x8d, 0xcc, 0xd1, 0x00, 0x79, 0xd5, 0x0d, 0x55, 0x10, 0xdd, + 0xb9, 0xf6, 0xfe, 0xb4, 0x1f, 0xaf, 0x12, 0x15, 0xaf, 0x92, 0x47, 0x98, 0x1f, 0xcd, 0x72, 0xd3, + 0x09, 0xd1, 0x37, 0x86, 0xd2, 0x00, 0xf6, 0x7b, 0x89, 0x28, 0xd8, 0xb4, 0x78, 0xa0, 0x3b, 0xb8, + 0x6d, 0x04, 0x9d, 0x86, 0x71, 0xef, 0xed, 0xf6, 0x86, 0x8e, 0xf9, 0x83, 0xf4, 0x5e, 0xd1, 0x31, + 0x8a, 0xde, 0x82, 0x71, 0x83, 0x49, 0x8a, 0xce, 0x1b, 0xb3, 0xe7, 0x85, 0xc7, 0xd9, 0x31, 0xbd, + 0xfb, 0xfe, 0x72, 0x28, 0xe8, 0xfe, 0x92, 0x83, 0x99, 0x5e, 0x24, 0xcc, 0x34, 0xff, 0x55, 0x02, + 0xce, 0x2c, 0x9b, 0xca, 0x1d, 0xdd, 0x5e, 0xfe, 0x05, 0x90, 0x3d, 0x93, 0x6b, 0xbc, 0x27, 0xb9, + 0xce, 0x87, 0xc8, 0x95, 0x9e, 0x23, 0x7d, 0xa9, 0x32, 0xd9, 0xbf, 0x2a, 0x17, 0x3c, 0x55, 0x3a, + 0xdb, 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 0xd5, + 0x9c, 0xfb, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x68, 0xe8, 0xb1, 0x37, 0xc7, 0x23, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2686,6 +2736,11 @@ func (m *MsgProposeAddX509RootCert) MarshalToSizedBuffer(dAtA []byte) (int, erro _ = i var l int _ = l + if m.SchemaVersion != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.SchemaVersion)) + i-- + dAtA[i] = 0x30 + } if m.Vid != 0 { i = encodeVarintTx(dAtA, i, uint64(m.Vid)) i-- @@ -2842,6 +2897,11 @@ func (m *MsgAddX509Cert) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.SchemaVersion != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.SchemaVersion)) + i-- + dAtA[i] = 0x28 + } if m.Time != 0 { i = encodeVarintTx(dAtA, i, uint64(m.Time)) i-- @@ -3271,6 +3331,11 @@ func (m *MsgAddPkiRevocationDistributionPoint) MarshalToSizedBuffer(dAtA []byte) _ = i var l int _ = l + if m.SchemaVersion != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.SchemaVersion)) + i-- + dAtA[i] = 0x68 + } if m.RevocationType != 0 { i = encodeVarintTx(dAtA, i, uint64(m.RevocationType)) i-- @@ -3394,6 +3459,11 @@ func (m *MsgUpdatePkiRevocationDistributionPoint) MarshalToSizedBuffer(dAtA []by _ = i var l int _ = l + if m.SchemaVersion != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.SchemaVersion)) + i-- + dAtA[i] = 0x50 + } if m.DataDigestType != 0 { i = encodeVarintTx(dAtA, i, uint64(m.DataDigestType)) i-- @@ -3641,6 +3711,11 @@ func (m *MsgAddNocX509RootCert) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.SchemaVersion != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.SchemaVersion)) + i-- + dAtA[i] = 0x18 + } if len(m.Cert) > 0 { i -= len(m.Cert) copy(dAtA[i:], m.Cert) @@ -3775,6 +3850,11 @@ func (m *MsgAddNocX509Cert) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.SchemaVersion != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.SchemaVersion)) + i-- + dAtA[i] = 0x18 + } if len(m.Cert) > 0 { i -= len(m.Cert) copy(dAtA[i:], m.Cert) @@ -4042,6 +4122,9 @@ func (m *MsgProposeAddX509RootCert) Size() (n int) { if m.Vid != 0 { n += 1 + sovTx(uint64(m.Vid)) } + if m.SchemaVersion != 0 { + n += 1 + sovTx(uint64(m.SchemaVersion)) + } return n } @@ -4112,6 +4195,9 @@ func (m *MsgAddX509Cert) Size() (n int) { if m.Time != 0 { n += 1 + sovTx(uint64(m.Time)) } + if m.SchemaVersion != 0 { + n += 1 + sovTx(uint64(m.SchemaVersion)) + } return n } @@ -4338,6 +4424,9 @@ func (m *MsgAddPkiRevocationDistributionPoint) Size() (n int) { if m.RevocationType != 0 { n += 1 + sovTx(uint64(m.RevocationType)) } + if m.SchemaVersion != 0 { + n += 1 + sovTx(uint64(m.SchemaVersion)) + } return n } @@ -4389,6 +4478,9 @@ func (m *MsgUpdatePkiRevocationDistributionPoint) Size() (n int) { if m.DataDigestType != 0 { n += 1 + sovTx(uint64(m.DataDigestType)) } + if m.SchemaVersion != 0 { + n += 1 + sovTx(uint64(m.SchemaVersion)) + } return n } @@ -4481,6 +4573,9 @@ func (m *MsgAddNocX509RootCert) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } + if m.SchemaVersion != 0 { + n += 1 + sovTx(uint64(m.SchemaVersion)) + } return n } @@ -4541,6 +4636,9 @@ func (m *MsgAddNocX509Cert) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } + if m.SchemaVersion != 0 { + n += 1 + sovTx(uint64(m.SchemaVersion)) + } return n } @@ -4810,6 +4908,25 @@ func (m *MsgProposeAddX509RootCert) Unmarshal(dAtA []byte) error { break } } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SchemaVersion", wireType) + } + m.SchemaVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SchemaVersion |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -5272,6 +5389,25 @@ func (m *MsgAddX509Cert) Unmarshal(dAtA []byte) error { break } } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SchemaVersion", wireType) + } + m.SchemaVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SchemaVersion |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -6803,6 +6939,25 @@ func (m *MsgAddPkiRevocationDistributionPoint) Unmarshal(dAtA []byte) error { break } } + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SchemaVersion", wireType) + } + m.SchemaVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SchemaVersion |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -7152,6 +7307,25 @@ func (m *MsgUpdatePkiRevocationDistributionPoint) Unmarshal(dAtA []byte) error { break } } + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SchemaVersion", wireType) + } + m.SchemaVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SchemaVersion |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -7746,6 +7920,25 @@ func (m *MsgAddNocX509RootCert) Unmarshal(dAtA []byte) error { } m.Cert = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SchemaVersion", wireType) + } + m.SchemaVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SchemaVersion |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -8138,6 +8331,25 @@ func (m *MsgAddNocX509Cert) Unmarshal(dAtA []byte) error { } m.Cert = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SchemaVersion", wireType) + } + m.SchemaVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SchemaVersion |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) diff --git a/x/vendorinfo/client/cli/tx_vendor_info.go b/x/vendorinfo/client/cli/tx_vendor_info.go index d5d706337..1567487d5 100644 --- a/x/vendorinfo/client/cli/tx_vendor_info.go +++ b/x/vendorinfo/client/cli/tx_vendor_info.go @@ -6,6 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/tx" "github.com/spf13/cobra" "github.com/zigbee-alliance/distributed-compliance-ledger/utils/cli" + "github.com/zigbee-alliance/distributed-compliance-ledger/x/common" "github.com/zigbee-alliance/distributed-compliance-ledger/x/vendorinfo/types" ) @@ -16,6 +17,7 @@ func CmdCreateVendorInfo() *cobra.Command { companyLegalName string companyPreferredName string vendorLandingPageURL string + schemaVersion uint32 ) cmd := &cobra.Command{ @@ -35,6 +37,7 @@ func CmdCreateVendorInfo() *cobra.Command { companyLegalName, companyPreferredName, vendorLandingPageURL, + schemaVersion, ) // validate basic will be called in GenerateOrBroadcastTxCLI @@ -58,6 +61,7 @@ func CmdCreateVendorInfo() *cobra.Command { cmd.Flags().StringVarP(&vendorLandingPageURL, FlagVendorLandingPageURL, FlagVendorLandingPageURLShortcut, "", "Landing Page URL for the Vendor") cli.AddTxFlagsToCmd(cmd) + cmd.Flags().Uint32Var(&schemaVersion, common.FlagSchemaVersion, 1, "Schema version") _ = cmd.MarkFlagRequired(FlagVID) _ = cmd.MarkFlagRequired(FlagVendorName) @@ -74,6 +78,7 @@ func CmdUpdateVendorInfo() *cobra.Command { companyLegalName string companyPreferredName string vendorLandingPageURL string + schemaVersion uint32 ) cmd := &cobra.Command{ @@ -93,6 +98,7 @@ func CmdUpdateVendorInfo() *cobra.Command { companyLegalName, companyPreferredName, vendorLandingPageURL, + schemaVersion, ) // validate basic will be called in GenerateOrBroadcastTxCLI @@ -115,6 +121,8 @@ func CmdUpdateVendorInfo() *cobra.Command { "", "Company Preferred Name") cmd.Flags().StringVarP(&vendorLandingPageURL, FlagVendorLandingPageURL, FlagVendorLandingPageURLShortcut, "", "Landing Page URL for the Vendor") + cmd.Flags().Uint32Var(&schemaVersion, common.FlagSchemaVersion, 1, "Schema version") + cli.AddTxFlagsToCmd(cmd) _ = cmd.MarkFlagRequired(FlagVID) diff --git a/x/vendorinfo/handler_test.go b/x/vendorinfo/handler_test.go index ac55a9f34..020df9d13 100644 --- a/x/vendorinfo/handler_test.go +++ b/x/vendorinfo/handler_test.go @@ -87,6 +87,7 @@ func TestHandler_AddVendorInfo(t *testing.T) { // add new vendorinfo msgCreateVendorInfo := NewMsgCreateVendorInfo(setup.Vendor) + msgCreateVendorInfo.SchemaVersion = testconstants.SchemaVersion _, err := setup.Handler(setup.Ctx, msgCreateVendorInfo) require.NoError(t, err) @@ -101,6 +102,7 @@ func TestHandler_AddVendorInfo(t *testing.T) { require.Equal(t, msgCreateVendorInfo.Creator, receivedVendorInfo.Creator) require.Equal(t, msgCreateVendorInfo.VendorLandingPageURL, receivedVendorInfo.VendorLandingPageURL) require.Equal(t, msgCreateVendorInfo.VendorName, receivedVendorInfo.VendorName) + require.Equal(t, msgCreateVendorInfo.SchemaVersion, receivedVendorInfo.SchemaVersion) } func queryVendorInfo( @@ -134,10 +136,12 @@ func TestHandler_UpdateVendorInfo(t *testing.T) { // add new vendorinfo msgCreateVendorInfo := NewMsgCreateVendorInfo(setup.Vendor) + msgCreateVendorInfo.SchemaVersion = testconstants.SchemaVersion _, err = setup.Handler(setup.Ctx, msgCreateVendorInfo) require.NoError(t, err) // update existing vendorinfo + msgUpdateVendorInfo.SchemaVersion = 2 _, err = setup.Handler(setup.Ctx, msgUpdateVendorInfo) require.NoError(t, err) @@ -152,6 +156,7 @@ func TestHandler_UpdateVendorInfo(t *testing.T) { require.Equal(t, msgUpdateVendorInfo.Creator, receivedVendorInfo.Creator) require.Equal(t, msgUpdateVendorInfo.VendorLandingPageURL, receivedVendorInfo.VendorLandingPageURL) require.Equal(t, msgUpdateVendorInfo.VendorName, receivedVendorInfo.VendorName) + require.Equal(t, msgUpdateVendorInfo.SchemaVersion, receivedVendorInfo.SchemaVersion) } func TestHandler_OnlyOwnerCanUpdateVendorInfo(t *testing.T) { diff --git a/x/vendorinfo/keeper/msg_server_vendor_info.go b/x/vendorinfo/keeper/msg_server_vendor_info.go index ee79d9ae0..0800b4755 100644 --- a/x/vendorinfo/keeper/msg_server_vendor_info.go +++ b/x/vendorinfo/keeper/msg_server_vendor_info.go @@ -5,6 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/zigbee-alliance/distributed-compliance-ledger/x/common" "github.com/zigbee-alliance/distributed-compliance-ledger/x/vendorinfo/types" ) @@ -33,6 +34,7 @@ func (k msgServer) CreateVendorInfo(goCtx context.Context, msg *types.MsgCreateV CompanyLegalName: msg.CompanyLegalName, CompanyPreferredName: msg.CompanyPreferredName, VendorLandingPageURL: msg.VendorLandingPageURL, + SchemaVersion: common.GetSchemaVersionOrDefault(msg), } k.SetVendorInfo( @@ -89,6 +91,8 @@ func (k msgServer) UpdateVendorInfo(goCtx context.Context, msg *types.MsgUpdateV vendorInfo.VendorLandingPageURL = msg.VendorLandingPageURL } + vendorInfo.SchemaVersion = common.GetSchemaVersionOrDefault(msg) + k.SetVendorInfo(ctx, vendorInfo) return &types.MsgUpdateVendorInfoResponse{}, nil diff --git a/x/vendorinfo/types/messages_vendor_info.go b/x/vendorinfo/types/messages_vendor_info.go index 001740779..75a950000 100644 --- a/x/vendorinfo/types/messages_vendor_info.go +++ b/x/vendorinfo/types/messages_vendor_info.go @@ -15,6 +15,7 @@ func NewMsgCreateVendorInfo( companyLegalName string, companyPreferredName string, vendorLandingPageURL string, + schemaVersion uint32, ) *MsgCreateVendorInfo { return &MsgCreateVendorInfo{ Creator: creator, @@ -23,6 +24,7 @@ func NewMsgCreateVendorInfo( CompanyLegalName: companyLegalName, CompanyPreferredName: companyPreferredName, VendorLandingPageURL: vendorLandingPageURL, + SchemaVersion: schemaVersion, } } @@ -72,6 +74,7 @@ func NewMsgUpdateVendorInfo( companyLegalName string, companyPreferredName string, vendorLandingPageURL string, + schemaVersion uint32, ) *MsgUpdateVendorInfo { return &MsgUpdateVendorInfo{ Creator: creator, @@ -80,6 +83,7 @@ func NewMsgUpdateVendorInfo( CompanyLegalName: companyLegalName, CompanyPreferredName: companyPreferredName, VendorLandingPageURL: vendorLandingPageURL, + SchemaVersion: schemaVersion, } } diff --git a/x/vendorinfo/types/tx.pb.go b/x/vendorinfo/types/tx.pb.go index 2f7e5a1cd..ea85490cf 100644 --- a/x/vendorinfo/types/tx.pb.go +++ b/x/vendorinfo/types/tx.pb.go @@ -36,6 +36,7 @@ type MsgCreateVendorInfo struct { CompanyLegalName string `protobuf:"bytes,4,opt,name=companyLegalName,proto3" json:"companyLegalName,omitempty" validate:"required,max=256"` CompanyPreferredName string `protobuf:"bytes,5,opt,name=companyPreferredName,proto3" json:"companyPreferredName,omitempty" validate:"omitempty,max=256"` VendorLandingPageURL string `protobuf:"bytes,6,opt,name=vendorLandingPageURL,proto3" json:"vendorLandingPageURL,omitempty" validate:"omitempty,max=256,url"` + SchemaVersion uint32 `protobuf:"varint,7,opt,name=schemaVersion,proto3" json:"schemaVersion,omitempty"` } func (m *MsgCreateVendorInfo) Reset() { *m = MsgCreateVendorInfo{} } @@ -113,6 +114,13 @@ func (m *MsgCreateVendorInfo) GetVendorLandingPageURL() string { return "" } +func (m *MsgCreateVendorInfo) GetSchemaVersion() uint32 { + if m != nil { + return m.SchemaVersion + } + return 0 +} + type MsgCreateVendorInfoResponse struct { } @@ -156,6 +164,7 @@ type MsgUpdateVendorInfo struct { CompanyLegalName string `protobuf:"bytes,4,opt,name=companyLegalName,proto3" json:"companyLegalName,omitempty" validate:"omitempty,max=256"` CompanyPreferredName string `protobuf:"bytes,5,opt,name=companyPreferredName,proto3" json:"companyPreferredName,omitempty" validate:"omitempty,max=256"` VendorLandingPageURL string `protobuf:"bytes,6,opt,name=vendorLandingPageURL,proto3" json:"vendorLandingPageURL,omitempty" validate:"omitempty,max=256,url"` + SchemaVersion uint32 `protobuf:"varint,7,opt,name=schemaVersion,proto3" json:"schemaVersion,omitempty"` } func (m *MsgUpdateVendorInfo) Reset() { *m = MsgUpdateVendorInfo{} } @@ -233,6 +242,13 @@ func (m *MsgUpdateVendorInfo) GetVendorLandingPageURL() string { return "" } +func (m *MsgUpdateVendorInfo) GetSchemaVersion() uint32 { + if m != nil { + return m.SchemaVersion + } + return 0 +} + type MsgUpdateVendorInfoResponse struct { } @@ -279,41 +295,43 @@ func init() { func init() { proto.RegisterFile("vendorinfo/tx.proto", fileDescriptor_193d895112924f09) } var fileDescriptor_193d895112924f09 = []byte{ - // 543 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x95, 0x41, 0x6b, 0x13, 0x4f, - 0x18, 0xc6, 0xb3, 0xcd, 0xbf, 0xfd, 0xeb, 0x9c, 0xca, 0x26, 0x87, 0x98, 0xd6, 0xdd, 0xb0, 0x78, - 0xe8, 0x21, 0xd9, 0xa5, 0x29, 0x29, 0x52, 0x08, 0x6a, 0xf4, 0x12, 0x9b, 0x4a, 0x59, 0xad, 0x88, - 0x97, 0x32, 0xc9, 0xbc, 0x19, 0x07, 0x76, 0x77, 0xd6, 0x99, 0x49, 0x49, 0xfc, 0x14, 0x7e, 0x16, - 0xf1, 0x43, 0x78, 0x2c, 0x9e, 0x44, 0x24, 0x48, 0xf2, 0x01, 0x84, 0x7c, 0x02, 0xc9, 0x4e, 0x62, - 0x42, 0xb3, 0x6d, 0xc1, 0x7a, 0x10, 0x6f, 0xef, 0xbe, 0xb3, 0xef, 0xef, 0x79, 0x98, 0x67, 0x76, - 0x16, 0xe5, 0xce, 0x20, 0x22, 0x5c, 0xb0, 0xa8, 0xcb, 0x3d, 0xd5, 0x77, 0x63, 0xc1, 0x15, 0x37, - 0x6b, 0xef, 0x18, 0x6d, 0x03, 0xe0, 0x20, 0x60, 0x38, 0xea, 0x80, 0x4b, 0x98, 0x54, 0x82, 0xb5, - 0x7b, 0x0a, 0x48, 0x87, 0x87, 0xb1, 0xee, 0x06, 0x40, 0x28, 0x08, 0x77, 0x31, 0x5f, 0xdc, 0x5e, - 0x62, 0xe9, 0xf2, 0x74, 0x5a, 0x6b, 0x68, 0x31, 0x4f, 0x39, 0xe5, 0x49, 0xe9, 0x4d, 0xab, 0x59, - 0xf7, 0x4e, 0x87, 0xcb, 0x90, 0xcb, 0x53, 0xbd, 0xa0, 0x1f, 0xf4, 0x92, 0xf3, 0x35, 0x8b, 0x72, - 0x47, 0x92, 0x3e, 0x16, 0x80, 0x15, 0xbc, 0x4c, 0x78, 0xcd, 0xa8, 0xcb, 0xcd, 0x26, 0xfa, 0xbf, - 0x33, 0xed, 0x71, 0x51, 0x30, 0x4a, 0xc6, 0xce, 0xed, 0x86, 0x37, 0x19, 0xda, 0xb9, 0x33, 0x1c, - 0x30, 0x82, 0x15, 0x1c, 0x38, 0x02, 0xde, 0xf6, 0x98, 0x00, 0xe2, 0x7c, 0xfe, 0x58, 0xc9, 0xcf, - 0x88, 0x8f, 0x08, 0x11, 0x20, 0xe5, 0x73, 0x25, 0x58, 0x44, 0xfd, 0xf9, 0xbc, 0x79, 0x80, 0x6e, - 0x69, 0xa3, 0xcd, 0x27, 0x85, 0xb5, 0x92, 0xb1, 0xb3, 0xde, 0xb0, 0x26, 0x43, 0xbb, 0xb8, 0x60, - 0x51, 0x05, 0xf5, 0xdd, 0x72, 0xa0, 0xa0, 0xbe, 0x5f, 0xab, 0xed, 0xd5, 0x1c, 0xff, 0xd7, 0xfb, - 0xe6, 0x03, 0x84, 0x74, 0xfd, 0x0c, 0x87, 0x50, 0xc8, 0x26, 0x4e, 0xec, 0xc9, 0xd0, 0xde, 0x5a, - 0x75, 0x52, 0x0e, 0x71, 0xbf, 0xbe, 0x5b, 0xbd, 0xef, 0xf8, 0x4b, 0x23, 0xe6, 0x21, 0xda, 0x9c, - 0xee, 0x26, 0x8e, 0x06, 0x2d, 0xa0, 0x38, 0x48, 0x30, 0xff, 0x5d, 0x8b, 0xa9, 0xd6, 0xf6, 0x1d, - 0x7f, 0x65, 0xd0, 0x7c, 0x81, 0xf2, 0xb3, 0xde, 0xb1, 0x80, 0x2e, 0x08, 0x01, 0x24, 0x01, 0xae, - 0x27, 0xc0, 0xd2, 0x64, 0x68, 0x6f, 0x2f, 0x80, 0x3c, 0x64, 0x0a, 0xc2, 0x58, 0x0d, 0x16, 0xc4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0xff, 0xff, 0x3e, 0x03, 0x41, 0x03, 0x76, 0x06, 0x00, 0x00, + // 567 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x95, 0xcf, 0x6a, 0xdb, 0x4c, + 0x14, 0xc5, 0xad, 0xfc, 0xfd, 0xbe, 0x81, 0x40, 0x90, 0xbd, 0x70, 0x9d, 0x54, 0x32, 0x22, 0x0b, + 0x2f, 0x6c, 0x89, 0x38, 0x38, 0x94, 0x80, 0x69, 0xeb, 0x76, 0xe3, 0xc6, 0x29, 0x41, 0x6d, 0x42, + 0xe9, 0x26, 0x8c, 0xa5, 0xeb, 0xc9, 0x80, 0xa4, 0x51, 0x67, 0xc6, 0xc1, 0xee, 0xaa, 0xf4, 0x09, + 0xfa, 0x2c, 0xa5, 0x0f, 0xd1, 0x65, 0xe8, 0xaa, 0x2b, 0x53, 0xec, 0x07, 0x28, 0xf8, 0x09, 0x8a, + 0x35, 0x76, 0xed, 0xc6, 0x4e, 0x02, 0x4d, 0x17, 0x85, 0xee, 0xae, 0xee, 0xe8, 0xfe, 0xce, 0x61, + 0xe6, 0x30, 0x83, 0xd2, 0x17, 0x10, 0xf9, 0x8c, 0xd3, 0xa8, 0xc5, 0x1c, 0xd9, 0xb1, 0x63, 0xce, + 0x24, 0xd3, 0x2b, 0x6f, 0x29, 0x69, 0x02, 0xe0, 0x20, 0xa0, 0x38, 0xf2, 0xc0, 0xf6, 0xa9, 0x90, + 0x9c, 0x36, 0xdb, 0x12, 0x7c, 0x8f, 0x85, 0xb1, 0xea, 0x06, 0xe0, 0x13, 0xe0, 0xf6, 0x74, 0x3e, + 0xb7, 0x3d, 0xc3, 0x52, 0xe5, 0xd9, 0xa8, 0x56, 0xd0, 0x5c, 0x86, 0x30, 0xc2, 0x92, 0xd2, 0x19, + 0x55, 0xe3, 0xee, 0x3d, 0x8f, 0x89, 0x90, 0x89, 0x33, 0xb5, 0x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c, 0x52, 0xd2, 0x4e, 0xc7, 0x99, 0x7d, + 0xa7, 0xba, 0x31, 0x88, 0xe6, 0x5a, 0xf2, 0x4a, 0xec, 0xfd, 0x08, 0x00, 0x00, 0xff, 0xff, 0x2f, + 0xa3, 0x35, 0xa0, 0xc2, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -452,6 +470,11 @@ func (m *MsgCreateVendorInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.SchemaVersion != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.SchemaVersion)) + i-- + dAtA[i] = 0x38 + } if len(m.VendorLandingPageURL) > 0 { i -= len(m.VendorLandingPageURL) copy(dAtA[i:], m.VendorLandingPageURL) @@ -538,6 +561,11 @@ func (m *MsgUpdateVendorInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.SchemaVersion != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.SchemaVersion)) + i-- + dAtA[i] = 0x38 + } if len(m.VendorLandingPageURL) > 0 { i -= len(m.VendorLandingPageURL) copy(dAtA[i:], m.VendorLandingPageURL) @@ -644,6 +672,9 @@ func (m *MsgCreateVendorInfo) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } + if m.SchemaVersion != 0 { + n += 1 + sovTx(uint64(m.SchemaVersion)) + } return n } @@ -685,6 +716,9 @@ func (m *MsgUpdateVendorInfo) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } + if m.SchemaVersion != 0 { + n += 1 + sovTx(uint64(m.SchemaVersion)) + } return n } @@ -911,6 +945,25 @@ func (m *MsgCreateVendorInfo) Unmarshal(dAtA []byte) error { } m.VendorLandingPageURL = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SchemaVersion", wireType) + } + m.SchemaVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SchemaVersion |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -1190,6 +1243,25 @@ func (m *MsgUpdateVendorInfo) Unmarshal(dAtA []byte) error { } m.VendorLandingPageURL = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SchemaVersion", wireType) + } + m.SchemaVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SchemaVersion |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) diff --git a/x/vendorinfo/types/vendor_info.pb.go b/x/vendorinfo/types/vendor_info.pb.go index bc0e33451..6bb8933f0 100644 --- a/x/vendorinfo/types/vendor_info.pb.go +++ b/x/vendorinfo/types/vendor_info.pb.go @@ -30,6 +30,7 @@ type VendorInfo struct { CompanyPreferredName string `protobuf:"bytes,4,opt,name=companyPreferredName,proto3" json:"companyPreferredName,omitempty"` VendorLandingPageURL string `protobuf:"bytes,5,opt,name=vendorLandingPageURL,proto3" json:"vendorLandingPageURL,omitempty"` Creator string `protobuf:"bytes,6,opt,name=creator,proto3" json:"creator,omitempty"` + SchemaVersion uint32 `protobuf:"varint,7,opt,name=schemaVersion,proto3" json:"schemaVersion,omitempty"` } func (m *VendorInfo) Reset() { *m = VendorInfo{} } @@ -107,6 +108,13 @@ func (m *VendorInfo) GetCreator() string { return "" } +func (m *VendorInfo) GetSchemaVersion() uint32 { + if m != nil { + return m.SchemaVersion + } + return 0 +} + func init() { proto.RegisterType((*VendorInfo)(nil), "zigbeealliance.distributedcomplianceledger.vendorinfo.VendorInfo") } @@ -114,28 +122,29 @@ func init() { func init() { proto.RegisterFile("vendorinfo/vendor_info.proto", fileDescriptor_45c44599adc45c13) } var fileDescriptor_45c44599adc45c13 = []byte{ - // 325 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0x41, 0x4b, 0xc3, 0x30, - 0x14, 0xc7, 0xd7, 0xe9, 0xa6, 0xe6, 0x24, 0x65, 0x87, 0x3a, 0x24, 0x0c, 0x4f, 0x43, 0x68, 0x0b, - 0x13, 0x3f, 0x80, 0xc3, 0xcb, 0x70, 0xc8, 0xa8, 0xe8, 0xc1, 0xcb, 0x48, 0x9b, 0xb7, 0x18, 0x68, - 0x93, 0x91, 0x64, 0xe2, 0xfc, 0x14, 0xfb, 0x30, 0x7e, 0x08, 0x8f, 0xc3, 0x93, 0x47, 0xd9, 0xbe, - 0x88, 0x34, 0xd9, 0x5c, 0xc1, 0xdd, 0xde, 0xfb, 0xbf, 0xdf, 0x7b, 0x2d, 0xf9, 0xa1, 0xf3, 0x57, - 0x10, 0x54, 0x2a, 0x2e, 0x26, 0x32, 0x76, 0xe5, 0xb8, 0xac, 0xa3, 0xa9, 0x92, 0x46, 0xfa, 0xd7, - 0xef, 0x9c, 0xa5, 0x00, 0x24, 0xcf, 0x39, 0x11, 0x19, 0x44, 0x94, 0x6b, 0xa3, 0x78, 0x3a, 0x33, - 0x40, 0x33, 0x59, 0x4c, 0x5d, 0x9a, 0x03, 0x65, 0xa0, 0xa2, 0xdd, 0xa1, 0xf6, 0x59, 0x26, 0x75, - 0x21, 0xf5, 0xd8, 0x1e, 0x89, 0x5d, 0xe3, 0x2e, 0x5e, 0x2c, 0xea, 0x08, 0x3d, 0x59, 0x72, 0x20, - 0x26, 0xd2, 0x6f, 0xa3, 0x63, 0xb7, 0x37, 0xb8, 0x0d, 0xbc, 0x8e, 0xd7, 0x6d, 0x24, 0x7f, 0xbd, - 0x8f, 0x11, 0x72, 0xf5, 0x3d, 0x29, 0x20, 0xa8, 0x77, 0xbc, 0xee, 0x49, 0x52, 0x49, 0xfc, 0x4b, - 0x74, 0x5a, 0xfe, 0x04, 0x11, 0xf3, 0x21, 0x30, 0x92, 0x5b, 0xea, 0xc0, 0x52, 0xff, 0x72, 0xbf, - 0x87, 0x5a, 0x9b, 0x6c, 0xa4, 0x60, 0x02, 0x4a, 0x01, 0xb5, 0xfc, 0xa1, 0xe5, 0xf7, 0xce, 0xca, - 0x1d, 0xf7, 0xb5, 0x21, 0x11, 0x94, 0x0b, 0x36, 0x22, 0x0c, 0x1e, 0x93, 0x61, 0xd0, 0x70, 0x3b, - 0xfb, 0x66, 0x7e, 0x0f, 0x1d, 0x65, 0x0a, 0x88, 0x91, 0x2a, 0x68, 0x96, 0x58, 0x3f, 0xf8, 0xfa, - 0x08, 0x5b, 0x9b, 0x17, 0xb8, 0xa1, 0x54, 0x81, 0xd6, 0x0f, 0x46, 0x71, 0xc1, 0x92, 0x2d, 0xd8, - 0x87, 0xcf, 0x15, 0xf6, 0x96, 0x2b, 0xec, 0xfd, 0xac, 0xb0, 0xb7, 0x58, 0xe3, 0xda, 0x72, 0x8d, - 0x6b, 0xdf, 0x6b, 0x5c, 0x7b, 0xbe, 0x63, 0xdc, 0xbc, 0xcc, 0xd2, 0x28, 0x93, 0x45, 0xec, 0x4c, - 0x84, 0x5b, 0x15, 0x71, 0x45, 0x45, 0xb8, 0x73, 0x11, 0x3a, 0x19, 0xf1, 0x5b, 0x5c, 0xf1, 0x6a, - 0xe6, 0x53, 0xd0, 0x69, 0xd3, 0x0a, 0xb8, 0xfa, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x95, 0x55, 0xc1, - 0x4c, 0xf2, 0x01, 0x00, 0x00, + // 349 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0xd1, 0x4a, 0x32, 0x41, + 0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 0x03, 0x09, 0x63, 0x90, 0x12, 0x88, 0xe1, 0xff, 0x1b, + 0x7e, 0xef, 0xac, 0xd8, 0xb1, 0x5f, 0xeb, 0x63, 0x4e, 0x18, 0xa7, 0x03, 0x4c, 0xe1, 0x3e, 0xee, + 0x7b, 0x15, 0xbb, 0xb3, 0x6f, 0xe6, 0x76, 0x50, 0x2d, 0x95, 0x80, 0xb5, 0x90, 0x5e, 0xb5, 0xc0, + 0xba, 0xde, 0xc7, 0x6b, 0xd0, 0x58, 0xbf, 0xc0, 0x15, 0x21, 0x12, 0x94, 0xba, 0xd3, 0x92, 0x71, + 0x1a, 0x6f, 0x40, 0xf7, 0x0c, 0xd5, 0x55, 0x3a, 0x81, 0x1c, 0x0f, 0x41, 0x2a, 0x26, 0xb8, 0x57, + 0x6b, 0x39, 0xed, 0x7a, 0xfc, 0x3b, 0xec, 0xc2, 0xfb, 0xd2, 0x77, 0x16, 0x4b, 0xdf, 0xf9, 0x5a, + 0xfa, 0xce, 0xcb, 0xca, 0x2f, 0x2d, 0x56, 0x7e, 0xe9, 0x73, 0xe5, 0x97, 0x1e, 0x6e, 0x28, 0xd3, + 0x93, 0x59, 0x12, 0xa6, 0x22, 0x8f, 0xac, 0xaf, 0x60, 0x23, 0x2c, 0xda, 0x11, 0x16, 0x6c, 0x8d, + 0x05, 0x56, 0x59, 0xf4, 0x14, 0xed, 0xd8, 0xd7, 0xf3, 0x29, 0xa8, 0xa4, 0x6a, 0x34, 0x5d, 0x7c, + 0x07, 0x00, 0x00, 0xff, 0xff, 0x81, 0x35, 0xce, 0x59, 0x18, 0x02, 0x00, 0x00, } func (m *VendorInfo) Marshal() (dAtA []byte, err error) { @@ -158,6 +167,11 @@ func (m *VendorInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.SchemaVersion != 0 { + i = encodeVarintVendorInfo(dAtA, i, uint64(m.SchemaVersion)) + i-- + dAtA[i] = 0x38 + } if len(m.Creator) > 0 { i -= len(m.Creator) copy(dAtA[i:], m.Creator) @@ -241,6 +255,9 @@ func (m *VendorInfo) Size() (n int) { if l > 0 { n += 1 + l + sovVendorInfo(uint64(l)) } + if m.SchemaVersion != 0 { + n += 1 + sovVendorInfo(uint64(m.SchemaVersion)) + } return n } @@ -458,6 +475,25 @@ func (m *VendorInfo) Unmarshal(dAtA []byte) error { } m.Creator = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SchemaVersion", wireType) + } + m.SchemaVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVendorInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SchemaVersion |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipVendorInfo(dAtA[iNdEx:])