mirror of
https://github.com/logos-blockchain/logos-execution-zone.git
synced 2026-05-08 17:19:45 +00:00
Addresses the following review comment: - "I think this should be a constructor `AccountId::for_private_pda`. Consider also removing the existing `impl From<(ProgramId, Seed)> for AccountId` for public pdas in favor of a `AccountId::for_public_pda` to have a unified way of constructing pdas" I replaced `impl From<(&ProgramId, &PdaSeed)> for AccountId` with `AccountId::for_public_pda(program_id: &ProgramId, seed: &PdaSeed) -> Self` and replaced the free function `private_pda_account_id(...)` with `AccountId::for_private_pda(program_id: &ProgramId, seed: &PdaSeed, npk: &NullifierPublicKey) -> Self`. Both live in an inherent `impl AccountId` block in nssa/core/src/program.rs next to the PDA derivation logic. Migrated all call sites across nssa/core, nssa/src/state.rs, nssa/src/validated_state_diff.rs, program_methods/guest/src/bin/privacy_preserving_circuit.rs, programs/amm/core, programs/associated_token_account/core, the example tail-call binary, and the ATA tutorial doc. Test function names that referenced the old free function were also renamed (private_pda_account_id_* to for_private_pda_*).
403 KiB
403 KiB