소스 검색

added feature to show all updates for a contract

justtheboss97 4 년 전
부모
커밋
824d350b7d
2개의 변경된 파일23개의 추가작업 그리고 1개의 파일을 삭제
  1. 0 0
      data/block.json
  2. 23 1
      gui/data.py

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
data/block.json


+ 23 - 1
gui/data.py

@@ -99,6 +99,27 @@ def find_transaction():
             print('No contract found')
         else:
             transactions = decrypt_transactions(transactions, str(key.get()))
+            print('Current contract state')
+            pprint.pprint(current_contract_state(transactions, iden=iden))
+
+        conn.close()
+        newWindow.destroy()
+
+    def findall():
+        conn = rpyc.connect(host='localhost', port=42069, keepalive=True)
+        iden = get_plain_key(str(key.get()))
+        transactions = conn.root.find_transactions(iden)
+        if len(transactions) == 0:
+            print('No contract found')
+        else:
+            transactions = decrypt_transactions(transactions, str(key.get()))
+            print('All updates')
+            for item in transactions:
+                if item['type'] != 'init':
+                    pprint.pprint(item)
+                    print('\n')
+
+            print('Current contract state')
             pprint.pprint(current_contract_state(transactions, iden=iden))
 
         conn.close()
@@ -112,7 +133,8 @@ def find_transaction():
     key.grid(row=0, column=1, columnspan=3, padx=10, pady=10)
     key.insert(0, 'test')
 
-    Button(newWindow, text='find contracts', command=find).grid(row=1, column=1)
+    Button(newWindow, text='find contracts', command=find).grid(row=2, column=0)
+    Button(newWindow, text='find contracts and updates', command=findall).grid(row=2, column=1)
 
 
 def add_term():

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.