Skip to content

refactor: name the shielded methods after the transparent side they touch - #176

Closed
LexxXell wants to merge 1 commit into
developfrom
refactor/shieldedMethodNames
Closed

LexxXell wants to merge 1 commit into
developfrom
refactor/shieldedMethodNames

Conversation

@LexxXell

Copy link
Copy Markdown
Collaborator

Problem

SHIELD_TO_POOL says the same thing twice: shielding is moving funds into the shielded pool. The half that carries information is missing - where the funds come from, which is one of the wallet's own Platform addresses and is even a parameter of the call.

It also breaks the symmetry of its neighbours. UNSHIELD_TO_ADDRESS and WITHDRAW_SHIELDED_TO_CORE are named after the transparent side of the operation, which for shielding is the source. And UNSHIELD_TO_ADDRESS does not say which address, although leaving the pool for a Core address is a different method entirely.

The SDK itself calls the transition plainly shield, without repeating the pool.

Changes

  • SHIELD_TO_POOL → SHIELD_FROM_PLATFORM_ADDRESS, handler ShieldFromPlatformAddressHandler, payload and response renamed to match, file renamed.
  • UNSHIELD_TO_ADDRESS → UNSHIELD_TO_PLATFORM_ADDRESS, same treatment.
  • Client methods are shieldFromPlatformAddress and unshieldToPlatformAddress. The old names stay as @deprecated one-line aliases that delegate to them, so every existing caller keeps working and the UI needs no change in this PR.

All the shielded methods now read by one rule: they name the transparent side, and the naming lines up with the new funding methods (REGISTER_IDENTITY_FROM_PLATFORM_ADDRESS, TOP_UP_IDENTITY_FROM_PLATFORM_ADDRESS).

Backend only - no UI changes.

Testing

  • tsc --noEmit, ts-standard, npm run build
  • jest: 42 suites, 361/361. The handler spec moved with its file and now covers ShieldFromPlatformAddressHandler.
  • grep finds no remaining reference to the old messaging methods or handler names outside the deprecated client aliases.

@LexxXell

Copy link
Copy Markdown
Collaborator Author

Переношу переименование в #170: замечание пришло по нему, и он уже правит те же файлы. Отдельный PR не нужен.

@LexxXell LexxXell closed this Sep 28, 2026
@LexxXell
LexxXell deleted the refactor/shieldedMethodNames branch September 28, 2026 11:30
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.

1 participant