Skip to content

Commit

Permalink
Merge pull request #362 from abdulla-ashurov/issue354
Browse files Browse the repository at this point in the history
Issue354 - Rename 'FirmwareDigests' to 'FirmwareInformation'
  • Loading branch information
ashcherbakov authored May 20, 2022
2 parents 6a6a7fe + a30e5ad commit 0f37e05
Show file tree
Hide file tree
Showing 58 changed files with 683 additions and 683 deletions.
2 changes: 1 addition & 1 deletion docs/how-to.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ Full command:
```bash
dcld tx model add-model-version --vid=<uint16> --pid=<uint16> --softwareVersion=<uint32> --softwareVersionString=<string> --cdVersionNumber=<uint32>
--minApplicableSoftwareVersion=<uint32> --maxApplicableSoftwareVersion=<uint32>
--firmwareDigests=<string> --softwareVersionValid=<bool> --otaURL=<string> --otaFileSize=<string> --otaChecksum=<string> --otaChecksumType=<string> --releaseNotesURL=<string>
--firmwareInformation=<string> --softwareVersionValid=<bool> --otaURL=<string> --otaFileSize=<string> --otaChecksum=<string> --otaChecksumType=<string> --releaseNotesURL=<string>
--from=<account>
```

Expand Down
6 changes: 3 additions & 3 deletions docs/static/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8353,7 +8353,7 @@ paths:
cdVersionNumber:
type: integer
format: int32
firmwareDigests:
firmwareInformation:
type: string
softwareVersionValid:
type: boolean
Expand Down Expand Up @@ -18950,7 +18950,7 @@ definitions:
cdVersionNumber:
type: integer
format: int32
firmwareDigests:
firmwareInformation:
type: string
softwareVersionValid:
type: boolean
Expand Down Expand Up @@ -19143,7 +19143,7 @@ definitions:
cdVersionNumber:
type: integer
format: int32
firmwareDigests:
firmwareInformation:
type: string
softwareVersionValid:
type: boolean
Expand Down
4 changes: 2 additions & 2 deletions docs/transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ If one of `OTA_URl`, `OTA_checksum` or `OTA_checksum_type` fields is set, then t
- cdVersionNumber `uint32` - CD Version Number of the certification
- minApplicableSoftwareVersion `uint32` - MinApplicableSoftwareVersion should specify the lowest SoftwareVersion for which this image can be applied
- maxApplicableSoftwareVersion `uint32` - MaxApplicableSoftwareVersion should specify the highest SoftwareVersion for which this image can be applied
- firmwareDigests `optional(string)` - FirmwareDigests field included in the Device Attestation response when this Software Image boots on the device
- firmwareInformation `optional(string)` - FirmwareInformation field included in the Device Attestation response when this Software Image boots on the device
- softwareVersionValid `optional(bool)` - Flag to indicate whether the software version is valid or not (default true)
- 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
Expand All @@ -287,7 +287,7 @@ dcld tx model add-model-version --vid=<uint16> --pid=<uint16> --softwareVersion=
```bash
dcld tx model add-model-version --vid=<uint16> --pid=<uint16> --softwareVersion=<uint32> --softwareVersionString=<string> --cdVersionNumber=<uint32>
--minApplicableSoftwareVersion=<uint32> --maxApplicableSoftwareVersion=<uint32>
--firmwareDigests=<string> --softwareVersionValid=<bool> --otaURL=<string> --otaFileSize=<string> --otaChecksum=<string> --otaChecksumType=<string> --releaseNotesURL=<string>
--firmwareInformation=<string> --softwareVersionValid=<bool> --otaURL=<string> --otaFileSize=<string> --otaChecksum=<string> --otaChecksumType=<string> --releaseNotesURL=<string>
--from=<account>
```

