|
|
@@ -19,7 +19,7 @@ def add_contract():
|
|
|
add_term(contract1)
|
|
|
|
|
|
def add_term(contract1):
|
|
|
-
|
|
|
+
|
|
|
def process_term():
|
|
|
term1 = Contract.Term()
|
|
|
term1.create(title=title2.get(),
|
|
|
@@ -35,6 +35,8 @@ def add_contract():
|
|
|
# Bind contract to transaction
|
|
|
transaction1 = Transaction()
|
|
|
transaction1.set_contract(contract=contract1)
|
|
|
+ r = recipient.get()
|
|
|
+ transaction1.hash(recipient=r)
|
|
|
|
|
|
# get the contract with transaction1.data
|
|
|
# add reciever and sender keys and data
|
|
|
@@ -43,6 +45,10 @@ def add_contract():
|
|
|
# send to push_transaction(hashed:str)
|
|
|
# hashed has the format: {’sender’:..,’receiver’:…, ‘data’:encrypted contract} (see github readme)
|
|
|
# deamon does the rest
|
|
|
+
|
|
|
+ print(transaction1.hash_value)
|
|
|
+
|
|
|
+
|
|
|
|
|
|
term_window.destroy()
|
|
|
newWindow.destroy()
|
|
|
@@ -62,8 +68,12 @@ def add_contract():
|
|
|
deadline2 = Entry(term_window, width=35, borderwidth=5)
|
|
|
deadline2.grid(row=2, column=1, columnspan=3, padx=10, pady=10)
|
|
|
|
|
|
- Button(term_window, text='Add term', command=process_term).grid(row=3,column=0)
|
|
|
- Button(term_window, text='Add term', command=complete).grid(row=3,column=1)
|
|
|
+ Label(term_window, text='Recipient: ').grid(row=3, column=0)
|
|
|
+ recipient1 = Entry(term_window, width=35, borderwidth=5)
|
|
|
+ recipient1.grid(row=3, column=1, columnspan=3, padx=10, pady=10)
|
|
|
+
|
|
|
+ Button(term_window, text='Add term', command=process_term).grid(row=4,column=0)
|
|
|
+ Button(term_window, text='Done', command=complete).grid(row=4,column=1)
|
|
|
|
|
|
|
|
|
|
|
|
@@ -88,8 +98,12 @@ def add_contract():
|
|
|
price = Entry(newWindow, width=35, borderwidth=5)
|
|
|
price.grid(row=3, column=1, columnspan=3, padx=10, pady=10)
|
|
|
|
|
|
+ Label(newWindow, text='Recipient: ').grid(row=4, column=0)
|
|
|
+ recipient = Entry(newWindow, width=35, borderwidth=5)
|
|
|
+ recipient.grid(row=4, column=1, columnspan=3, padx=10, pady=10)
|
|
|
+
|
|
|
# create the add contract button
|
|
|
- Button(newWindow, text = "Create contract", command=add).grid(row=4, column=1)
|
|
|
+ Button(newWindow, text = "Create contract", command=add).grid(row=5, column=1)
|
|
|
|
|
|
|
|
|
|