|
|
@@ -1,3 +1,4 @@
|
|
|
+import json
|
|
|
import time
|
|
|
|
|
|
import rpyc
|
|
|
@@ -5,6 +6,7 @@ from rpyc.utils.server import ThreadPoolServer
|
|
|
import argparse
|
|
|
import threading
|
|
|
|
|
|
+from lib.address import Address
|
|
|
from lib.chain import Chain, Block
|
|
|
from lib.transaction import Transaction
|
|
|
from lib.contract import Contract
|
|
|
@@ -97,6 +99,19 @@ if __name__ == '__main__':
|
|
|
global CURRENT
|
|
|
return CURRENT
|
|
|
|
|
|
+ def exposed_push_transaction(self, hashed: str):
|
|
|
+ global CURRENT
|
|
|
+ CURRENT.add_hashed_transaction(hashed)
|
|
|
+ return True
|
|
|
+
|
|
|
+ def exposed_find_transactions(self, addr: str):
|
|
|
+ address = Address()
|
|
|
+ address.from_public(addr=addr)
|
|
|
+
|
|
|
+ found = chain.find_transactions(address)
|
|
|
+
|
|
|
+ return json.dumps(found, sort_keys=True)
|
|
|
+
|
|
|
def exposed_push_contract(self, contract):
|
|
|
global CURRENT
|
|
|
trans = Transaction()
|
|
|
@@ -114,7 +129,5 @@ if __name__ == '__main__':
|
|
|
server.start()
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
# Possible TODO's:
|
|
|
# * Upon adding transaction to block check if transaction is already locked
|