Skip to content

Commit

Permalink
conway: cert UI todo
Browse files Browse the repository at this point in the history
  • Loading branch information
janmazak committed Nov 28, 2023
1 parent 075b623 commit bc84029
Show file tree
Hide file tree
Showing 6 changed files with 617 additions and 78 deletions.
28 changes: 14 additions & 14 deletions src/signTx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1311,8 +1311,8 @@ static void _handleCertificateStaking()

switch (policy) {
#define CASE(POLICY, UI_STEP) case POLICY: {ctx->ui_step=UI_STEP; break;}
CASE(POLICY_PROMPT_BEFORE_RESPONSE, HANDLE_CERTIFICATE_STEP_DISPLAY_OPERATION);
CASE(POLICY_ALLOW_WITHOUT_PROMPT, HANDLE_CERTIFICATE_STEP_RESPOND);
CASE(POLICY_PROMPT_BEFORE_RESPONSE, HANDLE_CERTIFICATE_STAKING_STEP_DISPLAY_OPERATION);
CASE(POLICY_ALLOW_WITHOUT_PROMPT, HANDLE_CERTIFICATE_STAKING_STEP_RESPOND);
#undef CASE
default:
THROW(ERR_NOT_IMPLEMENTED);
Expand All @@ -1335,14 +1335,14 @@ static void _handleCertificateVoteDeleg()

switch (policy) {
#define CASE(POLICY, UI_STEP) case POLICY: {ctx->ui_step=UI_STEP; break;}
CASE(POLICY_PROMPT_BEFORE_RESPONSE, HANDLE_CERTIFICATE_STEP_DISPLAY_OPERATION); // TODO
CASE(POLICY_ALLOW_WITHOUT_PROMPT, HANDLE_CERTIFICATE_STEP_RESPOND);
CASE(POLICY_PROMPT_BEFORE_RESPONSE, HANDLE_CERTIFICATE_VOTE_DELEG_STEP_DISPLAY_OPERATION);
CASE(POLICY_ALLOW_WITHOUT_PROMPT, HANDLE_CERTIFICATE_VOTE_DELEG_STEP_RESPOND);
#undef CASE
default:
THROW(ERR_NOT_IMPLEMENTED);
}

signTx_handleCertificateStaking_ui_runStep(); // TODO
signTx_handleCertificateVoteDeleg_ui_runStep();
}

static void _handleCertificateCommitteeAuth()
Expand All @@ -1358,14 +1358,14 @@ static void _handleCertificateCommitteeAuth()

switch (policy) {
#define CASE(POLICY, UI_STEP) case POLICY: {ctx->ui_step=UI_STEP; break;}
CASE(POLICY_PROMPT_BEFORE_RESPONSE, HANDLE_CERTIFICATE_STEP_DISPLAY_OPERATION); // TODO
CASE(POLICY_ALLOW_WITHOUT_PROMPT, HANDLE_CERTIFICATE_STEP_RESPOND);
CASE(POLICY_PROMPT_BEFORE_RESPONSE, HANDLE_CERTIFICATE_COMM_AUTH_STEP_DISPLAY_OPERATION);
CASE(POLICY_ALLOW_WITHOUT_PROMPT, HANDLE_CERTIFICATE_COMM_AUTH_STEP_RESPOND);
#undef CASE
default:
THROW(ERR_NOT_IMPLEMENTED);
}

signTx_handleCertificateStaking_ui_runStep(); // TODO
signTx_handleCertificateCommitteeAuth_ui_runStep();
}

static void _handleCertificateCommitteeResign()
Expand All @@ -1380,14 +1380,14 @@ static void _handleCertificateCommitteeResign()

switch (policy) {
#define CASE(POLICY, UI_STEP) case POLICY: {ctx->ui_step=UI_STEP; break;}
CASE(POLICY_PROMPT_BEFORE_RESPONSE, HANDLE_CERTIFICATE_STEP_DISPLAY_OPERATION); // TODO
CASE(POLICY_ALLOW_WITHOUT_PROMPT, HANDLE_CERTIFICATE_STEP_RESPOND);
CASE(POLICY_PROMPT_BEFORE_RESPONSE, HANDLE_CERTIFICATE_COMM_RESIGN_STEP_DISPLAY_OPERATION);
CASE(POLICY_ALLOW_WITHOUT_PROMPT, HANDLE_CERTIFICATE_COMM_RESIGN_STEP_RESPOND);
#undef CASE
default:
THROW(ERR_NOT_IMPLEMENTED);
}

signTx_handleCertificateStaking_ui_runStep(); // TODO
signTx_handleCertificateCommitteeResign_ui_runStep();
}

static void _handleCertificateDRep()
Expand All @@ -1402,14 +1402,14 @@ static void _handleCertificateDRep()

switch (policy) {
#define CASE(POLICY, UI_STEP) case POLICY: {ctx->ui_step=UI_STEP; break;}
CASE(POLICY_PROMPT_BEFORE_RESPONSE, HANDLE_CERTIFICATE_STEP_DISPLAY_OPERATION); // TODO
CASE(POLICY_ALLOW_WITHOUT_PROMPT, HANDLE_CERTIFICATE_STEP_RESPOND);
CASE(POLICY_PROMPT_BEFORE_RESPONSE, HANDLE_CERTIFICATE_DREP_STEP_DISPLAY_OPERATION);
CASE(POLICY_ALLOW_WITHOUT_PROMPT, HANDLE_CERTIFICATE_DREP_STEP_RESPOND);
#undef CASE
default:
THROW(ERR_NOT_IMPLEMENTED);
}

signTx_handleCertificateStaking_ui_runStep(); // TODO
signTx_handleCertificateDRep_ui_runStep();
}

#ifdef APP_FEATURE_POOL_REGISTRATION
Expand Down
2 changes: 1 addition & 1 deletion src/signTxPoolRegistration_ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ void handleMetadata_ui_runStep()
UI_STEP(HANDLE_METADATA_STEP_DISPLAY_HASH) {
char metadataHashHex[1 + 2 * POOL_METADATA_HASH_LENGTH] = {0};
explicit_bzero(metadataHashHex, SIZEOF(metadataHashHex));
size_t len = str_formatMetadata(
size_t len = encode_hex(
md->hash, SIZEOF(md->hash),
metadataHashHex, SIZEOF(metadataHashHex)
);
Expand Down
Loading

0 comments on commit bc84029

Please sign in to comment.