Skip to content

Commit

Permalink
Validate Signature
Browse files Browse the repository at this point in the history
  • Loading branch information
CsterKuroi committed Dec 20, 2016
1 parent 404de3c commit c6c9355
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
10 changes: 10 additions & 0 deletions create_and_validate_tx.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import tx
from bigchaindb.models import Transaction

ctx=tx.create()
print(ctx)
tx_obj = Transaction.from_dict(ctx)
input_conditions = []
input_conditions.append(tx_obj.conditions[0])
print(tx_obj.fulfillments_valid(input_conditions))

12 changes: 10 additions & 2 deletions tx.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from bigchaindb_driver import BigchainDB
from bigchaindb_driver.crypto import generate_keypair
from bigchaindb.models import Transaction

def create():
bdb = BigchainDB('http://localhost:9984/api/v1')
Expand All @@ -26,6 +27,13 @@ def create():
# print(txid)
return(fulfilled_creation_tx)

if __name__=="__main__":
create()
def validate(ctx):
tx_obj = Transaction.from_dict(ctx)
input_conditions = []
input_conditions.append(tx_obj.conditions[0])
# print(tx_obj.fulfillments_valid(input_conditions))
return(tx_obj.fulfillments_valid(input_conditions))

if __name__=="__main__":
validate(create())

0 comments on commit c6c9355

Please sign in to comment.