Skip to content

Commit fba8016

Browse files
Code cleanup : remove useless ledger_secure_sdk_sys:: mentions
1 parent a1b08fc commit fba8016

File tree

1 file changed

+19
-28
lines changed

1 file changed

+19
-28
lines changed

ledger_device_sdk/src/nbgl.rs

Lines changed: 19 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ impl<'a> NbglHomeAndSettings<'a> {
308308
nbContents: if self.nb_settings > 0 { 1 } else { 0 },
309309
};
310310

311-
match ledger_secure_sdk_sys::ux_sync_homeAndSettings(
311+
match ux_sync_homeAndSettings(
312312
info_contents[0],
313313
&icon as *const nbgl_icon_details_t,
314314
core::ptr::null(),
@@ -317,7 +317,7 @@ impl<'a> NbglHomeAndSettings<'a> {
317317
&info_list as *const nbgl_contentInfoList_t,
318318
core::ptr::null(),
319319
) {
320-
ledger_secure_sdk_sys::UX_SYNC_RET_APDU_RECEIVED => {
320+
UX_SYNC_RET_APDU_RECEIVED => {
321321
if let Some(comm) = COMM_REF.as_mut() {
322322
if let Some(value) = comm.check_event() {
323323
return value;
@@ -452,13 +452,13 @@ impl<'a> NbglReview<'a> {
452452

453453
if self.blind {
454454
if !show_blind_warning() {
455-
ledger_secure_sdk_sys::ux_sync_reviewStatus(self.tx_type.to_message(false));
455+
ux_sync_reviewStatus(self.tx_type.to_message(false));
456456
return false;
457457
}
458458
}
459459

460460
// Show the review on the device.
461-
let sync_ret = ledger_secure_sdk_sys::ux_sync_review(
461+
let sync_ret = ux_sync_review(
462462
self.tx_type.to_c_type(self.blind, false),
463463
&tag_value_list as *const nbgl_contentTagValueList_t,
464464
&icon as *const nbgl_icon_details_t,
@@ -469,12 +469,12 @@ impl<'a> NbglReview<'a> {
469469

470470
// Return true if the user approved the transaction, false otherwise.
471471
match sync_ret {
472-
ledger_secure_sdk_sys::UX_SYNC_RET_APPROVED => {
473-
ledger_secure_sdk_sys::ux_sync_reviewStatus(self.tx_type.to_message(true));
472+
UX_SYNC_RET_APPROVED => {
473+
ux_sync_reviewStatus(self.tx_type.to_message(true));
474474
return true;
475475
}
476476
_ => {
477-
ledger_secure_sdk_sys::ux_sync_reviewStatus(self.tx_type.to_message(false));
477+
ux_sync_reviewStatus(self.tx_type.to_message(false));
478478
return false;
479479
}
480480
}
@@ -907,18 +907,12 @@ impl NbglGenericReview {
907907

908908
// Return true if the user approved the transaction, false otherwise.
909909
match sync_ret {
910-
ledger_secure_sdk_sys::UX_SYNC_RET_APPROVED => {
911-
ledger_secure_sdk_sys::ux_sync_status(
912-
succeed_cstring.as_ptr() as *const c_char,
913-
true,
914-
);
910+
UX_SYNC_RET_APPROVED => {
911+
ux_sync_status(succeed_cstring.as_ptr() as *const c_char, true);
915912
return true;
916913
}
917914
_ => {
918-
ledger_secure_sdk_sys::ux_sync_status(
919-
rejected_cstring.as_ptr() as *const c_char,
920-
false,
921-
);
915+
ux_sync_status(rejected_cstring.as_ptr() as *const c_char, false);
922916
return false;
923917
}
924918
}
@@ -1045,7 +1039,7 @@ impl NbglStreamingReview {
10451039

10461040
// Return true if the user approved the transaction, false otherwise.
10471041
match sync_ret {
1048-
ledger_secure_sdk_sys::UX_SYNC_RET_APPROVED => {
1042+
UX_SYNC_RET_APPROVED => {
10491043
ux_sync_reviewStatus(self.tx_type.to_message(true));
10501044
return true;
10511045
}
@@ -1107,12 +1101,12 @@ impl<'a> NbglAddressReview<'a> {
11071101

11081102
// Return true if the user approved the address, false otherwise.
11091103
match sync_ret {
1110-
ledger_secure_sdk_sys::UX_SYNC_RET_APPROVED => {
1111-
ledger_secure_sdk_sys::ux_sync_reviewStatus(STATUS_TYPE_ADDRESS_VERIFIED);
1104+
UX_SYNC_RET_APPROVED => {
1105+
ux_sync_reviewStatus(STATUS_TYPE_ADDRESS_VERIFIED);
11121106
return true;
11131107
}
1114-
ledger_secure_sdk_sys::UX_SYNC_RET_REJECTED => {
1115-
ledger_secure_sdk_sys::ux_sync_reviewStatus(STATUS_TYPE_ADDRESS_REJECTED);
1108+
UX_SYNC_RET_REJECTED => {
1109+
ux_sync_reviewStatus(STATUS_TYPE_ADDRESS_REJECTED);
11161110
return false;
11171111
}
11181112
_ => {
@@ -1123,7 +1117,7 @@ impl<'a> NbglAddressReview<'a> {
11231117
}
11241118
}
11251119

1126-
/// A wrapper around the synchronous NBGL ux_sync_status C API binding.
1120+
/// A wrapper around the synchronous NBGL ux_sync_status C API binding.
11271121
/// Draws a generic choice page, described in a centered info (with configurable icon),
11281122
/// thanks to a button and a footer at the bottom of the page.
11291123
pub struct NbglChoice<'a> {
@@ -1189,18 +1183,15 @@ impl<'a> NbglChoice<'a> {
11891183

11901184
// Return true if the user approved the transaction, false otherwise.
11911185
match sync_ret {
1192-
ledger_secure_sdk_sys::UX_SYNC_RET_APPROVED => {
1186+
UX_SYNC_RET_APPROVED => {
11931187
if let Some(text) = self.confirmed_text {
1194-
ledger_secure_sdk_sys::ux_sync_status(text.as_ptr() as *const c_char, true);
1188+
ux_sync_status(text.as_ptr() as *const c_char, true);
11951189
}
11961190
return true;
11971191
}
11981192
_ => {
11991193
if let Some(text) = self.cancelled_text {
1200-
ledger_secure_sdk_sys::ux_sync_status(
1201-
text.as_ptr() as *const c_char,
1202-
false,
1203-
);
1194+
ux_sync_status(text.as_ptr() as *const c_char, false);
12041195
}
12051196
return false;
12061197
}

0 commit comments

Comments
 (0)