encointer / encointer-wallet-flutter

Encointer mobile wallet flutter implementation

Home Page:https://encointer.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fetch store parameters before constructing stores and make fields non-nullable

clangenb opened this issue · comments

We have quite some fields in stores, e.g. demurrage, which will never be null. Yet the store is initialized with null-demurrage only to wait until the web api has returned a value to set the field to a non-null value.

Having this nullable is very inconvenient, as the developer must either handle each null case or know exactly the code paths to know when a non-null value can be assumed. I think the code can be simplified greatly by this, and it should not be too much of an effort to implement this.

For some operations, like choosing a new community, this requires us to be online, but I think this is a reasonable assumption.