Skip to content

Commit

Permalink
Fix some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
kriii committed Sep 30, 2022
1 parent a8c394f commit 7c78d75
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ain/ain.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,17 +224,20 @@ def depositConsensusStake(self, input: ValueOnlyTransactionInput) -> Any:
"""Sends a transaction that deposits AIN for consensus staking.
Args:
input (ValueOnlyTransactionInput): The value only transaction input for deposit AIN value.
input (ValueOnlyTransactionInput): The value only transaction input to deposit AIN value.
Returns:
The transaction results.
"""
return self.__stakeFunction("/deposit/consensus", input)

def withdrawConsensusStake(self) -> Any:
def withdrawConsensusStake(self, input: ValueOnlyTransactionInput) -> Any:
"""
Sends a transaction that withdraws AIN for consensus staking.
Args:
input (ValueOnlyTransactionInput): The value only transaction input to withdraw AIN value.
Returns:
The transaction results.
"""
Expand Down Expand Up @@ -320,7 +323,7 @@ def __stakeFunction(self, path: str, input: ValueOnlyTransactionInput) -> Any:
"""
if not hasattr(input, "value"):
raise ValueError("a value should be specified.")
if type(input) is not int:
if type(input.value) is not int:
raise ValueError("value has to be a int.")
input.address = self.wallet.getImpliedAddress(getattr(input, "address", None))
ref = self.db.ref(f'{path}/{input.address}').push()
Expand Down

0 comments on commit 7c78d75

Please sign in to comment.