- Upgrade to DuniterPy v1.0.0rc0
- Remove
asynctest
andpytest-asyncio
no longer required dependencies - Handle DuniterPy v1.0 Documents BBC
- Refactor
test_generate_and_send_transaction()
- Implement generic
send_document()
- Remove
async
/await
keywords fromtests/test_*.py
- Remove
async
kw fromtests/patched
-
wot
: Handle 404 error not found exception - Remove
client.close()
now in DuniterPy - Remove
aiohttp
module usage - Remove
async
/await
keywords
Close #3 (closed), #260 (closed), #390 (closed), #396 (closed), #407 (closed).
Merge request reports
Activity
changed milestone to %0.10.0
- Resolved by Moul
added 36 commits
-
8b8d3d13...dcd372b3 - 24 commits from branch
dev
- 2e173c93 - [mod] #396 (closed): Remove async/await keywords
- 194ee898 - [mod] #396 (closed): Remove aiohttp module usage
- da369640 - [mod] #396 (closed): Remove client.close() now in DuniterPy
- 6cfdc8c4 - [mod] #396 (closed): wot_tools: Handle 404 error not found exception
- ae132b2c - [mod] #396 (closed): Remove async kw from tests/patched
- d536c466 - [test] #396 (closed): Remove async/await kw from tests/test_*.py
- 31f7dfd4 - [enh] #390 (closed), #396 (closed): Implement generic send_document()
- 9323f9d1 - [test] #396 (closed): Refactor test_generate_and_send_transaction()
- 17c6fa17 - [test] #396 (closed): Add test_send_document()
- b78ba3ef - [ci][wip] Install git on the containers for the test to install DuniterPy git
- 821aba29 - [dep][temporal] #396 (closed): Use DuniterPy from git repository, dev branch
- fb6368ba - [dep] #396 (closed): Remove asynctest and pytest-asyncio no longer required deps
Toggle commit list-
8b8d3d13...dcd372b3 - 24 commits from branch
added 19 commits
-
fb6368ba...ce98c778 - 7 commits from branch
dev
- 9e1a2dde - [mod] #396 (closed): Remove async/await keywords
- 7fb04077 - [mod] #396 (closed): Remove aiohttp module usage
- 7dd5bc92 - [mod] #396 (closed): Remove client.close() now in DuniterPy
- 02debefd - [mod] #396 (closed): wot_tools: Handle 404 error not found exception
- a452dfb9 - [mod] #396 (closed): Remove async kw from tests/patched
- 4b2db8d3 - [test] #396 (closed): Remove async/await kw from tests/test_*.py
- 4290b9be - [enh] #390 (closed), #396 (closed): Implement generic send_document()
- 185d620e - [test] #396 (closed): Refactor test_generate_and_send_transaction()
- 4a2c25a5 - [test] #396 (closed): Add test_send_document()
- 7dfd00ee - [ci][wip] Install git on the containers for the test to install DuniterPy git
- 4a94af76 - [dep][temporal] #396 (closed): Use DuniterPy from git repository, dev branch
- f0bae927 - [dep] #396 (closed): Remove asynctest and pytest-asyncio no longer required deps
Toggle commit list-
fb6368ba...ce98c778 - 7 commits from branch
changed title from Draft: #396 (closed): Remove asynchronous property to Draft: #390, #396 (closed): Remove asynchronous property
changed title from Draft: #390 (closed), #396 (closed): Remove asynchronous property to Draft: #390 (closed), #396 (closed), #407: Remove asynchronous property
changed title from Draft: #390 (closed), #396 (closed), #407 (closed): Remove asynchronous property to Draft: #390 (closed), #396 (closed), #407 (closed): Drop async, send_doc(), Documents BBC
added 24 commits
-
f0bae927...a52f364a - 11 commits from branch
dev
- 86d81098 - [mod] #396 (closed): Remove async/await keywords
- 80cf287e - [mod] #396 (closed): Remove aiohttp module usage
- 37c5f0c8 - [mod] #396 (closed): Remove client.close() now in DuniterPy
- 4d8726c7 - [mod] #396 (closed): wot_tools: Handle 404 error not found exception
- fa0b6cac - [mod] #396 (closed): Remove async kw from tests/patched
- fe9427b9 - [test] #396 (closed): Remove async/await kw from tests/test_*.py
- ec143800 - [enh] #390 (closed), #396 (closed): Implement generic send_document()
- 06a48c47 - [test] #396 (closed): Refactor test_generate_and_send_transaction()
- 9211e860 - [test] #396 (closed): Add test_send_document()
- 662a83a7 - [mod] #407 (closed): Handle DuniterPy v1.0 Documents BBC
- af15e5c9 - [mod] test_membership_cmd: always success status code
- 4286859f - [dep] #396 (closed): Remove asynctest and pytest-asyncio no longer required deps
- f393c3e7 - [dep] #396 (closed): Upgrade to DuniterPy v1.0.0rc0
Toggle commit list-
f0bae927...a52f364a - 11 commits from branch
added 24 commits
-
f0bae927...a52f364a - 11 commits from branch
dev
- 86d81098 - [mod] #396 (closed): Remove async/await keywords
- 80cf287e - [mod] #396 (closed): Remove aiohttp module usage
- 37c5f0c8 - [mod] #396 (closed): Remove client.close() now in DuniterPy
- 4d8726c7 - [mod] #396 (closed): wot_tools: Handle 404 error not found exception
- fa0b6cac - [mod] #396 (closed): Remove async kw from tests/patched
- fe9427b9 - [test] #396 (closed): Remove async/await kw from tests/test_*.py
- ec143800 - [enh] #390 (closed), #396 (closed): Implement generic send_document()
- 06a48c47 - [test] #396 (closed): Refactor test_generate_and_send_transaction()
- 9211e860 - [test] #396 (closed): Add test_send_document()
- 662a83a7 - [mod] #407 (closed): Handle DuniterPy v1.0 Documents BBC
- af15e5c9 - [mod] test_membership_cmd: always success status code
- 4286859f - [dep] #396 (closed): Remove asynctest and pytest-asyncio no longer required deps
- f393c3e7 - [dep] #396 (closed): Upgrade to DuniterPy v1.0.0rc0
Toggle commit list-
f0bae927...a52f364a - 11 commits from branch
added 4 commits
- c9d0ee14 - [mod] #407 (closed): Handle DuniterPy v1.0 Documents BBC
- 6fb9fcdf - [mod] test_membership_cmd: always success status code
- d0276c78 - [dep] #396 (closed): Remove asynctest and pytest-asyncio no longer required deps
- 9021f16f - [dep] #396 (closed): Upgrade to DuniterPy v1.0.0rc1
Toggle commit listassigned to @moul and unassigned @matograine
added 14 commits
-
4b7baa8e - 1 commit from branch
dev
- 68dc2189 - [mod] #396 (closed): Remove async/await keywords
- 3ee05299 - [mod] #396 (closed): Remove aiohttp module usage
- dec70273 - [mod] #396 (closed): Remove client.close() now in DuniterPy
- b906f787 - [mod] #396 (closed): wot_tools: Handle 404 error not found exception
- cf3efcea - [mod] #396 (closed): Remove async kw from tests/patched
- a9c902ed - [test] #396 (closed): Remove async/await kw from tests/test_*.py
- 5dc33eaa - [enh] #390 (closed), #396 (closed): Implement generic send_document()
- 6783ba93 - [test] #396 (closed): Refactor test_generate_and_send_transaction()
- 60007526 - [test] #396 (closed): Add test_send_document()
- a7460221 - [mod] #407 (closed): Handle DuniterPy v1.0 Documents BBC
- ce759a4e - [mod] test_membership_cmd: always success status code
- fa804953 - [dep] #396 (closed): Remove asynctest and pytest-asyncio no longer required deps
- cdc59c7f - [dep] #396 (closed): Upgrade to DuniterPy v1.0.0rc1
Toggle commit list-
4b7baa8e - 1 commit from branch
63 65 class ClientInstance: 64 66 def __init__(self): 65 67 self.client = Client(EndPoint().BMA_ENDPOINT) 68 69 70 def send_document(bma_path, document): 71 client = ClientInstance().client 72 doc_name = document.__class__.__name__ 73 try: 74 client(bma_path, document.signed_raw()) 75 print(f"{doc_name} successfully sent") 76 except urllib.error.HTTPError as e: 77 print(f"Error while publishing {doc_name.lower()}: {e}") Thanks for that! We could replace this
print()
withsys.exit()
. I am just afraid it could cause issue in thetx
command, since the algorithm is stopped, and therefore the other intermediaries tx are not sent. What do you think? Havingexit()
s everywhere is also something I want to avoid, in case Silkaj turns into a GUI client. But, you are right for a CLI client, this error should be reported as an exit code in the shell it's running in.In case we are not sure about
tx
command and havingsys.exit()
down in the hierarchy in base functions, we could handle it outside, but it's less elegant, so we can decide on each case whether we want to exit or not the program based on the raised exception:def send_document(bma_path, document): client = ClientInstance().client doc_name = document.__class__.__name__ client(bma_path, document.signed_raw()) print(f"{doc_name} successfully sent") # send document cmd try: send_document(bma_path, document) except urllib.error.HTTPError as e: sys.exit(f"Error while publishing {document.__class__.__name__.lower()}: {e}")
But, first, let's check for the tricky
tx
intermediaries transactions x)I checked. For
cert
,membership
, andrevocation
commands,send_document()
is at the end of execution of the command/main function. So, this is not a problem for them if there is asys.exit()
call.For
tx
command, in case of:- single tx: also at the end of hierarchy, same as the other cmds. Not problematic if it fails.
- intermediaries tx: a list of intermediaries tx are sent then the final tx. What could happen is that one of the intermediary tx fails to be sent to a Duniter node and exits the program. The planned tx after this one are not sent. This is fine if things get stopped/stuck here since this is summing up sources on to the issuer’s pubkey.
In summary, I think we a safe adding the
sys.exit()
call for all cases. Otherwise, I was thinking about something as follow:-def send_document(bma_path, document): +def send_document(bma_path, document, exit=True)": client = ClientInstance().client doc_name = document.__class__.__name__ try: client(bma_path, document.signed_raw()) print(f"{doc_name} successfully sent") except urllib.error.HTTPError as e: print(f"Error while publishing {doc_name.lower()}: {e}") + if exit: + sys.exit()
and call
send_document(bma_path, intermediary_tx, False)
for the intermediaries transactions.
Thanks for noticing this! It solves an issue I encountered I had with
membership
tests.For you to review: !196 (merged).