Skip to content

Commit cb5ea69

Browse files
authored
fix node and python sdk (#526)
1 parent 7b7171a commit cb5ea69

File tree

12 files changed

+30
-24
lines changed

12 files changed

+30
-24
lines changed

.github/workflows/cd-python-sdk.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,4 @@ jobs:
4040
TWINE_USERNAME: __token__
4141
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
4242
run: |
43-
make build-package
44-
twine upload dist/* --skip-existing
43+
make publish-package

packages/sdk/python/human-protocol-sdk/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ pip-wheel-metadata/
1111
build
1212
dist
1313
*.egg-info
14+
.eggs
1415

1516
# ABIs
1617
artifacts
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
recursive-include contracts *
1+
recursive-include artifacts *.json

packages/sdk/python/human-protocol-sdk/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
clean-package:
2-
rm -rf build artifacts dist *.egg-info
2+
rm -rf build artifacts dist *.egg-info .eggs
33

44
build-contracts:
55
./scripts/build-contracts.sh
@@ -31,3 +31,7 @@ build-package:
3131
make clean-package
3232
make build-contracts
3333
python3 setup.py sdist bdist_wheel
34+
35+
publish-package:
36+
make build-package
37+
twine upload dist/* --skip-existing

packages/sdk/python/human-protocol-sdk/Pipfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ url = "https://pypi.org/simple"
44
verify_ssl = true
55

66
[dev-packages]
7+
black = "*"
8+
pylint = "*"
9+
pytest = "*"
10+
setuptools-pipfile = "*"
711

812
[packages]
913
cryptography = "*"
1014
hmt-basemodels = "==0.1.18"
11-
sphinx = "*"
12-
black = "*"
13-
pylint = "*"
14-
pytest = "*"
15-
web3 = "==5.24.0"
1615
minio = "*"
1716
validators = "*"
17+
web3 = "==5.24.0"
1818

1919
[requires]
20-
python_version = "3"
20+
python_version = "3.10"
2121

2222
[pipenv]
2323
allow_prereleases = true

packages/sdk/python/human-protocol-sdk/setup.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from glob import glob
21
import setuptools
32

43
setuptools.setup(
@@ -16,10 +15,6 @@
1615
"Programming Language :: Python",
1716
],
1817
packages=setuptools.find_packages() + ["artifacts"],
19-
install_requires=[
20-
"boto3",
21-
"cryptography",
22-
"hmt-basemodels>=0.1.18",
23-
"web3==5.24.0",
24-
],
18+
setup_requires="setuptools-pipfile",
19+
use_pipfile=True,
2520
)

packages/sdk/typescript/human-protocol-sdk/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@human-protocol/sdk",
33
"description": "Human Protocol SDK",
4-
"version": "1.0.3",
4+
"version": "1.0.9",
55
"files": [
66
"src",
77
"dist"
@@ -38,8 +38,10 @@
3838
"dependencies": {
3939
"@human-protocol/core": "*",
4040
"aws-sdk": "^2.1255.0",
41+
"axios": "^1.4.0",
4142
"crypto": "^1.0.1",
4243
"ethers": "^5.7.2",
44+
"minio": "^7.0.32",
4345
"secp256k1": "^4.0.3",
4446
"vitest": "^0.30.1",
4547
"winston": "^3.8.2"

packages/sdk/typescript/human-protocol-sdk/src/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ export const NETWORKS: {
217217
scanUrl: '',
218218
factoryAddress: '0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9',
219219
hmtAddress: '0x5FbDB2315678afecb367f032d93F642f64180aa3',
220-
stakingAddress: '0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512',
220+
stakingAddress: '0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0',
221221
kvstoreAddress: '0x5FC8d32690cc91D4c39d9d3abcBD16989F875707',
222222
subgraphUrl: '',
223223
oldSubgraphUrl: '',

packages/sdk/typescript/human-protocol-sdk/src/escrow.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,15 @@ export default class EscrowClient {
9696
)
9797
).wait();
9898

99-
if (!result.events || !result.events[0] || !result.events[0].args) {
99+
const event = result.events?.find(({ topics }) =>
100+
topics.includes(ethers.utils.id('Launched(address,address)'))
101+
)?.args;
102+
103+
if (!event) {
100104
throw ErrorLaunchedEventIsNotEmitted;
101105
}
102106

103-
return result.events[0].args[1];
107+
return event.escrow;
104108
} catch (e: any) {
105109
return throwError(e);
106110
}

packages/sdk/typescript/human-protocol-sdk/test/escrow.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,9 @@ describe('EscrowClient', () => {
145145
wait: async () => ({
146146
events: [
147147
{
148+
topics: [ethers.utils.id('Launched(address,address)')],
148149
args: {
149-
1: expectedEscrowAddress,
150+
escrow: expectedEscrowAddress,
150151
},
151152
},
152153
],

0 commit comments

Comments
 (0)