Page MenuHomePhabricator

[backup-client] refactor `SIWEBackupData` type
ClosedPublic

Authored by kamil on Oct 31 2024, 4:44 AM.
Tags
None
Referenced Files
F3513335: D13836.id45667.diff
Sat, Dec 21, 11:34 PM
F3513334: D13836.id45651.diff
Sat, Dec 21, 11:34 PM
F3513333: D13836.id45498.diff
Sat, Dec 21, 11:34 PM
F3513301: D13836.id.diff
Sat, Dec 21, 11:34 PM
F3513282: D13836.diff
Sat, Dec 21, 11:33 PM
Unknown Object (File)
Mon, Dec 2, 1:17 PM
Unknown Object (File)
Mon, Dec 2, 1:57 AM
Unknown Object (File)
Sun, Dec 1, 12:03 PM
Subscribers

Details

Summary

ENG-6145.

  1. Move retrieving SIWEBackupData to a util funtion - it will be needed later in the stack
  2. Move types to proper places on JS side
  3. Add comment keep types in sync
  4. Add validation on JS side
  5. Remove siwe_backup_msg - it's not needed
Test Plan

Test backup restore for Wallet user

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kamil held this revision as a draft.
kamil published this revision for review.Oct 31 2024, 8:46 AM
kamil added inline comments.
lib/types/backup-types.js
24 ↗(On Diff #45498)

This is not needed, it's removed in D13850 to make CI pass

bartek added inline comments.
native/native_rust_library/src/backup.rs
253–272 ↗(On Diff #45498)

Nit: to avoid nested match you could use let-else to unwrap Some(siwe_backup_msg_value) and then the inner match get_siwe_backup_data_from_msg() would not be nested

This revision is now accepted and ready to land.Nov 4 2024, 11:20 PM