Skip to content

Commit

Permalink
remove irrelevant TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
janmazak committed Oct 25, 2023
1 parent 16b2e35 commit b42825b
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 15 deletions.
4 changes: 1 addition & 3 deletions doc/ins_get_public_keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ Concatenation of `pub_key` and `chain_code` representing the extended public key
- Ledger might impose more restrictions, see implementation of `policyForGetExtendedPublicKey` in [src/securityPolicy.c](../src/securityPolicy.c) for details
- calculate extended public key
- respond with extended public key

**TODOs**
- ❓(IOHK): Should we also support BTC app like token validation? (Note: Token validation is to prevent concurrent access to the Ledger by two different host apps which could confuse user into performing wrong actions)
- ❓(IOHK): Should we support permanent app setting where Ledger forces user to acknowledge public key retrieval before sending it to host? (Note: probably not in the first version of the app)
- ❓(IOHK): Should there be an option to show the public key on display? Is it useful in any way? (Note: probably not)
2 changes: 1 addition & 1 deletion src/addressUtilsByron.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void addressRootFromExtPubKey(

{
// [0, [0, publicKey:chainCode], Map(0)]
// TODO(ppershing): what are the first two 0 constants?
// Note(ppershing): what are the first two 0 constants?
view_appendToken(&cbor, CBOR_TYPE_ARRAY, 3);
{
view_appendToken(&cbor, CBOR_TYPE_UNSIGNED, CARDANO_ADDRESS_TYPE_PUBKEY);
Expand Down
2 changes: 1 addition & 1 deletion src/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ unsigned char io_event(unsigned char channel MARK_UNUSED)
case SEPROXYHAL_TAG_FINGER_EVENT:
UX_FINGER_EVENT(G_io_seproxyhal_spi_buffer);
break;
#endif // HAVE_NBGL
#endif // HAVE_NBGL

case SEPROXYHAL_TAG_TICKER_EVENT:
UX_TICKER_EVENT(G_io_seproxyhal_spi_buffer, {
Expand Down
3 changes: 2 additions & 1 deletion src/securityPolicy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1493,7 +1493,8 @@ static inline security_policy_t _poolRegistrationOperatorWitnessPolicy(const bip
case PATH_POOL_COLD_KEY:
// only ordinary spending key paths (because of inputs) and pool cold key path are allowed
WARN_UNLESS(bip44_isPathReasonable(path));
// TODO is there a reason to show the witnesses?
// it might be safe to hide the witnesses, but txs related to stake pools
// are rare, so it would not help much and might introduce some unknown risk
SHOW();
break;

Expand Down
2 changes: 1 addition & 1 deletion src/signTx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1782,7 +1782,7 @@ static subhandler_fn_t* lookup_subhandler(uint8_t p1)
CASE(0x0c, signTx_handleScriptDataHashAPDU);
CASE(0x0d, signTx_handleCollateralInputAPDU);
CASE(0x0e, signTx_handleRequiredSignerAPDU);
CASE(0x12, signTx_handleCollateralOutputAPDU); // TODO perhaps change the numbers for the newly added items?
CASE(0x12, signTx_handleCollateralOutputAPDU);
CASE(0x10, signTx_handleTotalCollateralAPDU);
CASE(0x11, signTx_handleReferenceInputsAPDU);
CASE(0x0a, signTx_handleConfirmAPDU);
Expand Down
2 changes: 1 addition & 1 deletion src/signTx.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ typedef struct {
uint8_t scriptDataHash[SCRIPT_DATA_HASH_LENGTH];
sign_tx_required_signer_t requiredSigner;
uint64_t totalCollateral;
} stageData; // TODO rename to reflect single-APDU scope
} stageData;

union {
pool_registration_context_t pool_registration_subctx;
Expand Down
2 changes: 1 addition & 1 deletion src/signTxUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ bool violatesSingleAccountOrStoreIt(const bip44_path_t* path);

void view_parseDestination(read_view_t* view, tx_output_destination_storage_t* destination);

#endif // H_CARDANO_APP_SIGN_TX_UTILS
#endif // H_CARDANO_APP_SIGN_TX_UTILS
4 changes: 0 additions & 4 deletions src/txHashBuilder.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,6 @@ void txHashBuilder_addOutput_datum(
ASSERT(false);
}

//TODO: MAX_DATUM_SIZE??

// the babbage output format serializes some preliminary stuff
if (builder->outputData.serializationFormat == MAP_BABBAGE) {
// datum_option = [ 0, $hash32 // 1, data ]
Expand Down Expand Up @@ -603,8 +601,6 @@ void txHashBuilder_addOutput_datum_inline_chunk(

void txHashBuilder_addOutput_referenceScript(tx_hash_builder_t* builder, size_t scriptSize)
{
// TODO: MAX_SCRIPT_SIZE?? maybe we don't need to limit it

ASSERT(builder->outputData.includeRefScript);

switch (builder->outputState) {
Expand Down
1 change: 0 additions & 1 deletion src/txHashBuilder_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ static void collateralOutputTokenHandler(tx_hash_builder_t* builder,
{
txHashBuilder_addCollateralOutput_token(builder, assetNameBuffer, assetNameSize, (int64_t)amount);
}
//TODO: more generic function to handle similar? or just merge to addCollRet?
static void addMultiassetCollateralOutput(tx_hash_builder_t* builder, tx_output_serialization_format_t outputFormat)
{
uint8_t tmp[70] = {0};
Expand Down
2 changes: 1 addition & 1 deletion src/uiHelpers_nanos.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ static const bagl_element_t ui_paginatedText[] = {
UI_ICON_LEFT(ID_ICON_GO_LEFT, BAGL_GLYPH_ICON_LEFT),
UI_ICON_RIGHT(ID_ICON_GO_RIGHT, BAGL_GLYPH_ICON_RIGHT),

// TODO(ppershing): what are the following magical numbers?
// Note(ppershing): what are the following magical numbers?

UI_TEXT(ID_UNSPECIFIED, 0, 12, 128, &displayState.paginatedText.header),
UI_TEXT(ID_UNSPECIFIED, 0, 26, 128, &displayState.paginatedText.currentText),
Expand Down

0 comments on commit b42825b

Please sign in to comment.