Skip to content

refactor: stop using localStorage#1

Merged
obiyankenobi merged 12 commits intodevfrom
refactor/storage
Jun 5, 2019
Merged

refactor: stop using localStorage#1
obiyankenobi merged 12 commits intodevfrom
refactor/storage

Conversation

@obiyankenobi
Copy link
Copy Markdown
Member

The lib now doesn't require localStorage and clients should pass a storage to the lib using setStorage().

Copy link
Copy Markdown
Member

@pedroferreira1 pedroferreira1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should have a place in the README explaining how to set a storage and what we expect (a getItem, a setItem, ...)

@msbrogli
Copy link
Copy Markdown
Member

msbrogli commented Jun 5, 2019

I think we should have a place in the README explaining how to set a storage and what we expect (a getItem, a setItem, ...)

I agree with it.

const storageFactory = {
class MemoryOnlyStore {
constructor() {
this.hathorMemoryStorage = {};
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I this you just kept the variable name, but I think data or store would be a better name.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just internal, not used outside the class.

@obiyankenobi obiyankenobi merged commit ce466c3 into dev Jun 5, 2019
@obiyankenobi obiyankenobi deleted the refactor/storage branch August 23, 2019 17:20
tuliomir added a commit that referenced this pull request Mar 23, 2026
Enables readonly wallet testing for the wallet-service facade and
reorganizes readonly tests into shared vs. facade-specific:

- Service adapter: adds xpub support in buildWalletInstance/startWallet,
  routing to startReadOnly() for xpub wallets. Pre-registers the wallet
  on the backend (via seed start+stop) before attaching as readonly.
- Shared tests: isReadonly verification, zero balance, fund injection —
  run against both facades via describe.each.
- Fullnode-specific: address generation (local derivation) and 15
  WalletFromXPubGuard assertions.
- Service-specific: 5 WalletFromXPubGuard assertions for guarded methods.
- Helper: buildWalletInstance() now accepts optional xpub parameter.

Addresses PR review comment #1 about wallet-service readonly support.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants