mirror of
https://github.com/logos-blockchain/logos-execution-zone.git
synced 2026-05-12 19:19:30 +00:00
refactor: rename private_pda_spender to auth_transfer_proxy
This commit is contained in:
parent
1bed9ecef2
commit
cf699fde7c
Binary file not shown.
@ -419,18 +419,18 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// PDA init: initializes a new PDA under `authenticated_transfer`'s ownership.
|
/// PDA init: initializes a new PDA under `authenticated_transfer`'s ownership.
|
||||||
/// The `private_pda_spender` program chains to `authenticated_transfer` with `pda_seeds`
|
/// The `auth_transfer_proxy` program chains to `authenticated_transfer` with `pda_seeds`
|
||||||
/// to establish authorization and the private PDA binding.
|
/// to establish authorization and the private PDA binding.
|
||||||
#[test]
|
#[test]
|
||||||
fn private_pda_init() {
|
fn private_pda_init() {
|
||||||
let program = Program::private_pda_spender();
|
let program = Program::auth_transfer_proxy();
|
||||||
let auth_transfer = Program::authenticated_transfer_program();
|
let auth_transfer = Program::authenticated_transfer_program();
|
||||||
let keys = test_private_account_keys_1();
|
let keys = test_private_account_keys_1();
|
||||||
let npk = keys.npk();
|
let npk = keys.npk();
|
||||||
let seed = PdaSeed::new([42; 32]);
|
let seed = PdaSeed::new([42; 32]);
|
||||||
let shared_secret_pda = SharedSecretKey::new(&[55; 32], &keys.vpk());
|
let shared_secret_pda = SharedSecretKey::new(&[55; 32], &keys.vpk());
|
||||||
|
|
||||||
// PDA (new, private PDA) — AccountId derived from private_pda_spender's program ID
|
// PDA (new, private PDA) — AccountId derived from auth_transfer_proxy's program ID
|
||||||
let pda_id = AccountId::for_private_pda(&program.id(), &seed, &npk);
|
let pda_id = AccountId::for_private_pda(&program.id(), &seed, &npk);
|
||||||
let pda_pre = AccountWithMetadata::new(Account::default(), false, pda_id);
|
let pda_pre = AccountWithMetadata::new(Account::default(), false, pda_id);
|
||||||
|
|
||||||
@ -460,7 +460,7 @@ mod tests {
|
|||||||
/// two-tx sequence with membership proofs.
|
/// two-tx sequence with membership proofs.
|
||||||
#[test]
|
#[test]
|
||||||
fn private_pda_withdraw() {
|
fn private_pda_withdraw() {
|
||||||
let program = Program::private_pda_spender();
|
let program = Program::auth_transfer_proxy();
|
||||||
let auth_transfer = Program::authenticated_transfer_program();
|
let auth_transfer = Program::authenticated_transfer_program();
|
||||||
let keys = test_private_account_keys_1();
|
let keys = test_private_account_keys_1();
|
||||||
let npk = keys.npk();
|
let npk = keys.npk();
|
||||||
|
|||||||
@ -313,12 +313,12 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn private_pda_spender() -> Self {
|
pub fn auth_transfer_proxy() -> Self {
|
||||||
use test_program_methods::{PRIVATE_PDA_SPENDER_ELF, PRIVATE_PDA_SPENDER_ID};
|
use test_program_methods::{AUTH_TRANSFER_PROXY_ELF, AUTH_TRANSFER_PROXY_ID};
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
id: PRIVATE_PDA_SPENDER_ID,
|
id: AUTH_TRANSFER_PROXY_ID,
|
||||||
elf: PRIVATE_PDA_SPENDER_ELF.to_vec(),
|
elf: AUTH_TRANSFER_PROXY_ELF.to_vec(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user