Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat(solana): Hidden flag functionality for instructions #89

Closed
wants to merge 3 commits into from

Conversation

RostarMarek
Copy link
Collaborator

Added hidden falg for instructions and added the functionality hide instructions in transactions. Currently applied to compute budget prices.

@RostarMarek RostarMarek self-assigned this Mar 20, 2024
Copy link

github-actions bot commented Mar 20, 2024

legacy UI changes device test(screens) main(screens)

Copy link

github-actions bot commented Mar 20, 2024

core UI changes device test click test persistence test
T2T1 Model T test(screens) main(screens) test(screens) main(screens) test(screens) main(screens)
T2B1 Safe 3 3280 test(screens) main(screens) 2724
T3T1 test(screens) main(screens) test(screens) main(screens) test(screens) main(screens)
All main(screens)

Copy link
Collaborator

@gabrielKerekes gabrielKerekes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nitpicks, otherwise LGTM.

Before creating a PR to Trezor repo please:

  • sync our fork's master branch to Trezor's and rebase this PR on top of that
  • rename branch to feat/solana... (I.e. drop the TRSOL)
  • commits should follow the conventional commits spec (e.g. feat(solana): hide compute budget instructions)

When creating the Trezor PR please also link this issue comment and perhaps provide more context in the PR's description something like "Until now compute budget instructions (SetComputeUnitLimit and SetComputeUnitPrice) were being displayed although the user doesn't really care about them since they affect only the final fee which is displayed on Trezor as well. Including Compute Budget instructions also broke the "Predefined transactions" logic. This wasn't a huge problem before since wallets didn't use priority fees - but they started to use them now. Priority fees support will be added to Trezor Suite as well and so not fixing the predefined transactions would break the UX on Trezor with Suite since predefined transactions would not work....".

@@ -30,6 +30,7 @@ class Instruction:

is_program_supported: bool
is_instruction_supported: bool
is_hidden: bool
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could name it more precisely e.g. can_be_hidden_from_ui? That way the displaying logic can decide to display such an instruction if it really wants to and it's clearer what "hidden" means.

@@ -123,12 +123,12 @@ async def try_confirm_token_transfer_transaction(
from .token_account import try_get_token_account_base_address

if not is_predefined_token_transfer(
transaction.instructions,
transaction.get_visible_instructions(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Visible instructions can be stored in a variable and reused below.

@gabrielKerekes
Copy link
Collaborator

Please cherry-pick and include in the final PR also e315160 which fixes a partially related issue.

@gabrielKerekes
Copy link
Collaborator

Oh, also please run make pystyle in the root of the repo. Feel free to amend your commit and forcepush after.

@RostarMarek RostarMarek changed the title TRSOL-57: Hidden flag functionality for instructions Feature: Hidden flag functionality for instructions Mar 21, 2024
@RostarMarek RostarMarek changed the title Feature: Hidden flag functionality for instructions Feat(solana): Hidden flag functionality for instructions Mar 21, 2024
@RostarMarek RostarMarek force-pushed the feat/TRSOL-57/solana-hide-instructions branch from 1cb19db to 112b89f Compare March 21, 2024 12:46
@RostarMarek RostarMarek deleted the feat/TRSOL-57/solana-hide-instructions branch March 21, 2024 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants