Skip to content

Commit

Permalink
Add missing hinging ( HELpy integration )
Browse files Browse the repository at this point in the history
  • Loading branch information
Michał Kudela authored and vogel76 committed Dec 7, 2023
1 parent 63b603f commit 095a905
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def vest(self) -> tt.Asset.VestsT:
return self._acc_info.vesting_shares

@property
def proxy(self):
def proxy(self) -> str:
return self._acc_info.proxy

def get_governance_vote_power(self) -> tt.Asset.Vest:
Expand Down Expand Up @@ -348,7 +348,7 @@ def get_rc_max_mana(node: tt.InitNode, account_name: str) -> int:
return int(node.api.rc.find_rc_accounts(accounts=[account_name])["rc_accounts"][0]["max_rc"])


def get_transaction_timestamp(node: tt.InitNode, transaction):
def get_transaction_timestamp(node: tt.InitNode, transaction) -> datetime:
return tt.Time.parse(node.api.block.get_block(block_num=transaction["block_num"])["block"]["timestamp"])


Expand Down Expand Up @@ -640,7 +640,7 @@ def assert_comment(self, mode: Literal["deleted", "not_deleted"]) -> None:


class Proposal:
def __init__(self, node, proposal_id):
def __init__(self, node: tt.InitNode, proposal_id: int) -> None:
self._node = node
self._proposal_info = node.api.database.list_proposals(
start=[""],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@
from hive_local_tools.functional.python.operation import Operation, get_transaction_timestamp

if TYPE_CHECKING:
from datetime import datetime

import test_tools as tt


class AccountWitnessProxy(Operation):
def __init__(self, node: tt.InitNode, wallet: tt.Wallet, account_to_modify, proxy) -> None:
def __init__(self, node: tt.InitNode, wallet: tt.Wallet, account_to_modify: str, proxy: str) -> None:
super().__init__(node, wallet)
self._proxy: str = proxy
self._account_to_modify: str = account_to_modify
self._transaction: dict = self._wallet.api.set_voting_proxy(self._account_to_modify, self._proxy)
self._rc_cost: int = self._transaction["rc_cost"]

@property
def timestamp(self):
def timestamp(self) -> datetime:
return get_transaction_timestamp(self._node, self._transaction)

0 comments on commit 095a905

Please sign in to comment.