Skip to content

Commit

Permalink
Merge pull request #60 from blooo-io/fix/LDG-629--nano-app-remove-dep…
Browse files Browse the repository at this point in the history
…recated-methods-remove-un

removed deprecated methods + updated some tests
  • Loading branch information
n4l5u0r authored Dec 13, 2024
2 parents 793d4e6 + c58fc42 commit 4e9d229
Show file tree
Hide file tree
Showing 37 changed files with 4 additions and 433 deletions.
31 changes: 0 additions & 31 deletions doc/ins_encrypted_amount_transfer.md

This file was deleted.

11 changes: 0 additions & 11 deletions doc/ins_transfer_to_encrypted.md

This file was deleted.

9 changes: 0 additions & 9 deletions src/common/handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,6 @@ int handler(uint8_t INS,
case INS_EXPORT_PRIVATE_KEY:
handleExportPrivateKey(cdata, p1, p2, flags);
break;
case INS_TRANSFER_TO_ENCRYPTED:
handleSignTransferToEncrypted(cdata, flags);
break;
case INS_ENCRYPTED_AMOUNT_TRANSFER:
handleSignEncryptedAmountTransfer(cdata, p1, lc, flags, isInitialCall);
break;
case INS_ENCRYPTED_AMOUNT_TRANSFER_WITH_MEMO:
handleSignEncryptedAmountTransferWithMemo(cdata, p1, lc, flags, isInitialCall);
break;
case INS_TRANSFER_TO_PUBLIC:
handleSignTransferToPublic(cdata, p1, lc, flags, isInitialCall);
break;
Expand Down
8 changes: 2 additions & 6 deletions src/common/handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@

#define INS_INIT_CONTRACT 0x07

#define INS_UPDATE_CONTRACT 0x08

#define INS_ENCRYPTED_AMOUNT_TRANSFER 0x10
#define INS_TRANSFER_TO_ENCRYPTED 0x11
#define INS_TRANSFER_TO_PUBLIC 0x12
#define INS_UPDATE_CONTRACT 0x08
#define INS_TRANSFER_TO_PUBLIC 0x12

#define INS_CONFIGURE_DELEGATION 0x17
#define INS_CONFIGURE_BAKER 0x18
Expand All @@ -36,7 +33,6 @@
#define INS_SIGN_UPDATE_CREDENTIAL 0x31

#define INS_SIGN_TRANSFER_WITH_MEMO 0x32
#define INS_ENCRYPTED_AMOUNT_TRANSFER_WITH_MEMO 0x33
#define INS_SIGN_TRANSFER_WITH_SCHEDULE_AND_MEMO 0x34
#define INS_REGISTER_DATA 0x35

Expand Down
10 changes: 0 additions & 10 deletions src/common/ui/display.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,6 @@ void uiSignCredentialDeploymentNewDisplay(void);
void uiSignCredentialDeploymentExistingIntroDisplay(void);
void uiSignCredentialDeploymentExistingDisplay(void);

// Encrypted amount transfer

#ifdef HAVE_BAGL
extern const ux_flow_step_t *ux_sign_encrypted_amount_transfer[8];
#endif

void startEncryptedTransferDisplay(bool displayMemo);

// Public information for IP
void uiReviewPublicInformationForIpDisplay(void);
void uiSignPublicInformationForIpPublicKeyDisplay(void);
Expand All @@ -62,8 +54,6 @@ extern const ux_flow_step_t *ux_sign_amount_transfer[8];

void startTransferDisplay(bool displayMemo, volatile unsigned int *flags);

// Sign Transfer to Encrypted
void uiSignTransferToEncryptedDisplay(volatile unsigned int *flags);
// Sign Transfer to Public
void uiSignTransferToPublicDisplay(volatile unsigned int *flags);

Expand Down
48 changes: 0 additions & 48 deletions src/common/ui/display_bagl.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,37 +516,6 @@ void uiSignCredentialDeploymentExistingDisplay(void) {
ux_flow_init(0, ux_sign_credential_deployment_existing, NULL);
}

// Encrypted amount transfer

const ux_flow_step_t *ux_sign_encrypted_amount_transfer[8];

// UI for displaying encrypted transfer transaction. It only shows the user the recipient address
// as the amounts are encrypted and can't be validated by the user.
UX_STEP_NOCB(ux_sign_encrypted_amount_transfer_1_step, nn, {"Shielded", "transfer"});
UX_STEP_NOCB(ux_sign_encrypted_amount_transfer_2_step,
bnnn_paging,
{.title = "Recipient",
.text = (char *)global.withDataBlob.signEncryptedAmountToTransfer.to});

void startEncryptedTransferDisplay(bool displayMemo) {
uint8_t index = 0;

ux_sign_encrypted_amount_transfer[index++] = &ux_sign_flow_shared_review;
ux_sign_encrypted_amount_transfer[index++] = &ux_sign_encrypted_amount_transfer_1_step;
ux_sign_encrypted_amount_transfer[index++] = &ux_sign_flow_account_sender_view;
ux_sign_encrypted_amount_transfer[index++] = &ux_sign_encrypted_amount_transfer_2_step;

if (displayMemo) {
ux_sign_encrypted_amount_transfer[index++] = &ux_display_memo_step_nocb;
}

ux_sign_encrypted_amount_transfer[index++] = &ux_sign_flow_shared_sign;
ux_sign_encrypted_amount_transfer[index++] = &ux_sign_flow_shared_decline;

ux_sign_encrypted_amount_transfer[index++] = FLOW_END_STEP;
ux_flow_init(0, ux_sign_encrypted_amount_transfer, NULL);
}

// Public information for IP

UX_STEP_NOCB(ux_sign_public_info_for_ip_display_public_key,
Expand Down Expand Up @@ -679,23 +648,6 @@ void startTransferDisplay(bool displayMemo, volatile unsigned int *flags) {
*flags |= IO_ASYNCH_REPLY;
}

// Sign Transfer to Encrypted

UX_STEP_NOCB(ux_sign_transfer_to_encrypted_1_step,
bnnn_paging,
{.title = "Shield amount", .text = (char *)global.signTransferToEncrypted.amount});
UX_FLOW(ux_sign_transfer_to_encrypted,
&ux_sign_flow_shared_review,
&ux_sign_flow_account_sender_view,
&ux_sign_transfer_to_encrypted_1_step,
&ux_sign_flow_shared_sign,
&ux_sign_flow_shared_decline);

void uiSignTransferToEncryptedDisplay(volatile unsigned int *flags) {
ux_flow_init(0, ux_sign_transfer_to_encrypted, NULL);
*flags |= IO_ASYNCH_REPLY;
}

// Sign Transfer to Public

UX_STEP_NOCB(ux_sign_transfer_to_public_1_step,
Expand Down
12 changes: 0 additions & 12 deletions src/common/ui/display_nbgl.c
Original file line number Diff line number Diff line change
Expand Up @@ -577,12 +577,6 @@ void uiSignCredentialDeploymentVerificationKeyFlowDisplay(volatile unsigned int
*flags |= IO_ASYNCH_REPLY;
}

void startEncryptedTransferDisplay(bool displayMemo) {
if (displayMemo) {
return;
}
}

void uiSignPublicInformationForIpCompleteDisplay(void) {
// Setup data to display
uint8_t pairIndex = 0;
Expand Down Expand Up @@ -782,12 +776,6 @@ void startTransferDisplay(bool displayMemo, volatile unsigned int *flags) {
*flags |= IO_ASYNCH_REPLY;
}

void uiSignTransferToEncryptedDisplay(volatile unsigned int *flags) {
return;
*flags |= IO_ASYNCH_REPLY;
// TODO: Implement this
}

void uiSignTransferToPublicDisplay(volatile unsigned int *flags) {
// Setup data to display
uint8_t pairIndex = 0;
Expand Down
7 changes: 0 additions & 7 deletions src/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,8 @@
#include "signConfigureBaker.h"
#include "signConfigureDelegation.h"
#include "signCredentialDeployment.h"
#include "signEncryptedAmountTransfer.h"
#include "signPublicInformationForIp.h"
#include "signTransfer.h"
#include "signTransferToEncrypted.h"
#include "signTransferToPublic.h"
#include "signTransferWithSchedule.h"
#include "signRegisterData.h"
Expand Down Expand Up @@ -94,14 +92,11 @@ typedef enum {
UPDATE_CONTRACT = 2,
TRANSFER = 3,
UPDATE_CREDENTIAL_KEYS = 13,
ENCRYPTED_AMOUNT_TRANSFER = 16,
TRANSFER_TO_ENCRYPTED = 17,
TRANSFER_TO_PUBLIC = 18,
TRANSFER_WITH_SCHEDULE = 19,
UPDATE_CREDENTIALS = 20,
REGISTER_DATA = 21,
TRANSFER_WITH_MEMO = 22,
ENCRYPTED_AMOUNT_TRANSFER_WITH_MEMO = 23,
TRANSFER_WITH_SCHEDULE_WITH_MEMO = 24,
CONFIGURE_BAKER = 25,
CONFIGURE_DELEGATION = 26
Expand Down Expand Up @@ -146,7 +141,6 @@ typedef struct {
typedef struct {
union {
signTransferContext_t signTransferContext;
signEncryptedAmountToTransfer_t signEncryptedAmountToTransfer;
signTransferWithScheduleContext_t signTransferWithScheduleContext;
signRegisterData_t signRegisterData;
};
Expand All @@ -167,7 +161,6 @@ typedef union {
signPublicInformationForIp_t signPublicInformationForIp;
signCredentialDeploymentContext_t signCredentialDeploymentContext;

signTransferToEncrypted_t signTransferToEncrypted;
signTransferToPublic_t signTransferToPublic;
signConfigureBaker_t signConfigureBaker;
signConfigureDelegationContext_t signConfigureDelegation;
Expand Down
146 changes: 0 additions & 146 deletions src/signEncryptedAmountTransfer.c

This file was deleted.

Loading

0 comments on commit 4e9d229

Please sign in to comment.