Expand Down
14 changes: 7 additions & 7 deletions integration_tests/cli/model-validation-cases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ sv_1=$RANDOM
echo "Create a Device Model Version with all fields for VID: $vid_1 PID: $pid_1 SV: $sv_1"
result=$(echo 'test1234' | dcld tx model add-model-version --vid=$vid_1 --pid=$pid_1 --softwareVersion=$sv_1 \
--softwareVersionString="1.0" --cdVersionNumber=21334 \
--firmwareDigests="123456789012345678901234567890123456789012345678901234567890123" \
--firmwareInformation="123456789012345678901234567890123456789012345678901234567890123" \
--softwareVersionValid=true --otaURL="https://ota.url.info" --otaFileSize=123456789 \
--otaChecksum="123456789012345678901234567890123456789012345678901234567890123" --releaseNotesURL="https://release.notes.url.info" \
--otaChecksumType=1 --maxApplicableSoftwareVersion=32 --minApplicableSoftwareVersion=5 --from=$vendor_account_1 --yes)
Expand All @@ -343,7 +343,7 @@ check_response_and_report "$result" "\"pid\": $pid_1"
check_response_and_report "$result" "\"softwareVersion\": $sv_1"
check_response_and_report "$result" "\"softwareVersionString\": \"1.0\""
check_response_and_report "$result" "\"cdVersionNumber\": 21334"
check_response_and_report "$result" "\"firmwareDigests\": \"123456789012345678901234567890123456789012345678901234567890123\""
check_response_and_report "$result" "\"firmwareInformation\": \"123456789012345678901234567890123456789012345678901234567890123\""
check_response_and_report "$result" "\"softwareVersionValid\": true"
check_response_and_report "$result" "\"otaUrl\": \"https://ota.url.info\""
check_response_and_report "$result" "\"otaFileSize\": \"123456789\""
Expand Down Expand Up @@ -371,7 +371,7 @@ check_response_and_report "$result" "\"pid\": $pid_1"
check_response_and_report "$result" "\"softwareVersion\": $sv_1"
check_response_and_report "$result" "\"softwareVersionString\": \"1.0\""
check_response_and_report "$result" "\"cdVersionNumber\": 21334"
check_response_and_report "$result" "\"firmwareDigests\": \"123456789012345678901234567890123456789012345678901234567890123\""
check_response_and_report "$result" "\"firmwareInformation\": \"123456789012345678901234567890123456789012345678901234567890123\""
check_response_and_report "$result" "\"softwareVersionValid\": true"
check_response_and_report "$result" "\"otaUrl\": \"https://ota.url.info\""
check_response_and_report "$result" "\"otaFileSize\": \"123456789\""
Expand Down Expand Up @@ -399,7 +399,7 @@ check_response_and_report "$result" "\"pid\": $pid_1"
check_response_and_report "$result" "\"softwareVersion\": $sv_1"
check_response_and_report "$result" "\"softwareVersionString\": \"1.0\""
check_response_and_report "$result" "\"cdVersionNumber\": 21334"
check_response_and_report "$result" "\"firmwareDigests\": \"123456789012345678901234567890123456789012345678901234567890123\""
check_response_and_report "$result" "\"firmwareInformation\": \"123456789012345678901234567890123456789012345678901234567890123\""
check_response_and_report "$result" "\"softwareVersionValid\": false"
check_response_and_report "$result" "\"otaUrl\": \"https://ota.url.info\""
check_response_and_report "$result" "\"otaFileSize\": \"123456789\""
Expand Down Expand Up @@ -429,7 +429,7 @@ check_response_and_report "$result" "\"pid\": $pid_1"
check_response_and_report "$result" "\"softwareVersion\": $sv_1"
check_response_and_report "$result" "\"softwareVersionString\": \"1.0\""
check_response_and_report "$result" "\"cdVersionNumber\": 21334"
check_response_and_report "$result" "\"firmwareDigests\": \"123456789012345678901234567890123456789012345678901234567890123\""
check_response_and_report "$result" "\"firmwareInformation\": \"123456789012345678901234567890123456789012345678901234567890123\""
check_response_and_report "$result" "\"softwareVersionValid\": true"
check_response_and_report "$result" "\"otaUrl\": \"https://updated.ota.url.info\""
check_response_and_report "$result" "\"otaFileSize\": \"123456789\""
Expand All @@ -443,7 +443,7 @@ sv_1=$RANDOM
echo "Create a Device Model Version with mandatory fields and some optional fields for VID: $vid_1 PID: $pid_1 SV: $sv_1"
result=$(echo 'test1234' | dcld tx model add-model-version --vid=$vid_1 --pid=$pid_1 --softwareVersion=$sv_1 \
--softwareVersionString="1.0" --cdVersionNumber=21334 \
--firmwareDigests="123456789012345678901234567890123456789012345678901234567890123" \
--firmwareInformation="123456789012345678901234567890123456789012345678901234567890123" \
--softwareVersionValid=true --otaURL="https://ota.url.info" --otaFileSize=123456789 \
--otaChecksum="123456789012345678901234567890123456789012345678901234567890123" \
--otaChecksumType=1 --maxApplicableSoftwareVersion=32 --minApplicableSoftwareVersion=5 --from=$vendor_account_1 --yes)
Expand All @@ -461,7 +461,7 @@ check_response_and_report "$result" "\"pid\": $pid_1"
check_response_and_report "$result" "\"softwareVersion\": $sv_1"
check_response_and_report "$result" "\"softwareVersionString\": \"1.0\""
check_response_and_report "$result" "\"cdVersionNumber\": 21334"
check_response_and_report "$result" "\"firmwareDigests\": \"123456789012345678901234567890123456789012345678901234567890123\""
check_response_and_report "$result" "\"firmwareInformation\": \"123456789012345678901234567890123456789012345678901234567890123\""
check_response_and_report "$result" "\"softwareVersionValid\": true"
check_response_and_report "$result" "\"otaUrl\": \"https://ota.url.info\""
check_response_and_report "$result" "\"otaFileSize\": \"123456789\""
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ var (
HardwareVersion uint32 = 21
HardwareVersionString = "2.1"
CdVersionNumber int32 = 312
FirmwareDigests = "Firmware Digest String"
FirmwareInformation = "Firmware Information String"
Revoked = false
SoftwareVersionValid = true
OtaURL = "https://ota.firmware.com"
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/grpc_rest/model/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func NewMsgCreateModelVersion(
SoftwareVersion: softwareVersion,
SoftwareVersionString: softwareVersionString,
CdVersionNumber: testconstants.CdVersionNumber,
FirmwareDigests: testconstants.FirmwareDigests,
FirmwareInformation: testconstants.FirmwareInformation,
SoftwareVersionValid: true,
OtaUrl: testconstants.OtaURL,
OtaFileSize: testconstants.OtaFileSize,
Expand Down
2 changes: 1 addition & 1 deletion proto/model/model_version.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ message ModelVersion {
uint32 softwareVersion = 3;
string softwareVersionString = 4;
int32 cdVersionNumber = 5;
string firmwareDigests = 6;
string firmwareInformation = 6;
bool softwareVersionValid = 7;
string otaUrl = 8;
uint64 otaFileSize = 9;
Expand Down
2 changes: 1 addition & 1 deletion proto/model/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ message MsgCreateModelVersion {

string softwareVersionString = 5 [(gogoproto.moretags) = "validate:\"required,max=64\""];
int32 cdVersionNumber = 6 [(gogoproto.moretags) = "validate:\"gte=0,lte=65535\""];
string firmwareDigests = 7 [(gogoproto.moretags) = "validate:\"max=512\""];
string firmwareInformation = 7 [(gogoproto.moretags) = "validate:\"max=512\""];
bool softwareVersionValid = 8;
string otaUrl = 9 [(gogoproto.moretags) = "validate:\"omitempty,url,startsnotwith=http:,max=256\""];
uint64 otaFileSize = 10 [(gogoproto.moretags) = "validate:\"required_with=OtaUrl\""];
Expand Down
2 changes: 1 addition & 1 deletion scripts/starport/upgrade-0.44/05.model_types.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ starport scaffold --module model map VendorProducts products:Product --index vid
# Model
starport scaffold --module model map Model deviceTypeId:int productName productLabel partNumber commissioningCustomFlow:int commissioningCustomFlowUrl commissioningModeInitialStepsHint:uint commissioningModeInitialStepsInstruction commissioningModeSecondaryStepsHint:uint commissioningModeSecondaryStepsInstruction userManualUrl supportUrl productUrl lsfUrl lsfRevision --index vid:int,pid:int
# ModelVersion
starport scaffold --module model map ModelVersion softwareVersionString cdVersionNumber:int firmwareDigests softwareVersionValid:bool otaUrl otaFileSize:uint otaChecksum otaChecksumType:int minApplicableSoftwareVersion:uint maxApplicableSoftwareVersion:uint releaseNotesUrl --index vid:int,pid:int,softwareVersion:uint
starport scaffold --module model map ModelVersion softwareVersionString cdVersionNumber:int firmwareInformation softwareVersionValid:bool otaUrl otaFileSize:uint otaChecksum otaChecksumType:int minApplicableSoftwareVersion:uint maxApplicableSoftwareVersion:uint releaseNotesUrl --index vid:int,pid:int,softwareVersion:uint
# ModelVersions
starport scaffold --module model map ModelVersions softwareVersions:array.uint --index vid:int,pid:int

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,37 +305,37 @@ export default {
}
}
},
async sendMsgRevokeModel({ rootGetters }, { value, fee = [], memo = '' }) {
async sendMsgProvisionModel({ rootGetters }, { value, fee = [], memo = '' }) {
try {
const txClient = await initTxClient(rootGetters);
const msg = await txClient.msgRevokeModel(value);
const msg = await txClient.msgProvisionModel(value);
const result = await txClient.signAndBroadcast([msg], { fee: { amount: fee,
gas: "200000" }, memo });
return result;
}
catch (e) {
if (e == MissingWalletError) {
throw new SpVuexError('TxClient:MsgRevokeModel:Init', 'Could not initialize signing client. Wallet is required.');
throw new SpVuexError('TxClient:MsgProvisionModel:Init', 'Could not initialize signing client. Wallet is required.');
}
else {
throw new SpVuexError('TxClient:MsgRevokeModel:Send', 'Could not broadcast Tx: ' + e.message);
throw new SpVuexError('TxClient:MsgProvisionModel:Send', 'Could not broadcast Tx: ' + e.message);
}
}
},
async sendMsgProvisionModel({ rootGetters }, { value, fee = [], memo = '' }) {
async sendMsgRevokeModel({ rootGetters }, { value, fee = [], memo = '' }) {
try {
const txClient = await initTxClient(rootGetters);
const msg = await txClient.msgProvisionModel(value);
const msg = await txClient.msgRevokeModel(value);
const result = await txClient.signAndBroadcast([msg], { fee: { amount: fee,
gas: "200000" }, memo });
return result;
}
catch (e) {
if (e == MissingWalletError) {
throw new SpVuexError('TxClient:MsgProvisionModel:Init', 'Could not initialize signing client. Wallet is required.');
throw new SpVuexError('TxClient:MsgRevokeModel:Init', 'Could not initialize signing client. Wallet is required.');
}
else {
throw new SpVuexError('TxClient:MsgProvisionModel:Send', 'Could not broadcast Tx: ' + e.message);
throw new SpVuexError('TxClient:MsgRevokeModel:Send', 'Could not broadcast Tx: ' + e.message);
}
}
},
Expand All @@ -354,33 +354,33 @@ export default {
}
}
},
async MsgRevokeModel({ rootGetters }, { value }) {
async MsgProvisionModel({ rootGetters }, { value }) {
try {
const txClient = await initTxClient(rootGetters);
const msg = await txClient.msgRevokeModel(value);
const msg = await txClient.msgProvisionModel(value);
return msg;
}
catch (e) {
if (e == MissingWalletError) {
throw new SpVuexError('TxClient:MsgRevokeModel:Init', 'Could not initialize signing client. Wallet is required.');
throw new SpVuexError('TxClient:MsgProvisionModel:Init', 'Could not initialize signing client. Wallet is required.');
}
else {
throw new SpVuexError('TxClient:MsgRevokeModel:Create', 'Could not create message: ' + e.message);
throw new SpVuexError('TxClient:MsgProvisionModel:Create', 'Could not create message: ' + e.message);
}
}
},
async MsgProvisionModel({ rootGetters }, { value }) {
async MsgRevokeModel({ rootGetters }, { value }) {
try {
const txClient = await initTxClient(rootGetters);
const msg = await txClient.msgProvisionModel(value);
const msg = await txClient.msgRevokeModel(value);
return msg;
}
catch (e) {
if (e == MissingWalletError) {
throw new SpVuexError('TxClient:MsgProvisionModel:Init', 'Could not initialize signing client. Wallet is required.');
throw new SpVuexError('TxClient:MsgRevokeModel:Init', 'Could not initialize signing client. Wallet is required.');
}
else {
throw new SpVuexError('TxClient:MsgProvisionModel:Create', 'Could not create message: ' + e.message);
throw new SpVuexError('TxClient:MsgRevokeModel:Create', 'Could not create message: ' + e.message);
}
}
},
Expand Down
Loading

0 comments on commit 0f37e05

Please sign in to comment.