Skip to content

Commit

Permalink
Updated UI flow PDFs
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasFlamel1 committed Mar 31, 2022
1 parent 9f63a0b commit be4a1e9
Show file tree
Hide file tree
Showing 32 changed files with 969 additions and 989 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ else ifeq ($(CURRENCY),grin)
DEFINES += CURRENCY_FRACTIONAL_DIGITS=9
DEFINES += CURRENCY_ENABLE_SLATEPACK_ADDRESS
DEFINES += CURRENCY_SLATEPACK_ADDRESS_HUMAN_READABLE_PART=\"grin\"
DEFINES += CURRENCY_MAXIMUM_FEE=0xFFFFFFFFFF
DEFINES += CURRENCY_FEE_MASK=0xFFFFFFFFFF
DEFINES += CURRENCY_NAME=\"Grin\"
DEFINES += CURRENCY_ABBREVIATION=\"GRIN\"
DEFINES += CURRENCY_VERSION=\"$(APPVERSION)\"
Expand Down Expand Up @@ -182,7 +182,7 @@ else ifeq ($(CURRENCY),grin_testnet)
DEFINES += CURRENCY_FRACTIONAL_DIGITS=9
DEFINES += CURRENCY_ENABLE_SLATEPACK_ADDRESS
DEFINES += CURRENCY_SLATEPACK_ADDRESS_HUMAN_READABLE_PART=\"tgrin\"
DEFINES += CURRENCY_MAXIMUM_FEE=0xFFFFFFFFFF
DEFINES += CURRENCY_FEE_MASK=0xFFFFFFFFFF
DEFINES += CURRENCY_NAME=\"Grin\\x20Testnet\"
DEFINES += CURRENCY_ABBREVIATION=\"Testnet\\x20GRIN\"
DEFINES += CURRENCY_VERSION=\"$(APPVERSION)\"
Expand Down Expand Up @@ -211,19 +211,19 @@ endif
ifeq ($(TARGET_NAME),TARGET_NANOS)

# Icon name
ICONNAME=submission_requirements/icons/nanos_app_$(ICON).gif
ICONNAME=icons/nanos_app_$(ICON).gif

# Otherwise check if target is the Nano X
else ifeq ($(TARGET_NAME),TARGET_NANOX)

# Icon name
ICONNAME=submission_requirements/icons/nanox_app_$(ICON).gif
ICONNAME=icons/nanox_app_$(ICON).gif

# Otherwise check if target is the Nano S Plus
else ifeq ($(TARGET_NAME),TARGET_NANOS2)

# Icon name
ICONNAME=submission_requirements/icons/nanosplus_app_$(ICON).gif
ICONNAME=icons/nanosplus_app_$(ICON).gif
endif

