added log on transaction
This commit is contained in:
parent
7127713fff
commit
7a651eafb4
@ -3,6 +3,8 @@ from classes.Transaction import Tx
|
|||||||
from helpers import UtilityHelper as utilityHelper
|
from helpers import UtilityHelper as utilityHelper
|
||||||
from helpers import TaskHelper as taskHelper
|
from helpers import TaskHelper as taskHelper
|
||||||
|
|
||||||
|
import time
|
||||||
|
|
||||||
def transaction(self):
|
def transaction(self):
|
||||||
receiver = input("Enter the username of the receiver:")
|
receiver = input("Enter the username of the receiver:")
|
||||||
if receiver == "":
|
if receiver == "":
|
||||||
@ -56,6 +58,8 @@ def transaction(self):
|
|||||||
|
|
||||||
print(f"Processing transaction of {amount + fee} coins, {receiver} will receive {amount} coins")
|
print(f"Processing transaction of {amount + fee} coins, {receiver} will receive {amount} coins")
|
||||||
|
|
||||||
|
taskHelper.createLog(self, receiver_data[1], time.time(), f"Transaction from `{self.user.username}` of `{amount}` coins is added to the transaction pool. This will be added into your account after it's mined and validated.")
|
||||||
|
|
||||||
new_tx = Tx()
|
new_tx = Tx()
|
||||||
new_tx.createTransaction(self.user.public_ser, self.user.private_ser, amount, fee, receiver_data[1])
|
new_tx.createTransaction(self.user.public_ser, self.user.private_ser, amount, fee, receiver_data[1])
|
||||||
return new_tx
|
return new_tx
|
||||||
|
Loading…
x
Reference in New Issue
Block a user