distributed-compliance-ledger
distributed-compliance-ledger copied to clipboard
OtaFileSize type is incorrect (needs to be uint64 instead of str)
The OtaFileSize is defined as uint64 in Matter Spec. However, the schema is incorrectly returning it as a string, for instance:
curl --location --request GET 'https://on.test-net.dcl.csa-iot.org/dcl/model/versions/31/100/1'
{
"modelVersion": {
"vid": 31,
"pid": 100,
"softwareVersion": 1,
"softwareVersionString": "1.0",
"cdVersionNumber": 1,
"firmwareInformation": "",
"softwareVersionValid": true,
"otaUrl": "",
"otaFileSize": "0",
"otaChecksum": "",
"otaChecksumType": 0,
"minApplicableSoftwareVersion": 1,
"maxApplicableSoftwareVersion": 10,
"releaseNotesUrl": "",
"creator": "cosmos1clsrmjxx07k9u70wgem3q9ve9s978adgmhnt0m"
}
}
It is also specified incorrectly as a string in the docs of this repo. Note that even this repository contains it as a strong number / uint64 in most places:
- https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/d516d7152a5b70129d3b22c1612d06ca75e62b49/x/model/types/messages_model_version.go#L27
- https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/d516d7152a5b70129d3b22c1612d06ca75e62b49/x/model/client/cli/tx_model_version.go#L22
- https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/d516d7152a5b70129d3b22c1612d06ca75e62b49/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.model/module/types/model/tx.ts#L66
- https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/d516d7152a5b70129d3b22c1612d06ca75e62b49/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.model/module/types/model/model_version.d.ts#L12
- https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/d516d7152a5b70129d3b22c1612d06ca75e62b49/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.model/module/types/model/model_version.ts#L16
But then there are places like the following which specify it as a string:
- https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/d516d7152a5b70129d3b22c1612d06ca75e62b49/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.model/module/rest.d.ts#L42
- https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/0f37e05ff8949e83a5e39d91cc9f83878182f615/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.model/module/rest.ts#L64
It seems the field has correct type on ledger (.proto) level. The issue is only with REST API (generated typescript code). Need to check if it's a bug or expected behaviour.