neuronum 5.0.0__py3-none-any.whl → 5.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of neuronum might be problematic. Click here for more details.
- neuronum/neuronum.py +14 -20
- {neuronum-5.0.0.dist-info → neuronum-5.0.1.dist-info}/METADATA +1 -1
- neuronum-5.0.1.dist-info/RECORD +10 -0
- neuronum-5.0.0.dist-info/RECORD +0 -10
- {neuronum-5.0.0.dist-info → neuronum-5.0.1.dist-info}/WHEEL +0 -0
- {neuronum-5.0.0.dist-info → neuronum-5.0.1.dist-info}/entry_points.txt +0 -0
- {neuronum-5.0.0.dist-info → neuronum-5.0.1.dist-info}/licenses/LICENSE +0 -0
- {neuronum-5.0.0.dist-info → neuronum-5.0.1.dist-info}/top_level.txt +0 -0
neuronum/neuronum.py
CHANGED
|
@@ -164,7 +164,6 @@ class Cell:
|
|
|
164
164
|
|
|
165
165
|
async def activate_tx(self, txID: str, data: dict):
|
|
166
166
|
url = f"https://{self.network}/api/activate_tx/{txID}"
|
|
167
|
-
|
|
168
167
|
TX = {
|
|
169
168
|
"data": data,
|
|
170
169
|
"cell": self.to_dict()
|
|
@@ -173,18 +172,15 @@ class Cell:
|
|
|
173
172
|
async with aiohttp.ClientSession() as session:
|
|
174
173
|
try:
|
|
175
174
|
async with session.post(url, json=TX) as response:
|
|
176
|
-
response.raise_for_status()
|
|
177
175
|
response.raise_for_status()
|
|
178
176
|
data = await response.json()
|
|
179
177
|
if data["success"] == "activated":
|
|
180
178
|
async for operation in self.sync():
|
|
181
179
|
label = operation.get("label")
|
|
182
|
-
if label == "tx_response":
|
|
183
|
-
|
|
184
|
-
if
|
|
185
|
-
|
|
186
|
-
return tx_response
|
|
187
|
-
|
|
180
|
+
if label == "tx_response":
|
|
181
|
+
operation_txID = operation.get("txID")
|
|
182
|
+
if operation_txID == txID:
|
|
183
|
+
return operation.get("data")
|
|
188
184
|
else:
|
|
189
185
|
print(data["success"], data["message"])
|
|
190
186
|
|
|
@@ -194,29 +190,27 @@ class Cell:
|
|
|
194
190
|
print(f"Unexpected error: {e}")
|
|
195
191
|
|
|
196
192
|
|
|
197
|
-
async def tx_response(self, txID: str,
|
|
193
|
+
async def tx_response(self, txID: str, client: str, data: dict):
|
|
198
194
|
url = f"https://{self.network}/api/tx_response/{txID}"
|
|
199
195
|
|
|
200
196
|
tx_response = {
|
|
201
|
-
"
|
|
202
|
-
"operationID": operationID,
|
|
197
|
+
"client": client,
|
|
203
198
|
"data": data,
|
|
204
199
|
"cell": self.to_dict()
|
|
205
200
|
}
|
|
206
201
|
|
|
207
202
|
async with aiohttp.ClientSession() as session:
|
|
208
|
-
|
|
209
|
-
|
|
203
|
+
try:
|
|
204
|
+
for _ in range(2):
|
|
210
205
|
async with session.post(url, json=tx_response) as response:
|
|
211
206
|
response.raise_for_status()
|
|
212
207
|
data = await response.json()
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
print(data["message"])
|
|
208
|
+
print(data["message"])
|
|
209
|
+
|
|
210
|
+
except aiohttp.ClientError as e:
|
|
211
|
+
print(f"Error sending request: {e}")
|
|
212
|
+
except Exception as e:
|
|
213
|
+
print(f"Unexpected error: {e}")
|
|
220
214
|
|
|
221
215
|
|
|
222
216
|
async def create_ctx(self, descr: str, partners: list):
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
cli/main.py,sha256=g7Y-W1G7C1firXHsEnBFyqa52nSk6GVzcax_6up0Ezg,24991
|
|
3
|
+
neuronum/__init__.py,sha256=Drsm263_w3_VWgl1YsKLUr8WwVodqV3TSjqpxLjyq_M,46
|
|
4
|
+
neuronum/neuronum.py,sha256=qzxc9csSEnGX8wRC_14vzjJPQsCTC8wswhXno1Ih_Xw,17166
|
|
5
|
+
neuronum-5.0.1.dist-info/licenses/LICENSE,sha256=UiZjNHiCyRP6WoZfbYQh9cv4JW96wIofKXmzBJrYSUk,1125
|
|
6
|
+
neuronum-5.0.1.dist-info/METADATA,sha256=pxMNkUpve0FgezRiZLDm3c-mboVYt3TGmGY8Cnut1ns,2883
|
|
7
|
+
neuronum-5.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
8
|
+
neuronum-5.0.1.dist-info/entry_points.txt,sha256=XKYBcRNxGeJpZZkDPsa8HA_RaJ7Km_R_JaUq5T9Nk2U,42
|
|
9
|
+
neuronum-5.0.1.dist-info/top_level.txt,sha256=ru8Fr84cHm6oHr_DcJ8-uaq3RTiuCRFIr6AC8V0zPu4,13
|
|
10
|
+
neuronum-5.0.1.dist-info/RECORD,,
|
neuronum-5.0.0.dist-info/RECORD
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
cli/main.py,sha256=g7Y-W1G7C1firXHsEnBFyqa52nSk6GVzcax_6up0Ezg,24991
|
|
3
|
-
neuronum/__init__.py,sha256=Drsm263_w3_VWgl1YsKLUr8WwVodqV3TSjqpxLjyq_M,46
|
|
4
|
-
neuronum/neuronum.py,sha256=t1BDzFDzbq9kQN7RSFIagctSGWOoP5MewjpauJxhH5k,17511
|
|
5
|
-
neuronum-5.0.0.dist-info/licenses/LICENSE,sha256=UiZjNHiCyRP6WoZfbYQh9cv4JW96wIofKXmzBJrYSUk,1125
|
|
6
|
-
neuronum-5.0.0.dist-info/METADATA,sha256=KkMqALQtmMd_2gnstSXwjqx2AvkegZr-26c1oBXAHao,2883
|
|
7
|
-
neuronum-5.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
8
|
-
neuronum-5.0.0.dist-info/entry_points.txt,sha256=XKYBcRNxGeJpZZkDPsa8HA_RaJ7Km_R_JaUq5T9Nk2U,42
|
|
9
|
-
neuronum-5.0.0.dist-info/top_level.txt,sha256=ru8Fr84cHm6oHr_DcJ8-uaq3RTiuCRFIr6AC8V0zPu4,13
|
|
10
|
-
neuronum-5.0.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|