silkaj issueshttps://git.duniter.org/clients/python/silkaj/-/issues2022-10-27T18:20:45+02:00https://git.duniter.org/clients/python/silkaj/-/issues/438Add sleep() between identity_of() calls in a loop2022-10-27T18:20:45+02:00MoulAdd sleep() between identity_of() calls in a loop`blocks`, `history --uids`, and `transfer` commands are requesting in a loop `identity_of()` to get `uids` from pubkeys.
There is too much requests at the same time for BMA to answer. Adding a `time.sleep()` in between solves the issue t...`blocks`, `history --uids`, and `transfer` commands are requesting in a loop `identity_of()` to get `uids` from pubkeys.
There is too much requests at the same time for BMA to answer. Adding a `time.sleep()` in between solves the issue to retrieve the `uids` in order for not getting a broken state.
This is specially the case on local node.0.11.0MoulMoulhttps://git.duniter.org/clients/python/silkaj/-/issues/422excluded command displays information of an other identity sharing same uid/p...2022-03-28T19:50:49+02:00Moulexcluded command displays information of an other identity sharing same uid/pubkey, not the one excluded> https://forum.duniter.org/t/exclusions-de-la-toile-de-confiance-g1-test-expirations-des-statuts-de-membre/6554/94
DeathReaper displayed the information of the identity having `Michel`’s pubkey as uid.
The identity with `7iMn8o6neM6Cij...> https://forum.duniter.org/t/exclusions-de-la-toile-de-confiance-g1-test-expirations-des-statuts-de-membre/6554/94
DeathReaper displayed the information of the identity having `Michel`’s pubkey as uid.
The identity with `7iMn8o6neM6Cijd2gZzduvRm9LwMGWv5kCDKjek9jAsB` as uid was revoked while ago.
This is actually `Michel` which got excluded here, but not his information was displayed:
```md
### @7iMn8o6neM6Cijd2gZzduvRm9LwMGWv5kCDKjek9jAsB [7iMn8o6neM6Cijd2gZzduvRm9LwMGWv5kCDKjek9jAsB](https://g1-test.cesium.app/#/app/block/919762/000041B9A11F8EB4D963B34175DAC26A8961733CC37719BD7E2A4F05F50320CA?ssl=true)
* **Certifié·e par**.
* **Exclu·e le** vendredi 25 mars 2022 21:00 CET
* **Raison de l’exclusion** : manque de certifications
```0.10.0MoulMoulhttps://git.duniter.org/clients/python/silkaj/-/issues/421wot command can display membership status from an other identity sharing same...2022-03-29T11:22:34+02:00Moulwot command can display membership status from an other identity sharing same uid/pubkey> https://forum.duniter.org/t/exclusions-de-la-toile-de-confiance-g1-test-expirations-des-statuts-de-membre/6554/94
`Michel` is not revoked identity but the identity named with `Michel`’s pubkey as an uid:
```bash
silkaj -gt wot 7iMn8o6...> https://forum.duniter.org/t/exclusions-de-la-toile-de-confiance-g1-test-expirations-des-statuts-de-membre/6554/94
`Michel` is not revoked identity but the identity named with `Michel`’s pubkey as an uid:
```bash
silkaj -gt wot 7iMn8o6neM6Cijd2gZzduvRm9LwMGWv5kCDKjek9jAsB
| id | uid | pubkey | timestamp |
|------+----------------------------------------------+--------------------------------------------------+-----------------------|
| 00 | 7iMn8o6neM6Cijd2gZzduvRm9LwMGWv5kCDKjek9jAsB | 6hb7fCQdoXXhGjFZPjTWDKBDxUCn1t3EEgCYLT4Yer6u:Bqb | 700558-0000E40953C06… |
| 10 | Michel | 7iMn8o6neM6Cijd2gZzduvRm9LwMGWv5kCDKjek9jAsB:5pC | 665990-0000F7165C988… |
Which identity would you like to select (id)?: 10
Michel (7iMn8o6n…:5pC) from block #665990-0000F716…
received 6 and sent 15/100 certifications:
| received_expire | received | sent | sent_expire |
|-------------------+-------------+-------------------+-------------------|
| November 16, 2021 | Dagobert | cgeek-4 | November 11, 2021 |
| March 7, 2022 | jytou4-test | jytou5-test | November 11, 2021 |
| March 7, 2022 | jytou3-test | Maaltest2 | November 11, 2021 |
| March 13, 2022 | jytou-test | matograine-G1Test | November 12, 2021 |
| March 13, 2022 | jytou2-test | Claude2 | November 12, 2021 |
| March 13, 2022 | jytou6-test | jytou3-test | January 9, 2022 |
| | | jytou2-test | January 9, 2022 |
| | | moul-test | January 9, 2022 |
| | | cgeek | January 9, 2022 |
| | | jytou4-test | January 9, 2022 |
| | | jytou6-test | January 9, 2022 |
| | | Vincentest | January 9, 2022 |
| | | vit2 | January 10, 2022 |
| | | jytou-test | January 10, 2022 |
| | | Maaltest3 | January 10, 2022 |
✔: Certification available to be written or already written into the blockchain
Membership expiration due to certification expirations: March 7, 2022
member: False
revoked: True
revoked on: June 27, 2021
expired: False
wasMember: True
```0.10.0MoulMoulhttps://git.duniter.org/clients/python/silkaj/-/issues/411command `blocks` fails2022-10-27T18:21:34+02:00matograinecommand `blocks` failsI meet an error I don't understand.
On the 30/09/2021 on branch dev at commit [60eb5d](https://git.duniter.org/clients/python/silkaj/-/commit/60eb5dc2d80485d8ff7df777a52ab361a1e92c12). On Linux Mint 20.1 Ulyssa
I can reach nodes. `silka...I meet an error I don't understand.
On the 30/09/2021 on branch dev at commit [60eb5d](https://git.duniter.org/clients/python/silkaj/-/commit/60eb5dc2d80485d8ff7df777a52ab361a1e92c12). On Linux Mint 20.1 Ulyssa
I can reach nodes. `silkaj info` works.
However, `silkaj blocks` does not :
```python
$ silkaj blocks
Traceback (most recent call last):
File "/home/thomas/.cache/pypoetry/virtualenvs/silkaj-hneDEFxq-py3.8/bin/silkaj", line 5, in <module>
cli()
File "/home/thomas/.cache/pypoetry/virtualenvs/silkaj-hneDEFxq-py3.8/lib/python3.8/site-packages/click/core.py", line 1134, in __call__
return self.main(*args, **kwargs)
File "/home/thomas/.cache/pypoetry/virtualenvs/silkaj-hneDEFxq-py3.8/lib/python3.8/site-packages/click/core.py", line 1059, in main
rv = self.invoke(ctx)
File "/home/thomas/.cache/pypoetry/virtualenvs/silkaj-hneDEFxq-py3.8/lib/python3.8/site-packages/click/core.py", line 1665, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/thomas/.cache/pypoetry/virtualenvs/silkaj-hneDEFxq-py3.8/lib/python3.8/site-packages/click/core.py", line 1401, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/thomas/.cache/pypoetry/virtualenvs/silkaj-hneDEFxq-py3.8/lib/python3.8/site-packages/click/core.py", line 767, in invoke
return __callback(*args, **kwargs)
File "/home/thomas/Documents/Duniter/silkaj/silkaj/commands.py", line 159, in list_blocks
idty = identity_of(issuer["pubkey"])
File "/home/thomas/Documents/Duniter/silkaj/silkaj/wot_tools.py", line 33, in identity_of
return client(wot.identity_of, pubkey_uid)
File "/home/thomas/.cache/pypoetry/virtualenvs/silkaj-hneDEFxq-py3.8/lib/python3.8/site-packages/duniterpy/api/client.py", line 455, in __call__
return _function(self, *args, **kwargs)
File "/home/thomas/.cache/pypoetry/virtualenvs/silkaj-hneDEFxq-py3.8/lib/python3.8/site-packages/duniterpy/api/bma/wot.py", line 350, in identity_of
return client.get(MODULE + "/identity-of/%s" % search, schema=IDENTITY_OF_SCHEMA)
File "/home/thomas/.cache/pypoetry/virtualenvs/silkaj-hneDEFxq-py3.8/lib/python3.8/site-packages/duniterpy/api/client.py", line 372, in get
return client.request_url(
File "/home/thomas/.cache/pypoetry/virtualenvs/silkaj-hneDEFxq-py3.8/lib/python3.8/site-packages/duniterpy/api/client.py", line 260, in request_url
with request.urlopen(
File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.8/urllib/request.py", line 531, in open
response = meth(req, response)
File "/usr/lib/python3.8/urllib/request.py", line 640, in http_response
response = self.parent.error(
File "/usr/lib/python3.8/urllib/request.py", line 569, in error
return self._call_chain(*args)
File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
result = func(*args)
File "/usr/lib/python3.8/urllib/request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 503: Service Unavailable
```0.11.0MoulMoulhttps://git.duniter.org/clients/python/silkaj/-/issues/392Ğ1 monetary license files not included into the Python package2022-03-28T19:29:29+02:00MoulĞ1 monetary license files not included into the Python package### Problem
Since the project started to distribute Python packages with Pipenv from v0.6.0 with the [`setup.py`](https://git.duniter.org/clients/python/silkaj/-/blob/v0.6.0/setup.py) and then with Poetry, it seems the `licence-G1` folde...### Problem
Since the project started to distribute Python packages with Pipenv from v0.6.0 with the [`setup.py`](https://git.duniter.org/clients/python/silkaj/-/blob/v0.6.0/setup.py) and then with Poetry, it seems the `licence-G1` folder was never included into the Python package. That's a shame, I am surprised no one ever reported this issue before.
I never experienced it most likely because it might come from the fact that an import from an other Silkaj source would provide the licenses files.
### Solution
- [x] Into the `pyproject.toml` include `g1_monetary_license` folder using the [`include` attribute](https://python-poetry.org/docs/pyproject/#include-and-exclude)0.10.0MoulMoulhttps://git.duniter.org/clients/python/silkaj/-/issues/385id/lookup command does not display the non-member uids2021-04-07T18:57:50+02:00Kapisid/lookup command does not display the non-member uidsif I try to find "silkaj id titi"
it will show me:
```
→ 9zHLPCPwEH37wDfPpPoajt7zxP13xKFr5n9HY2CYtBEq:CPg
→ 4qJZFRfArLaUMEXDhsd69unsKynEFNLFazAVij4HNsBa:F4z
→ 4LCdTC9QsmqbFSHAhyaqGdDCVPr8Ywu2DZ8hDCzkdx4n:8ta
→ CehfxBHrowP6tXouR73GS52Q...if I try to find "silkaj id titi"
it will show me:
```
→ 9zHLPCPwEH37wDfPpPoajt7zxP13xKFr5n9HY2CYtBEq:CPg
→ 4qJZFRfArLaUMEXDhsd69unsKynEFNLFazAVij4HNsBa:F4z
→ 4LCdTC9QsmqbFSHAhyaqGdDCVPr8Ywu2DZ8hDCzkdx4n:8ta
→ CehfxBHrowP6tXouR73GS52QhGAoNMtabooKbCvT7f3j:6cG ↔ Laetiti974
→ FtZdA1HzHcDG6utoEgg6R5jjXfEne2ftS2UzvXajKurp:6Sm
→ EUn8uLJxgc3fVXJ1fBA74re4iD4Ws8Nk2xHytX1wLMfK:AQ2 ↔ LaetitiaCarivenc
→ HqHZt9J1U7MwC3RF1bSjPgxACsTypfNjUThYFMZZfK6X:Dk1 ↔ LaetitiaHOFF
→ 5Vcm1zkHKoAMo9yy7Lk2HDX2Yn54agavtEUdrcFNmqkP:8mU ↔ laetitiajanot
→ BfncGdTeq8qvhPZnBaM8T76SHM9xfx78ASRNZtGp64rZ:7tP
→ BWKuSHYojjwzAXZZxSFTf5XVWneUMZqoWGUJEfWaFRL9:21F ↔ titi43
```
but actually the BfncGdTeq8qvhPZnBaM8T76SHM9xfx78ASRNZtGp64rZ pubkey was revoked as we can see here and it had the 'titi' username registered in the blockchain, see here:
https://demo.cesium.app/#/app/wot/BfncGdTeq8qvhPZnBaM8T76SHM9xfx78ASRNZtGp64rZ/titi
![image](/uploads/c49ca8902f7bafd89042d13f52a2c43e/image.png)
could silkaj show those usernames in the same way that it shows for the other actives?
Thanks.0.9.0MoulMoulhttps://git.duniter.org/clients/python/silkaj/-/issues/368Assertions are not tested when testing system exit2021-03-22T17:30:46+01:00matograineAssertions are not tested when testing system exitHere is a modification of test_unit_tx.py that still pass, but should not (I added an `assert False`):
```python
# compute_amounts()
def test_compute_amounts_errors(capsys):
trials = (((0.0031, 1), 314),)
for trial in trials:
...Here is a modification of test_unit_tx.py that still pass, but should not (I added an `assert False`):
```python
# compute_amounts()
def test_compute_amounts_errors(capsys):
trials = (((0.0031, 1), 314),)
for trial in trials:
# check program exit on error
with pytest.raises(SystemExit) as pytest_exit:
# read output to check error.
tx.compute_amounts(
trial[0],
trial[1],
)
expected_error = "Error: amount {0} is too low.".format(trial[0][0])
assert capsys.readouterr() == expected_error
# Assert False to show there is a bug in this kind of context
assert False
assert pytest_exit.type == SystemExit
```
It means that basically, all assertions in a context like `with pytest.raises(SystemExit) as pytest_exit:` are not tested if ther is a `message_exit()`, because the function exits first.
I don't know how to solve it for now.0.9.0matograinematograinehttps://git.duniter.org/clients/python/silkaj/-/issues/366Fix wrong DuniterError exception handling in wot.identity_of2021-03-22T17:29:44+01:00atraxFix wrong DuniterError exception handling in wot.identity_ofIn `silkaj.wot.identity_of`, `e` is given as a parameter to `DuniterError()` which in turn raises a `TypeError` exception.
This issue is blocking the completion of #300 and could be fixed by [deleting these two lines](https://git.dunit...In `silkaj.wot.identity_of`, `e` is given as a parameter to `DuniterError()` which in turn raises a `TypeError` exception.
This issue is blocking the completion of #300 and could be fixed by [deleting these two lines](https://git.duniter.org/clients/python/silkaj/-/blob/dev/silkaj/wot.py#L249-250) altogether.
```
silkaj/silkaj [300_balance_display_uid●] » poetry run silkaj -p gtest.jytou.fr balance BFb5yv8z1fowR6Z8mBXTALy5z7gHfMU976WtXhmRsUMh
Traceback (most recent call last):
File "/home/atrax/Temporary/20201109_silkaj/silkaj/silkaj/wot.py", line 248, in identity_of
return await client(wot.identity_of, pubkey_uid)
File "/home/atrax/.cache/pypoetry/virtualenvs/silkaj-sNbSk8v7-py3.9/lib/python3.9/site-packages/duniterpy/api/bma/wot.py", line 355, in identity_of
return await client.get(
File "/home/atrax/.cache/pypoetry/virtualenvs/silkaj-sNbSk8v7-py3.9/lib/python3.9/site-packages/duniterpy/api/client.py", line 428, in get
response = await client.requests_get(url_path, **params)
File "/home/atrax/.cache/pypoetry/virtualenvs/silkaj-sNbSk8v7-py3.9/lib/python3.9/site-packages/duniterpy/api/client.py", line 265, in requests_get
raise DuniterError(error_data)
duniterpy.api.errors.DuniterError: Error code 2004 - No member matching this pubkey or uid
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/atrax/.cache/pypoetry/virtualenvs/silkaj-sNbSk8v7-py3.9/lib/python3.9/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/home/atrax/.cache/pypoetry/virtualenvs/silkaj-sNbSk8v7-py3.9/lib/python3.9/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/home/atrax/.cache/pypoetry/virtualenvs/silkaj-sNbSk8v7-py3.9/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/atrax/.cache/pypoetry/virtualenvs/silkaj-sNbSk8v7-py3.9/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/atrax/.cache/pypoetry/virtualenvs/silkaj-sNbSk8v7-py3.9/lib/python3.9/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/atrax/.cache/pypoetry/virtualenvs/silkaj-sNbSk8v7-py3.9/lib/python3.9/site-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/atrax/Temporary/20201109_silkaj/silkaj/silkaj/tools.py", line 53, in wrapper
return loop.run_until_complete(f(*args, **kwargs))
File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
File "/home/atrax/Temporary/20201109_silkaj/silkaj/silkaj/money.py", line 71, in cmd_amount
uid = (await identity_of(pubkey))["uid"]
File "/home/atrax/Temporary/20201109_silkaj/silkaj/silkaj/wot.py", line 250, in identity_of
raise DuniterError(e)
File "/home/atrax/.cache/pypoetry/virtualenvs/silkaj-sNbSk8v7-py3.9/lib/python3.9/site-packages/duniterpy/api/errors.py", line 30, in __init__
super().__init__("Error code {0} - {1}".format(data["ucode"], data["message"]))
TypeError: 'DuniterError' object is not subscriptable
ERROR:asyncio:Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7f57275ad6d0>
ERROR:asyncio:Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x7f572754d4c0>, 28159.495414517)]']
connector: <aiohttp.connector.TCPConnector object at 0x7f57275ad730>
```0.9.0atraxatraxhttps://git.duniter.org/clients/python/silkaj/-/issues/360jsonschema.exceptions.ValidationError: Could not parse json2020-12-06T15:25:52+01:00pokajsonschema.exceptions.ValidationError: Could not parse jsonSince I installed version 0.8.0 on my Mint 20, I got this error when I try to use Silkaj:
```
$ silkaj id poka
Traceback (most recent call last):
File "/home/poka/.local/lib/python3.8/site-packages/duniterpy/api/client.py", line 89, i...Since I installed version 0.8.0 on my Mint 20, I got this error when I try to use Silkaj:
```
$ silkaj id poka
Traceback (most recent call last):
File "/home/poka/.local/lib/python3.8/site-packages/duniterpy/api/client.py", line 89, in parse_response
data = json.loads(response)
File "/usr/lib/python3.8/json/__init__.py", line 357, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.8/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/poka/.local/bin/silkaj", line 8, in <module>
sys.exit(cli())
File "/home/poka/.local/lib/python3.8/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/home/poka/.local/lib/python3.8/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/home/poka/.local/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/poka/.local/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/poka/.local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/poka/.local/lib/python3.8/site-packages/silkaj/tools.py", line 53, in wrapper
return loop.run_until_complete(f(*args, **kwargs))
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "/home/poka/.local/lib/python3.8/site-packages/silkaj/wot.py", line 182, in id_pubkey_correspondence
pubkeys = await wot_lookup(id_pubkey)
File "/home/poka/.local/lib/python3.8/site-packages/silkaj/wot.py", line 274, in wot_lookup
results = await client(wot.lookup, identifier)
File "/home/poka/.local/lib/python3.8/site-packages/duniterpy/api/client.py", line 455, in __call__
return _function(self, *args, **kwargs)
File "/home/poka/.local/lib/python3.8/site-packages/duniterpy/api/bma/wot.py", line 282, in lookup
return client.get(MODULE + "/lookup/%s" % search, schema=LOOKUP_SCHEMA)
File "/home/poka/.local/lib/python3.8/site-packages/duniterpy/api/client.py", line 372, in get
return client.request_url(
File "/home/poka/.local/lib/python3.8/site-packages/duniterpy/api/client.py", line 285, in request_url
parse_response(content, schema)
File "/home/poka/.local/lib/python3.8/site-packages/duniterpy/api/client.py", line 94, in parse_response
raise jsonschema.ValidationError(
jsonschema.exceptions.ValidationError: Could not parse json : Expecting value: line 1 column 1 (char 0)
```
Maybe it's due to my environment, but I don't understand what's wrong.0.8.xMoulMoulhttps://git.duniter.org/clients/python/silkaj/-/issues/358Unable to have a working installation: libnacl issue − poetry install2020-11-30T21:48:53+01:00Andréas LivetUnable to have a working installation: libnacl issue − poetry installI'm unable to get Silkaj working with Ubuntu 18.04 (with python 3.6.9 and pip 9.0.1)
I tried to install it with pip3 :
`pip3 install silkaj --user`
And run it with :
`~/.local/bin/silkaj`
But got an error with libnacl which is used b...I'm unable to get Silkaj working with Ubuntu 18.04 (with python 3.6.9 and pip 9.0.1)
I tried to install it with pip3 :
`pip3 install silkaj --user`
And run it with :
`~/.local/bin/silkaj`
But got an error with libnacl which is used by DuniterPy :
> File "/home/dede/.local/lib/python3.6/site-packages/duniterpy/key/ascii_armor.py", line 17, in <module>
VERSION_FIELD_VALUE = "Python Libnacl " + libnacl.__version__
AttributeError: module 'libnacl' has no attribute '__version__'
Tried to install libnacl via `apt` but pip does not use it.
I don't understand why `__version__` is not present in pip version of libnacl.
Here is what `print(libnacl.__file__)` tells me :
> /home/dede/.local/lib/python3.6/site-packages/libnacl/__init__.py
Which seems to be OK.
I tried to uninstall and reinstall libnacl but got the same problem.
So, I tried to install it locally via poetry (don't know this tool) and seems that dependencies are not installed...
When I tried :
`~/.local/bin/poetry run silkaj`
I got this error :
`ModuleNotFoundError: No module named 'click'`
Despite the fact that click is installed (at least via pip)...
I'm not a python expert, but I used pip for projects which uses click and didn't have any of those problems...
If someone can put me to the right direction it would be great.
Thanks,
Andréas0.8.xmatograinematograinehttps://git.duniter.org/clients/python/silkaj/-/issues/356Useless change transactions2021-03-13T13:33:05+01:00matograineUseless change transactionsWhile using Silkaj on GTest on a member account, I encountered a strange behavior. A lot of change transactions happened before my actual tx was sent. Each of these change txs gathered the necessary amount for the TX, .
To reproduce : s...While using Silkaj on GTest on a member account, I encountered a strange behavior. A lot of change transactions happened before my actual tx was sent. Each of these change txs gathered the necessary amount for the TX, .
To reproduce : send more than 40 UD from a member account. I have done it once, and you can observe on block [660862](https://g1-test.duniter.org/blockchain/block/660862) : 2 change txs ; only the 1st one is used in the final tx.
**Reason** :
* the result of tx/sources/<pubkey> is ordered as so :
* UDs first
* TX after
* the [get_sources()](https://git.duniter.org/clients/python/silkaj/-/blob/dev/silkaj/money.py#L113) function respects this order, and adds the pending transactions **after**.
**Solution(s)**
three solutions. What we want is that pending transactions should be considered first after a change transaction.
1. make money.get_sources add pending transaction **at the beginning of the sources list**. (not tested, just guessing)(needs few line change in the code)
2. make tx.get_list_input_for_transaction() reverse the list of inputs, in order to have pendings first.
3. call get_sources only once ; then write change txs and final tx we need ; then send it all to the node. (needs a lot of refactoring to the code)
___
* Solution 1 is easiest and for short-term. I plan to use it for #281. This means we use sources in this order : 1- pending, 2-UD, 3- TX on blockchain.
* I can use solution 2 as well if (for any reason) we don't want to change get_source() behavior. The source would be used as so : 1-pending, 2-TX on BC, 3- UD.
* Solution 3 is part of #172 : if we want to request sources only once, we will have to compute all txs before sending them.0.9.0matograinematograinehttps://git.duniter.org/clients/python/silkaj/-/issues/351Delete `blockchain verify` command2023-10-21T09:05:15+02:00MoulDelete `blockchain verify` commandOriginal title: tests are sometimes failing due to network outage
https://git.duniter.org/clients/python/silkaj/-/jobs/42791
```
FAILED tests/test_verify_blocks.py::test_get_chunks[2-1] - TypeError: 'NoneTy...
FAILED tests/test_verify_...Original title: tests are sometimes failing due to network outage
https://git.duniter.org/clients/python/silkaj/-/jobs/42791
```
FAILED tests/test_verify_blocks.py::test_get_chunks[2-1] - TypeError: 'NoneTy...
FAILED tests/test_verify_blocks.py::test_get_chunks[5-10] - TypeError: 'NoneT...
```0.12.0MoulMoulhttps://git.duniter.org/clients/python/silkaj/-/issues/345Inconsistent results with `id` command on an ex-member2021-04-07T18:58:37+02:00matograineInconsistent results with `id` command on an ex-memberWhen asking for old members, the results of `id` command are not consistent :
```bash
$ silkaj -gt id elois
Public keys found matching 'elois':
→ D7CYHJXjaH4j7zRdWngUbsURPnSnjsCYtvo6f8dvW3C
$ silkaj -gt id D7CYHJXjaH4j7zRdWngUbsURPnSn...When asking for old members, the results of `id` command are not consistent :
```bash
$ silkaj -gt id elois
Public keys found matching 'elois':
→ D7CYHJXjaH4j7zRdWngUbsURPnSnjsCYtvo6f8dvW3C
$ silkaj -gt id D7CYHJXjaH4j7zRdWngUbsURPnSnjsCYtvo6f8dvW3C
No matching identity
```
The cause is :
When we have a pubkey, silkaj uses the path wot/identity-of/, that returns "not a member".
When we have a uid, silkaj uses the path wot/lookup/, that returns a result for old members also.0.9.0MoulMoulhttps://git.duniter.org/clients/python/silkaj/-/issues/344Fix import loop issue2021-05-11T16:18:21+02:00MoulFix import loop issueThe following discussion from !143 should be addressed:
- @moul started a [discussion](https://git.duniter.org/clients/python/silkaj/-/merge_requests/143#note_23695): (+1 comment)
> Is there anything that can be done for this impo...The following discussion from !143 should be addressed:
- @moul started a [discussion](https://git.duniter.org/clients/python/silkaj/-/merge_requests/143#note_23695): (+1 comment)
> Is there anything that can be done for this import loop issue?
> Did you try to understand the importation process order?
> I haven't check in details, but this is usually due to a wrong architectural design.
---
- [x] Get rid of `convert_time()`, and generalize `pendulum` usage
- [x] Remove following weird imports:
```bash
grep -rnA1 "had to import" silkaj
silkaj/money.py:27:# had to import from wot to avoid loop dependencies
silkaj/money.py-28-from silkaj.wot import check_public_key
--
silkaj/auth.py:26:# had to import pubkey_with_checksum from wot to avoid loop dependency.
silkaj/auth.py-27-from silkaj.wot import pubkey_with_checksum
--
silkaj/wot.py-29-from silkaj.tui import convert_time, pubkey_with_checksum
```0.10.0matograinematograinehttps://git.duniter.org/clients/python/silkaj/-/issues/343Allow smaller base58 pubkeys2022-06-27T18:31:02+02:00matograineAllow smaller base58 pubkeysSee forum post : https://forum.duniter.org/t/clefs-publiques-commencant-par-1/7607/11
Conclusions are :
* base58 ed25519 pubkeys can be {41-44} characters long, maybe {40, 44}, maybe less. Silkaj handles {43, 44} long pubkeys : this is...See forum post : https://forum.duniter.org/t/clefs-publiques-commencant-par-1/7607/11
Conclusions are :
* base58 ed25519 pubkeys can be {41-44} characters long, maybe {40, 44}, maybe less. Silkaj handles {43, 44} long pubkeys : this is a bug, and should be addressed in 0.8.x.
* Duniter handles pubkeys with a "leading 1" differently from the same pubkey without the "leading 1", but they have the same binary representation. When this problem will be resolved on Duniter, I think we should agree with the devs of all clients to remove the "leading 1" when the clients produces such a pubkey.https://git.duniter.org/clients/python/silkaj/-/issues/336history: Pubkeys display issue with multisig txs2020-09-16T19:57:56+02:00matograinehistory: Pubkeys display issue with multisig txsVery specific issue, very low priority :-)
Using `history` command on the GTest account AhRMHUxMPXSeG7qXZrE6qCdjwK9p2bu5Eqei7xAWVEDK.
Sending multi-receiver tx has a nice display :
```
+---------------------+---------------------------...Very specific issue, very low priority :-)
Using `history` command on the GTest account AhRMHUxMPXSeG7qXZrE6qCdjwK9p2bu5Eqei7xAWVEDK.
Sending multi-receiver tx has a nice display :
```
+---------------------+------------------------------------------------------------------------------------------------------------------------+---------------+-----------------+------------------+
| 2020-04-24 15:12:42 | Total | -618.0 | -0.03 | G1Don |
| | hGQhtJuxNyLAoLkNk2 | -103.0 | -0.01 | |
| | 8Bg5D9TXoJSwZpJKfo | -103.0 | -0.01 | |
| | D5J3ZEKSHLrdCsskVk | -103.0 | -0.01 | |
| | 3TJVyePrqtJt5F6Z7a | -103.0 | -0.01 | |
| | APybrmPs6BrSF3wH33 | -103.0 | -0.01 | |
| | BoAUwYrNdpgC7UZvAd | -103.0 | -0.01 | |
+---------------------+------------------------------------------------------------------------------------------------------------------------+---------------+-----------------+------------------+
```
However, receiving multi-issuer tx "adds" the shortened pubkeys together, and makes it unreadable:
```
+---------------------+------------------------------------------------------------------------------------------------------------------------+---------------+-----------------+------------------+
| 2020-04-24 15:12:42 | hGQhtJuxNyLAoLkNk28Bg5D9TXoJSwZpJKfoD5J3ZEKSHLrdCsskVk3TJVyePrqtJt5F6Z7aAPybrmPs6BrSF3wH33BoAUwYrNdpgC7UZvAd | 618 | 0.035 | G1Don |
+---------------------+------------------------------------------------------------------------------------------------------------------------+---------------+-----------------+------------------+
```
multisig txs is only implemented on the alpha "Ğ1Don" generator, so this issue has very low priority for now.0.8.0MoulMoulhttps://git.duniter.org/clients/python/silkaj/-/issues/323Handle pubkey's checksum in the tx code2020-06-24T16:11:48+02:00MoulHandle pubkey's checksum in the tx codeThe following discussion from !132 should be addressed:
- [ ] @matograine started a [discussion](https://git.duniter.org/clients/python/silkaj/-/merge_requests/132#note_22528): (+3 comments)
> Seems like there is a bug in the tx.p...The following discussion from !132 should be addressed:
- [ ] @matograine started a [discussion](https://git.duniter.org/clients/python/silkaj/-/merge_requests/132#note_22528): (+3 comments)
> Seems like there is a bug in the tx.py module.
> (I use the checksum example [given by Tortue](https://github.com/Tortue95/Duniter_Paper_Wallet))
>
> ```bash
> silkaj --gtest tx -r Hvrm4fZQWQ2M26wNczZcijce7cB8XQno2NPTwf5MovPa:5XP -a 100
> Please enter your Scrypt Salt (Secret identifier):
> Please enter your Scrypt password (masked):
> ╒════════════════════════════════════════════╤══════════════════════════════════════════════════╕
> │ pubkey's balance before tx (unit|relative) │ 96678.75 ĞTest | 9.6756 UD ĞTest │
> ├────────────────────────────────────────────┼──────────────────────────────────────────────────┤
> │ total transaction amount (unit|relative) │ 100.0 ĞTest | 0.01 UD ĞTest │
> ├────────────────────────────────────────────┼──────────────────────────────────────────────────┤
> │ pubkey's balance after tx (unit|relative) │ 96578.75 ĞTest | 9.6656 UD ĞTest │
> ├────────────────────────────────────────────┼──────────────────────────────────────────────────┤
> │ from (pubkey) │ AhRMHUxMPXSeG7qXZrE6qCdjwK9p2bu5Eqei7xAWVEDK │
> ├────────────────────────────────────────────┼──────────────────────────────────────────────────┤
> │ to (pubkey) │ Hvrm4fZQWQ2M26wNczZcijce7cB8XQno2NPTwf5MovPa:5XP │
> ├────────────────────────────────────────────┼──────────────────────────────────────────────────┤
> │ amount (unit|relative) │ 100.0 ĞTest | 0.01 UD ĞTest │
> ├────────────────────────────────────────────┼──────────────────────────────────────────────────┤
> │ comment │ │
> ╘════════════════════════════════════════════╧══════════════════════════════════════════════════╛
> Do you confirm sending this transaction? [yes/no]: yes
> Generate Transaction:
> - From: AhRMHUxMPXSeG7qXZrE6qCdjwK9p2bu5Eqei7xAWVEDK
> - To: Hvrm4fZQWQ2M26wNczZcijce7cB8XQno2NPTwf5MovPa:5XP
> - Amount: 100.0
> - Total: 100.0
> Traceback (most recent call last):
> File "/home/thomas/.cache/pypoetry/virtualenvs/silkaj-HKHTj0CI-py3.7/bin/silkaj", line 11, in <module>
> load_entry_point('silkaj', 'console_scripts', 'silkaj')()
> File "/home/thomas/.cache/pypoetry/virtualenvs/silkaj-HKHTj0CI-py3.7/lib/python3.7/site-packages/click/core.py", line 764, in __call__
> return self.main(*args, **kwargs)
> File "/home/thomas/.cache/pypoetry/virtualenvs/silkaj-HKHTj0CI-py3.7/lib/python3.7/site-packages/click/core.py", line 717, in main
> rv = self.invoke(ctx)
> File "/home/thomas/.cache/pypoetry/virtualenvs/silkaj-HKHTj0CI-py3.7/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
> return _process_result(sub_ctx.command.invoke(sub_ctx))
> File "/home/thomas/.cache/pypoetry/virtualenvs/silkaj-HKHTj0CI-py3.7/lib/python3.7/site-packages/click/core.py", line 956, in invoke
> return ctx.invoke(self.callback, **ctx.params)
> File "/home/thomas/.cache/pypoetry/virtualenvs/silkaj-HKHTj0CI-py3.7/lib/python3.7/site-packages/click/core.py", line 555, in invoke
> return callback(*args, **kwargs)
> File "/mnt/DATA/Users/bob/Documents/Associatif/June/Developpement/dev-silkaj/silkaj-multi_output/silkaj/tools.py", line 70, in wrapper
> return loop.run_until_complete(f(*args, **kwargs))
> File "/usr/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
> return future.result()
> File "/mnt/DATA/Users/bob/Documents/Associatif/June/Developpement/dev-silkaj/silkaj-multi_output/silkaj/tx.py", line 141, in send_transaction
> key, issuer_pubkey, tx_amounts, recipients, comment, outputbackchange,
> File "/mnt/DATA/Users/bob/Documents/Associatif/June/Developpement/dev-silkaj/silkaj-multi_output/silkaj/tx.py", line 301, in handle_intermediaries_transactions
> OutputbackChange,
> File "/mnt/DATA/Users/bob/Documents/Associatif/June/Developpement/dev-silkaj/silkaj-multi_output/silkaj/tx.py", line 339, in generate_and_send_transaction
> transaction.sign([key])
> File "/home/thomas/.cache/pypoetry/virtualenvs/silkaj-HKHTj0CI-py3.7/lib/python3.7/site-packages/duniterpy/documents/document.py", line 84, in sign
> signing = base64.b64encode(key.signature(bytes(self.raw(), "ascii")))
> File "/home/thomas/.cache/pypoetry/virtualenvs/silkaj-HKHTj0CI-py3.7/lib/python3.7/site-packages/duniterpy/documents/transaction.py", line 839, in raw
> doc += "{0}\n".format(o.inline())
> File "/home/thomas/.cache/pypoetry/virtualenvs/silkaj-HKHTj0CI-py3.7/lib/python3.7/site-packages/duniterpy/documents/transaction.py", line 201, in inline
> self.amount, self.base, pypeg2.compose(self.condition, output.Condition)
> File "/home/thomas/.cache/pypoetry/virtualenvs/silkaj-HKHTj0CI-py3.7/lib/python3.7/site-packages/pypeg2/__init__.py", line 699, in compose
> return parser.compose(thing, grammar)
> File "/home/thomas/.cache/pypoetry/virtualenvs/silkaj-HKHTj0CI-py3.7/lib/python3.7/site-packages/pypeg2/__init__.py", line 1299, in compose
> return terminal_indent() + thing.compose(self, attr_of=attr_of)
> File "/home/thomas/.cache/pypoetry/virtualenvs/silkaj-HKHTj0CI-py3.7/lib/python3.7/site-packages/duniterpy/grammars/output.py", line 383, in compose
> left = parser.compose(self.left, grammar=grammar, attr_of=attr_of)
> File "/home/thomas/.cache/pypoetry/virtualenvs/silkaj-HKHTj0CI-py3.7/lib/python3.7/site-packages/pypeg2/__init__.py", line 1333, in compose
> + grammar.pattern)
> ValueError: '' does not match \w+
> ERROR:asyncio:Unclosed client session
> client_session: <aiohttp.client.ClientSession object at 0x7fc8c1496080>
> ERROR:asyncio:Unclosed connector
> connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x7fc8c14fbd48>, 83529.411582788)]']
> connector: <aiohttp.connector.TCPConnector object at 0x7fc8c1496048>
>
> ```0.8.0MoulMoulhttps://git.duniter.org/clients/python/silkaj/-/issues/320Incorrect use of check_public_key() in `id` command2020-10-17T13:50:59+02:00MoulIncorrect use of check_public_key() in `id` commandWhen working on #237, and looking where `check_public_key()` is used, I found [a place](https://git.duniter.org/clients/python/silkaj/-/blob/b05228a423f1f310ceaa369d903ffb6066b77b8b/silkaj/wot.py#L164-183) where it is improperly used.
T...When working on #237, and looking where `check_public_key()` is used, I found [a place](https://git.duniter.org/clients/python/silkaj/-/blob/b05228a423f1f310ceaa369d903ffb6066b77b8b/silkaj/wot.py#L164-183) where it is improperly used.
The boolean return value is used in `id` to check whether the parameter is well a pubkey. But, `check_public_key()` returns `True` in case of a valid pubkey (and a valid corresponding checksum if specified). But, returns `False` in two cases: wrong pubkey format, and wrong checksum. Thus, the `id` command thinks the `False` means the parameter is not a pubkey, but an uid.
In most cases this is fine, but if you specify a wrong checksum, then the `id` commands thinks this is an `uid`, and therefore try to find it on the network rather than stopping saying this is a wrong checksum.
This is not super critical, but this should be addressed one day.0.8.0matograinematograinehttps://git.duniter.org/clients/python/silkaj/-/issues/312Handle chained transactions2021-03-08T11:22:25+01:00Pascal EngélibertHandle chained transactionsSilkaj should avoid using sources already used by a transaction not yet applied (typically when sending chained transactions).
Some solutions:
* Add a "chained transactions" mode;
* When selecting sources, fetch the tx pool to know the ...Silkaj should avoid using sources already used by a transaction not yet applied (typically when sending chained transactions).
Some solutions:
* Add a "chained transactions" mode;
* When selecting sources, fetch the tx pool to know the used sources;
* Store used sources in a file (1 file per pubkey). Update it each time we fetch the sources or send a tx.
Maybe closes #238.0.9.0https://git.duniter.org/clients/python/silkaj/-/issues/310wot: 'outdistanced' provides a wrong information?2022-06-28T18:21:02+02:00matograinewot: 'outdistanced' provides a wrong information?The member Maria44 should enter the wot in a few days, according to WotWizard. (see [forum](https://forum.duniter.org/t/maria44-bug-pour-certifications/7039/3))
```
silkaj wot Maria44
Maria44 (HXSSj…) from block #300354-0000049C…
receiv...The member Maria44 should enter the wot in a few days, according to WotWizard. (see [forum](https://forum.duniter.org/t/maria44-bug-pour-certifications/7039/3))
```
silkaj wot Maria44
Maria44 (HXSSj…) from block #300354-0000049C…
received 7 and sent 0/100 certifications:
| received_expire | received | sent | sent_expire |
|-------------------+--------------------+--------+---------------|
| 2022-01-31 | Claire666 ✔ | | |
| 2022-01-31 | carinecoxi ✔ | | |
| 2022-01-31 | TristanG1 | | |
| 2022-01-31 | Michellecuyer26 | | |
| 2022-01-31 | ChristineWilloth26 | | |
| 2022-02-06 | ChristineWilloth26 | | |
| 2022-02-06 | Michellecuyer26 | | |
✔: Certifications written into the blockchain
Membership expiration due to certification expirations: 2022-01-31
member: False
outdistanced: True
```
All pending certifications are correctly displayed.
What does "outdistanced" mean ? I understand that the member is out of the minimum distance, and should not enter the blockchain. Is it a bug or an unclear TUI ?