Skip to content
This repository has been archived by the owner on Mar 9, 2024. It is now read-only.

Show unlock_time for incoming transfers #127

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions monero/backends/jsonrpc/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ def _paymentdict(self, data):
"note": data.get("note", None),
"transaction": self._tx(data),
"local_address": laddr,
"unlock_time": data["unlock_time"]
}
if "destinations" in data:
result["destinations"] = [
Expand Down
7 changes: 5 additions & 2 deletions monero/transaction/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,17 @@ class Payment(object):
transaction = None
local_address = None
note = ""
unlock_time = None

_reprstr = "{} @ {} {:.12f} id={}"
_reprstr = "{} @ {} {:.12f} id={} {}"

def __init__(self, **kwargs):
self.amount = kwargs.pop("amount", self.amount)
self.timestamp = kwargs.pop("timestamp", self.timestamp)
self.payment_id = kwargs.pop("payment_id", self.payment_id)
self.transaction = kwargs.pop("transaction", self.transaction)
self.local_address = kwargs.pop("local_address", self.local_address)
self.unlock_time = kwargs.pop("unlock_time", self.local_address)
self.note = kwargs.pop("note", self.note)
if len(kwargs):
raise ValueError(
Expand All @@ -49,6 +51,7 @@ def __repr__(self):
self.transaction.height or "pool",
self.amount,
self.payment_id,
self.unlock_time,
)


Expand All @@ -58,7 +61,7 @@ class IncomingPayment(Payment):
:class:`Account <monero.account.Account>`)
"""

_reprstr = "in: {} @ {} {:.12f} id={}"
_reprstr = "in: {} @ {} {:.12f} id={} {}"


class OutgoingPayment(Payment):
Expand Down