-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clients/py: fixed-up unit tests + packaging + readme
- Loading branch information
Showing
18 changed files
with
345 additions
and
222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
__pycache__ | ||
__pycache__ | ||
dist | ||
build | ||
.mypy_cache | ||
*.egg-info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
PYTHON?=python3 | ||
MODULE=sapphirepy | ||
|
||
all: mypy test wheel | ||
|
||
mypy: | ||
$(PYTHON) -mmypy $(MODULE) --check-untyped-defs | ||
|
||
test: | ||
$(PYTHON) -munittest discover | ||
|
||
clean: | ||
rm -rf sapphirepy/__pycache__ build dist sapphire.py.egg-info .mypy_cache | ||
|
||
wheel: | ||
$(PYTHON) setup.py bdist_wheel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# sapphire.py | ||
|
||
```python | ||
from web3 import Web3 | ||
from sapphirepy import sapphire | ||
|
||
# Setup your Web3 provider with a signing account | ||
w3 = Web3(Web3.HTTPProvider('http://localhost:8545')) | ||
w3.middleware_onion.add(construct_sign_and_send_raw_middleware(account)) | ||
|
||
# Finally, wrap the provider to add Sapphire end-to-end encryption | ||
w3 = sapphire.wrap(w3) | ||
``` | ||
|
||
The Sapphire middleware for Web3.py ensures all transactions, gas estimates and view calls are end-to-end encrypted between your application and the smart contract. | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
class SapphireError(Exception): | ||
pass |
Oops, something went wrong.