added log on transaction

This commit is contained in:
Spekulaas 2024-01-21 23:25:16 +01:00
parent 7127713fff
commit 7a651eafb4

View File

@ -3,6 +3,8 @@ from classes.Transaction import Tx
from helpers import UtilityHelper as utilityHelper
from helpers import TaskHelper as taskHelper
import time
def transaction(self):
receiver = input("Enter the username of the receiver:")
if receiver == "":
@ -56,6 +58,8 @@ def transaction(self):
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.createTransaction(self.user.public_ser, self.user.private_ser, amount, fee, receiver_data[1])
return new_tx