linera-io / linera-protocol

Main repository for the Linera protocol
Apache License 2.0
112 stars 94 forks source link

Generalize client storage from the filesystem #2194

Closed Twey closed 2 days ago

Twey commented 1 week ago

Motivation

The browser doesn't have access to a filesystem. In order to store and load wallet configuration, we must use a different backend, such as localStorage. Currently, though, the linera-service crate assumes filesystem access, and stores configuration as JSON on the filesystem.

Proposal

Generalize the WalletState struct with a new trait that represents any data that can be persisted. Move the previous behaviour into an implementation of that trait specialized to filesystem storage.

Test Plan

CI.

Release Plan

None required.

Links