diff --git a/example/python/prepare.sh b/example/python/prepare.sh index fb1602eca1..1942b49784 100755 --- a/example/python/prepare.sh +++ b/example/python/prepare.sh @@ -1,9 +1,11 @@ #!/usr/bin/env bash +cd $(dirname $0) + # generate iroha lib cmake -DSWIG_PYTHON=ON ../.. make _iroha # generate proto files in current dir -protoc --proto_path=../../schema --python_out=. block.proto primitive.proto commands.proto queries.proto responses.proto endpoint.proto yac.proto ordering.proto loader.proto -python -m grpc_tools.protoc --proto_path=../../schema --python_out=. --grpc_python_out=. endpoint.proto yac.proto ordering.proto loader.proto +protoc --proto_path=../../schema --python_out=. block.proto primitive.proto commands.proto queries.proto responses.proto endpoint.proto +python2 -m grpc_tools.protoc --proto_path=../../schema --python_out=. --grpc_python_out=. endpoint.proto yac.proto ordering.proto loader.proto diff --git a/example/python/tx-example.py b/example/python/tx-example.py index 5d5cb78c27..4fd5a2b9a9 100644 --- a/example/python/tx-example.py +++ b/example/python/tx-example.py @@ -62,7 +62,7 @@ if status != "COMMITTED": print("Your transaction wasn't committed") - exit() + exit(1) query = queryBuilder.creatorAccountId(creator) \ .createdTime(current_time) \ @@ -78,7 +78,7 @@ if not query_response.HasField("asset_response"): print("Query response error") - exit(0) + exit(1) else: print("Query responsed with asset response") @@ -87,3 +87,4 @@ print("Precision =", asset_info.precision) print("done!") +exit(0)