Skip to content
Snippets Groups Projects

Implement `Power up` part of hive power management

Merged Jakub Ziebinski requested to merge jziebinski/prepare-hp-management into develop
Compare and Show latest version
1 file
+ 2
9
Compare changes
  • Side-by-side
  • Inline
@@ -18,9 +18,6 @@ if TYPE_CHECKING:
BALANCE_CELL_CLASS: Final[str] = "shares-balance-cell"
HP_BALANCE_INDEX: Final[int] = 0
VESTS_BALANCE_INDEX: Final[int] = 1
class HpInfoTableRow(CliveDataTableRow):
"""Class created to not override the `provider` property five times, but only once."""
@@ -43,12 +40,8 @@ class HpInfoTableRow(CliveDataTableRow):
self._update_balance_row(self.cells, self.get_new_values(content))
def _update_balance_row(self, cells: tuple[Static, ...], pretty_balances: tuple[str, str]) -> None:
hp_cell = cells[HP_BALANCE_INDEX]
vests_cell = cells[VESTS_BALANCE_INDEX]
# In this table we are SURE that `HP` is first and `VESTS` second.
hp_cell.update(pretty_balances[HP_BALANCE_INDEX])
vests_cell.update(pretty_balances[VESTS_BALANCE_INDEX])
for cell, balance in zip(cells, pretty_balances, strict=True):
cell.update(balance)
@abstractmethod
def get_new_values(self, content: Any) -> tuple[str, str]:
Loading