Skip to content

Commit 6750a8f

Browse files
smartcontract: test case-insensitive device code handling in SDK
1 parent edc17de commit 6750a8f

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

smartcontract/sdk/rs/src/commands/device/create.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,10 @@ mod tests {
156156
)
157157
.returning(|_, _| Ok(Signature::new_unique()));
158158

159+
// Use mixed-case input to verify SDK lowercases device codes,
160+
// preventing duplicates like "Test_Device" vs "test_device"
159161
let command = CreateDeviceCommand {
160-
code: "test_device".to_string(),
162+
code: "Test_Device".to_string(),
161163
contributor_pk: contributor_pubkey,
162164
location_pk: location_pubkey,
163165
exchange_pk: exchange_pubkey,

smartcontract/sdk/rs/src/commands/device/update.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,11 @@ mod tests {
221221
)
222222
.returning(|_, _| Ok(Signature::new_unique()));
223223

224+
// Use mixed-case input to verify SDK lowercases device codes,
225+
// preventing duplicates like "Test_Device" vs "test_device"
224226
let update_command = UpdateDeviceCommand {
225227
pubkey: device_pubkey,
226-
code: Some("test_device".to_string()),
228+
code: Some("Test_Device".to_string()),
227229
contributor_pk: None,
228230
device_type: Some(DeviceType::Hybrid),
229231
public_ip: None,

0 commit comments

Comments
 (0)