Skip to content

Commit

Permalink
fixup! refactor(core): separate base and priority Solana fees
Browse files Browse the repository at this point in the history
  • Loading branch information
romanz committed Feb 25, 2025
1 parent eb9d170 commit c22c28e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/src/apps/solana/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
SOLANA_COMPUTE_UNIT_LIMIT = const(200000)

# 1 lamport has 1M microlamports
MICROLAMPORTS = const(1000000)
MICROLAMPORTS_PER_LAMPORT = const(1000000)
5 changes: 3 additions & 2 deletions core/src/apps/solana/transaction/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from trezor.wire import DataError

from ..constants import (
MICROLAMPORTS,
MICROLAMPORTS_PER_LAMPORT,
SOLANA_BASE_FEE_LAMPORTS,
SOLANA_COMPUTE_UNIT_LIMIT,
)
Expand Down Expand Up @@ -265,5 +265,6 @@ def calculate_fee(self) -> Fee:
priority_fee = unit_price * unit_limit # in microlamports
return Fee(
base=base_fee,
priority=(priority_fee + MICROLAMPORTS - 1) // MICROLAMPORTS,
priority=(priority_fee + MICROLAMPORTS_PER_LAMPORT - 1)
// MICROLAMPORTS_PER_LAMPORT,
)

0 comments on commit c22c28e

Please sign in to comment.