DuniterPy issueshttps://git.duniter.org/clients/python/duniterpy/-/issues2023-07-08T15:26:03+02:00https://git.duniter.org/clients/python/duniterpy/-/issues/180Remove problematic base58 module2023-07-08T15:26:03+02:00Vincent TexierRemove problematic base58 moduleA french user reported this:
Avec la dernière version de duniterpy (0.62.0), same avec python 3.8 et 3.9:
`AttributeError: module 'duniterpy.key.base58' has no attribute 'b58decode'`
Résolu par:
```python
pubkey_byte = base58.Base58E...A french user reported this:
Avec la dernière version de duniterpy (0.62.0), same avec python 3.8 et 3.9:
`AttributeError: module 'duniterpy.key.base58' has no attribute 'b58decode'`
Résolu par:
```python
pubkey_byte = base58.Base58Encoder.decode(str.encode(pubkey))
hash = hashlib.sha256(hashlib.sha256(pubkey_byte).digest()).digest()
return base58.Base58Encoder.encode(hash)[:3]
```
DuniterPy’s `base58` module only checks data types. So, not really useful and overrides [`base58`](https://pypi.org/project/base58/) module. Should be removed to use `base58` module instead.1.3.0https://git.duniter.org/clients/python/duniterpy/-/issues/126Refactor api.client module to offer url from endpoint2023-07-08T15:27:00+02:00Vincent TexierRefactor api.client module to offer url from endpointIn the api.client module:
* The API instance should be injected as a dependency in the Client instance (composition).
* The API class should not be public, so prefix it with an underscore.
* Why API.reverse_url() needs arguments already...In the api.client module:
* The API instance should be injected as a dependency in the Client instance (composition).
* The API class should not be public, so prefix it with an underscore.
* Why API.reverse_url() needs arguments already in conn_handler ?
* As the endpoint can define the scheme for sure, we can withdraw it and get it from the ConnHandler class.
* But for that, the ConnHandler class need to set only one scheme!
* Expose a method to easily get the url of an endpoint (refactor reverse_url of API in public Client class).
If we do that:
* Set only one scheme (with http, https, ws, wss) in ConnHandler class
We can do that:
* Get the api url from the connhandler without giving any scheme.Backloghttps://git.duniter.org/clients/python/duniterpy/-/issues/125Add examples to create a transaction that the sender can get back after a delay2023-07-08T15:27:06+02:00Vincent TexierAdd examples to create a transaction that the sender can get back after a delaySakia 0.51.x added support for transaction with refund after one week.
Add duniterpy examples to do the same, step by step, with code.Sakia 0.51.x added support for transaction with refund after one week.
Add duniterpy examples to do the same, step by step, with code.Backloghttps://git.duniter.org/clients/python/duniterpy/-/issues/117Refactor all code using hexagonal architecture2023-07-08T15:27:16+02:00Vincent TexierRefactor all code using hexagonal architectureI think that [the hexagonal architecture](https://blog.octo.com/en/hexagonal-architecture-three-principles-and-an-implementation-example/) will fit well in this library.
Let's just think about …
[The exact same article](https://blog.oc...I think that [the hexagonal architecture](https://blog.octo.com/en/hexagonal-architecture-three-principles-and-an-implementation-example/) will fit well in this library.
Let's just think about …
[The exact same article](https://blog.octo.com/architecture-hexagonale-trois-principes-et-un-exemple-dimplementation/) for French readers.Backloghttps://git.duniter.org/clients/python/duniterpy/-/issues/116Make Duniter's and Cesium V1’s PubSec format compatible2021-08-09T16:06:54+02:00matograineMake Duniter's and Cesium V1’s PubSec format compatibleFollowing https://git.duniter.org/clients/python/silkaj/issues/274
For now, Duniterpy only accepts PubSec files in V1 format. We would like to make it accept Duniter's PubSec format as well:
Duniter:
```
pub: "BdanxHdwRRzCXZpiqvTVTX4gy...Following https://git.duniter.org/clients/python/silkaj/issues/274
For now, Duniterpy only accepts PubSec files in V1 format. We would like to make it accept Duniter's PubSec format as well:
Duniter:
```
pub: "BdanxHdwRRzCXZpiqvTVTX4gyyh6qFTYjeCWCkLwDifx"
sec: "2CNFWPJEi9oy9RQYpDYmPvFsRbaQQBzi6n4McqQsJmYQ336NL8nsewG7p49SVa6bgEwKzmB1pMtD7SmnxD2EM5LA"
```
Cesium V1:
```
Type: PubSec
Version: 1
pub: BdanxHdwRRzCXZpiqvTVTX4gyyh6qFTYjeCWCkLwDifx
sec: 2CNFWPJEi9oy9RQYpDYmPvFsRbaQQBzi6n4McqQsJmYQ336NL8nsewG7p49SVa6bgEwKzmB1pMtD7SmnxD2EM5LA
```
the matching regex would be `(^pub: (\")?([1-9A-HJ-NP-Za-km-z]{43,44})(\")?\nsec: (\")?([1-9A-HJ-NP-Za-km-z]{87,90})(\")?)`Backloghttps://git.duniter.org/clients/python/duniterpy/-/issues/110Block.from_signed_raw() usage is not obvious2020-12-10T21:51:10+01:00MoulBlock.from_signed_raw() usage is not obviousParsing a block is not obvious. You have to append to the raw part, the signature and a `\n` to make it work:
```python
block = await bma_client(bma.blockchain.block, block_number)
block = Block.from_signed_raw(block["raw"] + block["sig...Parsing a block is not obvious. You have to append to the raw part, the signature and a `\n` to make it work:
```python
block = await bma_client(bma.blockchain.block, block_number)
block = Block.from_signed_raw(block["raw"] + block["signature"] + "\n")
```
I thought, `from_signed_raw(block["raw"])` was broken, but I found it used this way in Sakia.
We should address this.
Will it be fixed with GVA?
Do we want to implement a `from_json()` in the meantime?Backloghttps://git.duniter.org/clients/python/duniterpy/-/issues/82Add missing Transaction attributes2021-07-22T19:09:10+02:00MoulAdd missing Transaction attributesAdd missing `Transaction.{blockstampTime,hash,block_number,received}` attributes in a way that it does not destroy the generation of Tx for sending.
As made for `time` attribute in https://git.duniter.org/clients/python/duniterpy/merge_...Add missing `Transaction.{blockstampTime,hash,block_number,received}` attributes in a way that it does not destroy the generation of Tx for sending.
As made for `time` attribute in https://git.duniter.org/clients/python/duniterpy/merge_requests/58/diffs?commit_id=fc30ac27e96da39b2b03d8f14c862017b00e026b.Backloghttps://git.duniter.org/clients/python/duniterpy/-/issues/80InputSource: implement from_src() and from_output_src() methods2021-03-07T15:37:50+01:00MoulInputSource: implement from_src() and from_output_src() methods- [ ] `InputSource.from_src()`: can be then used in `examples/send_transaction.py`
- [ ] `InputSource.from_output_src()`
- [ ] create `Source` class that `InputSource` and `OutputSource` would inherit?- [ ] `InputSource.from_src()`: can be then used in `examples/send_transaction.py`
- [ ] `InputSource.from_output_src()`
- [ ] create `Source` class that `InputSource` and `OutputSource` would inherit?Backloghttps://git.duniter.org/clients/python/duniterpy/-/issues/79Add code helper for sources selection and transaction chain2022-07-07T10:08:46+02:00Vincent TexierAdd code helper for sources selection and transaction chainAdd functions to smartly select sources and chain transactions.
In a lib folder or helper folder.
See pseudo code here (french) : https://forum.duniter.org/t/algorithme-de-selection-des-sources-pour-transactions/5942/2?u=vtexierAdd functions to smartly select sources and chain transactions.
In a lib folder or helper folder.
See pseudo code here (french) : https://forum.duniter.org/t/algorithme-de-selection-des-sources-pour-transactions/5942/2?u=vtexierBackloghttps://git.duniter.org/clients/python/duniterpy/-/issues/57Use Trio library to simplify asyncio or wait for Python 3.8 implementation of...2021-03-07T17:15:24+01:00Vincent TexierUse Trio library to simplify asyncio or wait for Python 3.8 implementation of nurseriesIt begins with a [french article](http://sametmax.com/super-article-invite-sur-trio-que-lauteur-a-oublie-de-titrer/) on the problems behind async/await python implementation.
[Trio](https://trio.readthedocs.io/en/latest/?badge=latest) s...It begins with a [french article](http://sametmax.com/super-article-invite-sur-trio-que-lauteur-a-oublie-de-titrer/) on the problems behind async/await python implementation.
[Trio](https://trio.readthedocs.io/en/latest/?badge=latest) seems to solves the problems nicely, and [trio-asyncio](https://trio-asyncio.readthedocs.io/en/latest/?badge=latest) can be used with aiohttp.
Python 3.8 should include the concept of nurseries. May be we can wait for it...Backlog