forked from renepickhardt/pickhardtpayments
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
shell for a Payment Class for issue renepickhardt#20
- Loading branch information
Showing
2 changed files
with
51 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.DS_Store | ||
.idea | ||
__pycache__ | ||
docs | ||
|
||
# too large to upload | ||
listchannels*.json |
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
class Payment: | ||
""" | ||
Payment stores the information about an amount of sats to be delivered from source to destination. | ||
When sending an amount of sats from sender to receiver, a payment is usually split up and sent across | ||
several paths, to increase the probability of being successfully delivered. | ||
The PaymentClass holds all necessary information about a payment. | ||
It also holds information that helps to calculate performance statistics about the payment. | ||
:param int _total_amount: The total amount of sats to be delivered from source address to destination address. | ||
:param str _sender: sender address for the payment. | ||
:param str _receiver: receiver address for the payment. | ||
:param list _attempts: returns a list of Attempts | ||
:param list _successful_attempts: returns a list of successful Attempts | ||
:param bool _successful: returns True if the total_amount of the payment could be delivered successfully. | ||
""" | ||
|
||
def __init__(self): | ||
self._attempts = [] | ||
self._successful_attempts = [] | ||
|
||
@property | ||
def total_amount(self): | ||
return self._total_amount | ||
|
||
@property | ||
def src(self): | ||
return self._sender | ||
|
||
@property | ||
def dest(self): | ||
return self._receiver | ||
|
||
@property | ||
def attempts(self): | ||
return self._attempts | ||
|
||
@property | ||
def successful_attempts(self): | ||
return self._successful_attempts | ||
|
||
@property | ||
def successful(self): | ||
return self._successful |