Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Commit

Permalink
Cleaned up code file, added extra docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
todofixthis committed Jun 10, 2018
1 parent cca655f commit e5f3f82
Showing 1 changed file with 23 additions and 13 deletions.
36 changes: 23 additions & 13 deletions iota/commands/extended/helpers.py
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']

0 comments on commit e5f3f82

Please sign in to comment.