Spaces:
Runtime error
Runtime error
Update chatchain.py
Browse files- chatchain.py +3 -3
chatchain.py
CHANGED
@@ -230,13 +230,13 @@ class MyChainSend:
|
|
230 |
return block
|
231 |
def print_previous_block(self):
|
232 |
return self.chain[-1]
|
233 |
-
def new_transaction(self, sender, recipient, message):
|
234 |
transaction = {
|
235 |
'sender': sender,
|
236 |
'recipient': recipient,
|
237 |
'message': message,
|
238 |
}
|
239 |
-
transaction = crypt.encrypt_trans(transaction,
|
240 |
self.pending_transactions.append(transaction)
|
241 |
def proof_of_work(self, previous_proof):
|
242 |
new_proof = 1
|
@@ -431,7 +431,7 @@ class MyChainRec:
|
|
431 |
return block
|
432 |
def print_previous_block(self):
|
433 |
return self.chain[-1]
|
434 |
-
def new_transaction(self, sender, recipient, message):
|
435 |
transaction = {
|
436 |
'sender': sender,
|
437 |
'recipient': recipient,
|
|
|
230 |
return block
|
231 |
def print_previous_block(self):
|
232 |
return self.chain[-1]
|
233 |
+
def new_transaction(self, sender, recipient, message,priv_key):
|
234 |
transaction = {
|
235 |
'sender': sender,
|
236 |
'recipient': recipient,
|
237 |
'message': message,
|
238 |
}
|
239 |
+
transaction = crypt.encrypt_trans(transaction,priv_key)
|
240 |
self.pending_transactions.append(transaction)
|
241 |
def proof_of_work(self, previous_proof):
|
242 |
new_proof = 1
|
|
|
431 |
return block
|
432 |
def print_previous_block(self):
|
433 |
return self.chain[-1]
|
434 |
+
def new_transaction(self, sender, recipient, message,pub_key):
|
435 |
transaction = {
|
436 |
'sender': sender,
|
437 |
'recipient': recipient,
|