Skip to content

Restore Uint8Array pubkeys after localStorage round-trip - #45

Open
Steve0x2a wants to merge 1 commit into
hyperweb-io:mainfrom
Steve0x2a:fix/restore-uint8array-pubkey-localstorage
Open

Restore Uint8Array pubkeys after localStorage round-trip#45
Steve0x2a wants to merge 1 commit into
hyperweb-io:mainfrom
Steve0x2a:fix/restore-uint8array-pubkey-localstorage

Conversation

@Steve0x2a

Copy link
Copy Markdown

JSON.stringify/parse in LocalStorage turned Uint8Array pubkeys into {0:…,1:…} objects. After a reload, WalletManagerStore.restore() loaded that state unchanged and ChainWalletStore.getAccount() returned the cached account, so signing failed with "length of pubkey is incorrect".

LocalStorage.load() now revives those numeric-key objects back into Uint8Array, so every consumer of persisted store state gets a real pubkey.

Thanks @drimchansky for reporting this in #40.

Fixes #40.

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.

Uint8Array pubkeys degrade to plain objects after localStorage round-trip

1 participant