core icon indicating copy to clipboard operation
core copied to clipboard

Transactional `configure2` API

Open link2xt opened this issue 2 years ago • 0 comments

Currently configuring an account consists of setting options such as addr, mail_pw etc. via set_config, followed by running a configure(). If configure() fails, invalid settings are stored and will be displayed in the dialog.

To fix this, we need a new API that accepts new settings in the arguments, e.g. a configure2(Context, HashMap<String, String>) API that stores settings entered by the user in the config table only when configuration succeeds. This can be easily mapped to JSON-RPC API and C API is not needed. Instead of HashMap new method may accept a struct with all configuration parameters and Default implementation so settings can be added in backwards-compatible way, this is probably a better Rust API design but will involve more code.

link2xt avatar Oct 24 '23 16:10 link2xt