Skip to content

Commit

Permalink
simplify and unify python example
Browse files Browse the repository at this point in the history
  • Loading branch information
pileks committed Oct 23, 2023
1 parent 30b4df1 commit e3ee0f3
Show file tree
Hide file tree
Showing 7 changed files with 2,075 additions and 13 deletions.
2 changes: 1 addition & 1 deletion packages/templates/app/python/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"test": "poetry run python -m sample"
},
"devDependencies": {
"polywrap": "0.11.2"
"polywrap": "0.12.1"
}
}
2 changes: 1 addition & 1 deletion packages/templates/app/python/polywrap.graphql
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#import * into EthersUtils from "wrapscan.io/polywrap/ethers-utils@1"
#import * into Sha3 from "wrapscan.io/polywrap/sha3@1"
2 changes: 1 addition & 1 deletion packages/templates/app/python/polywrap.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
format: 0.4.0
format: 0.5.0
project:
name: Sample
type: app/python
Expand Down
2 changes: 1 addition & 1 deletion packages/templates/app/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ authors = ["Cesar <[email protected]>", "Niraj <[email protected]>"]

[tool.poetry.dependencies]
python = "^3.10"
polywrap = "^0.1.0b7"
polywrap = "^0.1.2"
4 changes: 2 additions & 2 deletions packages/templates/app/python/sample/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .wrap import EthersUtils
from .wrap import Sha3

__all__ = [
"EthersUtils",
"Sha3",
]
13 changes: 6 additions & 7 deletions packages/templates/app/python/sample/__main__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
from .wrap import EthersUtils
from .wrap import Sha3


if __name__ == "__main__":
eth = EthersUtils()
sha3 = Sha3()

print("Invoking: EthersUtils.encodeParams(...)")
print("Invoking: Sha3.sha3_256(...)")

result = eth.encode_params({
"types": ["address", "uint256"],
"values": ["0xB1B7586656116D546033e3bAFF69BFcD6592225E", "500"]
result = sha3.sha3_256({
"message": "Hello Polywrap!"
})

print(f"EthersUtils.encodeParams:\n{result}")
print(f"Sha3.sha3_256:\n{result}")
2,063 changes: 2,063 additions & 0 deletions packages/templates/app/python/yarn.lock

Large diffs are not rendered by default.

0 comments on commit e3ee0f3

Please sign in to comment.