# Make command
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
30 changes: 6 additions & 24 deletions src/currency_information.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,51 +28,33 @@ void getCurrencyInformation(struct CurrencyInformation *currentCurrencyInformati

// Set current currency information's enable MQS address
currentCurrencyInformation->enableMqsAddress = true;

// Otherwise
#else

// Set current currency information's enable MQS address
currentCurrencyInformation->enableMqsAddress = false;
#endif

// Check if enable TOR address
#ifdef CURRENCY_ENABLE_TOR_ADDRESS

// Set current currency information's enable Tor address
currentCurrencyInformation->enableTorAddress = true;

// Otherwise
#else

// Set current currency information's enable Tor address
currentCurrencyInformation->enableTorAddress = false;
#endif

// Check if enable Slatepack address
#ifdef CURRENCY_ENABLE_SLATEPACK_ADDRESS

// Set current currency information's enable Slatepack address
currentCurrencyInformation->enableSlatepackAddress = true;

// Otherwise
#else

// Set current currency information's enable Slatepack address
currentCurrencyInformation->enableSlatepackAddress = false;
#endif

// Check if maximum fee exists
#ifdef CURRENCY_MAXIMUM_FEE
// Check if fee mask exists
#ifdef CURRENCY_FEE_MASK

// Set current currency information's maximum fee
currentCurrencyInformation->maximumFee = CURRENCY_MAXIMUM_FEE;
// Set current currency information's fee mask
currentCurrencyInformation->feeMask = CURRENCY_FEE_MASK;

// Otherwise
#else

// Set current currency information's maximum fee
currentCurrencyInformation->maximumFee = UINT64_MAX;
// Set current currency information's fee mask
currentCurrencyInformation->feeMask = UINT64_MAX;
#endif

// Check if MQS version exists
Expand Down
4 changes: 2 additions & 2 deletions src/currency_information.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ struct CurrencyInformation {
// Enable Slatepack address
bool enableSlatepackAddress;

// Maximum fee
uint64_t maximumFee;
// Fee mask
uint64_t feeMask;

// MQS version
uint8_t mqsVersion[CURRENCY_MQS_VERSION_SIZE];
Expand Down
2 changes: 1 addition & 1 deletion src/finish_transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ void processFinishTransactionRequest(unsigned short *responseLength, __attribute

// Copy transaction's fee into the fee line buffer
explicit_bzero(feeLineBuffer, sizeof(feeLineBuffer));
toString(feeLineBuffer, transaction.fee, currencyInformation.fractionalDigits);
toString(feeLineBuffer, transaction.fee & currencyInformation.feeMask, currencyInformation.fractionalDigits);

strncat(feeLineBuffer, " ", sizeof(feeLineBuffer) - strlen(feeLineBuffer) - sizeof((char)'\0'));
strncat(feeLineBuffer, currencyInformation.abbreviation, sizeof(feeLineBuffer) - strlen(feeLineBuffer) - sizeof((char)'\0'));
Expand Down
24 changes: 12 additions & 12 deletions src/menus.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ static UX_STEP_NOCB(exportRootPublicKeyMenuNotifyScreen, pnn, {
});

// Export root public key menu approve screen
static UX_STEP_CB(exportRootPublicKeyMenuApproveScreen, pb, processUserInteraction(GET_ROOT_PUBLIC_KEY_INSTRUCTION, true), {
static UX_STEP_CB(exportRootPublicKeyMenuApproveScreen, pb, processUserInteraction(GET_ROOT_PUBLIC_KEY_INSTRUCTION, true, true), {

// Picture
&C_icon_approve,
Expand All @@ -208,7 +208,7 @@ static UX_STEP_CB(exportRootPublicKeyMenuApproveScreen, pb, processUserInteracti
});

// Export root public key menu deny screen
static UX_STEP_CB(exportRootPublicKeyMenuDenyScreen, pb, processUserInteraction(GET_ROOT_PUBLIC_KEY_INSTRUCTION, false), {
static UX_STEP_CB(exportRootPublicKeyMenuDenyScreen, pb, processUserInteraction(GET_ROOT_PUBLIC_KEY_INSTRUCTION, false, false), {

// Picture
&C_icon_reject,
Expand Down Expand Up @@ -268,7 +268,7 @@ static UX_STEP_NOCB(verifyRootPublicKeyMenuPublicKeyScreen,
});

// Verify root public key menu valid screen
static UX_STEP_CB(verifyRootPublicKeyMenuValidScreen, pb, processUserInteraction(VERIFY_ROOT_PUBLIC_KEY_INSTRUCTION, true), {
static UX_STEP_CB(verifyRootPublicKeyMenuValidScreen, pb, processUserInteraction(VERIFY_ROOT_PUBLIC_KEY_INSTRUCTION, true, false), {

// Picture
&C_icon_approve,
Expand All @@ -278,7 +278,7 @@ static UX_STEP_CB(verifyRootPublicKeyMenuValidScreen, pb, processUserInteraction
});

// Verify root public key menu invalid screen
static UX_STEP_CB(verifyRootPublicKeyMenuInvalidScreen, pb, processUserInteraction(VERIFY_ROOT_PUBLIC_KEY_INSTRUCTION, false), {
static UX_STEP_CB(verifyRootPublicKeyMenuInvalidScreen, pb, processUserInteraction(VERIFY_ROOT_PUBLIC_KEY_INSTRUCTION, false, false), {

// Picture
&C_icon_reject,
Expand Down Expand Up @@ -341,7 +341,7 @@ static UX_STEP_NOCB(verifyAddressMenuAddressScreen,
});

// Verify address menu valid screen
static UX_STEP_CB(verifyAddressMenuValidScreen, pb, processUserInteraction(VERIFY_ADDRESS_INSTRUCTION, true), {
static UX_STEP_CB(verifyAddressMenuValidScreen, pb, processUserInteraction(VERIFY_ADDRESS_INSTRUCTION, true, false), {

// Picture
&C_icon_approve,
Expand All @@ -351,7 +351,7 @@ static UX_STEP_CB(verifyAddressMenuValidScreen, pb, processUserInteraction(VERIF
});

// Verify address menu invalid screen
static UX_STEP_CB(verifyAddressMenuInvalidScreen, pb, processUserInteraction(VERIFY_ADDRESS_INSTRUCTION, false), {
static UX_STEP_CB(verifyAddressMenuInvalidScreen, pb, processUserInteraction(VERIFY_ADDRESS_INSTRUCTION, false, false), {

// Picture
&C_icon_reject,
Expand Down Expand Up @@ -414,7 +414,7 @@ static UX_STEP_NOCB(signMqsTimestampMenuTimeAndDateScreen,
});

// Sign MQS timestamp menu approve screen
static UX_STEP_CB(signMqsTimestampMenuApproveScreen, pb, processUserInteraction(GET_MQS_TIMESTAMP_SIGNATURE_INSTRUCTION, true), {
static UX_STEP_CB(signMqsTimestampMenuApproveScreen, pb, processUserInteraction(GET_MQS_TIMESTAMP_SIGNATURE_INSTRUCTION, true, true), {

// Picture
&C_icon_approve,
Expand All @@ -424,7 +424,7 @@ static UX_STEP_CB(signMqsTimestampMenuApproveScreen, pb, processUserInteraction(
});

// Sign MQS timestamp menu deny screen
static UX_STEP_CB(signMqsTimestampMenuDenyScreen, pb, processUserInteraction(GET_MQS_TIMESTAMP_SIGNATURE_INSTRUCTION, false), {
static UX_STEP_CB(signMqsTimestampMenuDenyScreen, pb, processUserInteraction(GET_MQS_TIMESTAMP_SIGNATURE_INSTRUCTION, false, false), {

// Picture
&C_icon_reject,
Expand Down Expand Up @@ -511,7 +511,7 @@ static UX_STEP_NOCB(signTorCertificateMenuAddressScreen,
});

// Sign Tor certificate menu approve screen
static UX_STEP_CB(signTorCertificateMenuApproveScreen, pb, processUserInteraction(GET_TOR_CERTIFICATE_SIGNATURE_INSTRUCTION, true), {
static UX_STEP_CB(signTorCertificateMenuApproveScreen, pb, processUserInteraction(GET_TOR_CERTIFICATE_SIGNATURE_INSTRUCTION, true, true), {

// Picture
&C_icon_approve,
Expand All @@ -521,7 +521,7 @@ static UX_STEP_CB(signTorCertificateMenuApproveScreen, pb, processUserInteractio
});

// Sign Tor certificate menu deny screen
static UX_STEP_CB(signTorCertificateMenuDenyScreen, pb, processUserInteraction(GET_TOR_CERTIFICATE_SIGNATURE_INSTRUCTION, false), {
static UX_STEP_CB(signTorCertificateMenuDenyScreen, pb, processUserInteraction(GET_TOR_CERTIFICATE_SIGNATURE_INSTRUCTION, false, false), {

// Picture
&C_icon_reject,
Expand Down Expand Up @@ -696,7 +696,7 @@ static UX_STEP_NOCB(finalizeTransactionMenuNoPaymentProofScreen, pnn, {
});

// Finalize transaction menu approve screen
static UX_STEP_CB(finalizeTransactionMenuApproveScreen, pb, processUserInteraction(FINISH_TRANSACTION_INSTRUCTION, true), {
static UX_STEP_CB(finalizeTransactionMenuApproveScreen, pb, processUserInteraction(FINISH_TRANSACTION_INSTRUCTION, true, true), {

// Picture
&C_icon_approve,
Expand All @@ -706,7 +706,7 @@ static UX_STEP_CB(finalizeTransactionMenuApproveScreen, pb, processUserInteracti
});

// Finalize transaction menu deny screen
static UX_STEP_CB(finalizeTransactionMenuDenyScreen, pb, processUserInteraction(FINISH_TRANSACTION_INSTRUCTION, false), {
static UX_STEP_CB(finalizeTransactionMenuDenyScreen, pb, processUserInteraction(FINISH_TRANSACTION_INSTRUCTION, false, false), {

// Picture
&C_icon_reject,
Expand Down
16 changes: 10 additions & 6 deletions src/process_requests.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ void processRequest(unsigned short requestLength, volatile unsigned short *respo
}

// Process user interaction
void processUserInteraction(size_t instruction, bool isApprovedResult) {
void processUserInteraction(size_t instruction, bool isApprovedResult, bool showProcessing) {

// Clear menu buffers
clearMenuBuffers();
Expand All @@ -375,11 +375,15 @@ void processUserInteraction(size_t instruction, bool isApprovedResult) {
// Check if user approved the interaction
if(isApprovedResult) {

// Show processing menu
showMenu(PROCESSING_MENU);

// Wait for display to update
UX_WAIT_DISPLAYED();
// Check if showing processing
if(showProcessing) {

// Show processing menu
showMenu(PROCESSING_MENU);

// Wait for display to update
UX_WAIT_DISPLAYED();
}

// Check instruction
switch(instruction) {
Expand Down
2 changes: 1 addition & 1 deletion src/process_requests.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ enum Instruction {
void processRequest(unsigned short requestLength, volatile unsigned short *responseLength, volatile unsigned char *responseFlags);

// Process user interaction
void processUserInteraction(size_t instruction, bool isApprovedResult);
void processUserInteraction(size_t instruction, bool isApprovedResult, bool showProcessing);


#endif
7 changes: 0 additions & 7 deletions src/start_transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,6 @@ void processStartTransactionRequest(__attribute__((unused)) unsigned short *resp
uint64_t fee;
memcpy(&fee, &data[sizeof(account) + sizeof(index) + sizeof(output) + sizeof(input)], sizeof(fee));

// Check if fee is invalid
if(fee > currencyInformation.maximumFee) {

// Throw invalid parameters error
THROW(INVALID_PARAMETERS_ERROR);
}

// Check if an address is provided
size_t addressLength = 0;
const char *address;
Expand Down
Empty file.
Binary file removed submission_requirements/icons/grin.png
Binary file not shown.
Binary file removed submission_requirements/icons/mimblewimble_coin.png
Binary file not shown.
Binary file added submission_requirements/ui_flow/Grin/UI Flow.pdf
Binary file not shown.
Binary file added submission_requirements/ui_flow/Grin/UI Flow.psd
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed submission_requirements/ui_flow/UI Flow.psd
Binary file not shown.
Binary file removed submission_requirements/ui_flow/ui_flow.pdf
Binary file not shown.
Loading

0 comments on commit be4a1e9

Please sign in to comment.