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

Commit fab7661

Browse files
committed
make Transfer an alias of ProposedTransaction
1 parent 3852972 commit fab7661

File tree

1 file changed

+6
-34
lines changed

1 file changed

+6
-34
lines changed

iota/transaction/creation.py

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
__all__ = [
2121
'ProposedBundle',
2222
'ProposedTransaction',
23+
'Transfer',
2324
]
2425

2526

@@ -80,40 +81,11 @@ def as_tryte_string(self):
8081
return super(ProposedTransaction, self).as_tryte_string()
8182

8283

83-
class Transfer(ProposedTransaction):
84-
"""
85-
Follow naming convention of other libs.
86-
A transaction that has not yet been attached to the Tangle.
87-
88-
Provide to :py:meth:`iota.api.Iota.send_transfer` to attach to
89-
tangle and publish/store.
90-
"""
91-
def __init__(self, address, value, tag=None, message=None, timestamp=None):
92-
# type: (Address, int, Optional[Tag], Optional[TryteString], Optional[int]) -> None
93-
if not timestamp:
94-
timestamp = get_current_timestamp()
95-
96-
super(ProposedTransaction, self).__init__(
97-
address = address,
98-
tag = Tag(b'') if tag is None else tag,
99-
timestamp = timestamp,
100-
value = value,
101-
102-
# These values will be populated when the bundle is finalized.
103-
bundle_hash = None,
104-
current_index = None,
105-
hash_ = None,
106-
last_index = None,
107-
signature_message_fragment = None,
108-
109-
# These values start out empty; they will be populated when the
110-
# node does PoW.
111-
branch_transaction_hash = TransactionHash(b''),
112-
nonce = Hash(b''),
113-
trunk_transaction_hash = TransactionHash(b''),
114-
)
115-
116-
self.message = TryteString(b'') if message is None else message
84+
Transfer = ProposedTransaction
85+
"""
86+
Follow naming convention of other libs.
87+
https://github.com/iotaledger/iota.lib.py/issues/72
88+
"""
11789

11890

11991
class ProposedBundle(Bundle, Sequence[ProposedTransaction]):

0 commit comments

Comments
 (0)