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
3 files
+ 15
8
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -18,7 +18,7 @@ if TYPE_CHECKING:
from rich.text import TextType
from textual.app import ComposeResult
from clive.models import Operation
from clive.models import Asset, Operation
class ScrollablePart(ScrollableContainer):
@@ -44,11 +44,14 @@ class PowerUp(TabPane, OperationActionBindings):
def compose(self) -> ComposeResult:
with ScrollablePart():
yield Notice("Your governance voting power will be increased after 30 days")
with Grid(id="power-up-inputs"):
yield self._receiver_input
yield self._asset_input
yield GenerousButton(self._asset_input, self.app.world.profile_data.working_account.data.hive_balance) # type: ignore[arg-type]
yield Notice("Your governance voting power will be increased after 30 days")
yield GenerousButton(self._asset_input, self._get_hive_balance) # type: ignore[arg-type]
def _get_hive_balance(self) -> Asset.Hive:
return self.app.world.profile_data.working_account.data.hive_balance
def _create_operation(self) -> Operation | None | _NotImplemented:
if not CliveValidatedInput.validate_many(self._asset_input, self._receiver_input):
Loading