This repository has been archived by the owner on Jan 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleaned up code file, added extra docs.
- Loading branch information
1 parent
cca655f
commit e5f3f82
Showing
1 changed file
with
23 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,28 @@ | ||
class Helpers(object): | ||
""" | ||
Adds additional helper functions that aren't part of the core or extended | ||
API. | ||
""" | ||
# coding=utf-8 | ||
from __future__ import absolute_import, division, print_function, \ | ||
unicode_literals | ||
|
||
from iota.transaction.types import TransactionHash | ||
|
||
def __init__(self, api): | ||
self.api = api | ||
|
||
def is_promotable(self, tail): | ||
# type: (TransactionHash) -> bool | ||
class Helpers(object): | ||
""" | ||
Determines if a tail transaction is promotable. | ||
Adds additional helper functions that aren't part of the core or | ||
extended API. | ||
:param tail: | ||
Transaction hash. Must be a tail transaction. | ||
See https://github.com/iotaledger/iota.lib.py/pull/124 for more | ||
context. | ||
""" | ||
return self.api.check_consistency(tails=[tail])['state'] | ||
|
||
def __init__(self, api): | ||
self.api = api | ||
|
||
def is_promotable(self, tail): | ||
# type: (TransactionHash) -> bool | ||
""" | ||
Determines if a tail transaction is promotable. | ||
:param tail: | ||
Transaction hash. Must be a tail transaction. | ||
""" | ||
return self.api.check_consistency(tails=[tail])['state'] |