Skip to content

Commit

Permalink
small improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
chcmedeiros committed Sep 30, 2024
1 parent ef29cd0 commit af02a41
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
4 changes: 2 additions & 2 deletions app/Makefile.version
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This is the major version
APPVERSION_M=0
# This is the minor version
APPVERSION_N=0
APPVERSION_N=1
# This is the patch version
APPVERSION_P=13
APPVERSION_P=0
24 changes: 13 additions & 11 deletions app/src/review_keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,15 @@ zxerr_t getItemProofGenerationKey(int8_t displayIdx, char *outKey, uint16_t outK
switch (displayIdx) {
case 0:
snprintf(outKey, outKeyLen, "AuthKey");
const char *ak = (const char *)G_io_apdu_buffer;
pageStringHex(outVal, outValLen, ak, KEY_LENGTH, pageIdx, pageCount);
const uint8_t *ak = (const uint8_t *)G_io_apdu_buffer;
formatBufferData(ak, KEY_LENGTH, outVal, outValLen, pageIdx, pageCount);

break;
case 1:
snprintf(outKey, outKeyLen, "ProofAuthKey");
const char *nsk = (const char *)G_io_apdu_buffer + KEY_LENGTH;
pageStringHex(outVal, outValLen, nsk, KEY_LENGTH, pageIdx, pageCount);
const uint8_t *nsk = (const uint8_t *)G_io_apdu_buffer + KEY_LENGTH;
formatBufferData(nsk, KEY_LENGTH, outVal, outValLen, pageIdx, pageCount);

break;
case 2: {
snprintf(outKey, outKeyLen, "HD Path");
Expand Down Expand Up @@ -118,18 +120,18 @@ zxerr_t getItemViewKey(int8_t displayIdx, char *outKey, uint16_t outKeyLen, char
switch (displayIdx) {
case 0:
snprintf(outKey, outKeyLen, "ViewKey");
const char *viewKey = (const char *)G_io_apdu_buffer;
pageStringHex(outVal, outValLen, viewKey, 2 * KEY_LENGTH, pageIdx, pageCount);
const uint8_t *viewKey = (const uint8_t *)G_io_apdu_buffer;
formatBufferData(viewKey, 2 * KEY_LENGTH, outVal, outValLen, pageIdx, pageCount);
break;
case 1:
snprintf(outKey, outKeyLen, "IVK");
const char *ivk = (const char *)G_io_apdu_buffer + 2 * KEY_LENGTH;
pageStringHex(outVal, outValLen, ivk, KEY_LENGTH, pageIdx, pageCount);
const uint8_t *ivk = (const uint8_t *)G_io_apdu_buffer + 2 * KEY_LENGTH;
formatBufferData(ivk, KEY_LENGTH, outVal, outValLen, pageIdx, pageCount);
break;
case 2:
snprintf(outKey, outKeyLen, "OVK");
const char *ovk = (const char *)G_io_apdu_buffer + 3 * KEY_LENGTH;
pageStringHex(outVal, outValLen, ovk, KEY_LENGTH, pageIdx, pageCount);
const uint8_t *ovk = (const uint8_t *)G_io_apdu_buffer + 3 * KEY_LENGTH;
formatBufferData(ovk, KEY_LENGTH, outVal, outValLen, pageIdx, pageCount);
break;

case 3: {
Expand All @@ -148,7 +150,7 @@ zxerr_t getItemViewKey(int8_t displayIdx, char *outKey, uint16_t outKeyLen, char
}

void review_keys_menu(key_kind_e keyType) {
const review_type_e reviewType = keyType == PublicAddress ? REVIEW_ADDRESS : REVIEW_TXN;
const review_type_e reviewType = keyType == PublicAddress ? REVIEW_ADDRESS : REVIEW_GENERIC;

void *getItemFunction = NULL;
void *getNumItemFunction = NULL;
Expand Down
7 changes: 6 additions & 1 deletion tests_zemu/tests/standard.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,12 @@ describe('Standard', function () {
test.concurrent.each(models)('show view key', async function (m) {
const sim = new Zemu(m.path)
try {
await sim.start({ ...defaultOptions, model: m.name })
await sim.start({
...defaultOptions,
model: m.name,
approveKeyword: isTouchDevice(m.name) ? 'Approve' : '',
approveAction: ButtonKind.ApproveTapButton,
})
const app = new IronfishApp(sim.getTransport(), false)

const respRequest = app.retrieveKeys(PATH, IronfishKeys.ViewKey, true)
Expand Down

0 comments on commit af02a41

Please sign in to comment.