From 4b37d3e4066253c9f6cc969d7227c11bf5bf766f Mon Sep 17 00:00:00 2001 From: ananas-block <58553958+ananas-block@users.noreply.github.com> Date: Wed, 8 May 2024 21:28:58 +0100 Subject: [PATCH] chore: remove unused user registry program (#690) --- Cargo.lock | 9 -- Cargo.toml | 1 - js/stateless.js/src/idls/index.ts | 7 - .../src/idls/light_user_registry.ts | 137 ------------------ programs/user-registry/Cargo.toml | 24 --- programs/user-registry/Xargo.toml | 2 - programs/user-registry/src/lib.rs | 47 ------ scripts/push-stateless-js-idls.sh | 1 - 8 files changed, 228 deletions(-) delete mode 100644 js/stateless.js/src/idls/light_user_registry.ts delete mode 100644 programs/user-registry/Cargo.toml delete mode 100644 programs/user-registry/Xargo.toml delete mode 100644 programs/user-registry/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index f18c1f57af..1733563955 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3022,15 +3022,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "light-user-registry" -version = "0.3.1" -dependencies = [ - "aligned-sized", - "anchor-lang", - "bytemuck", -] - [[package]] name = "light-utils" version = "0.1.1" diff --git a/Cargo.toml b/Cargo.toml index 834676fbb2..5b1344161c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,6 @@ members = [ "programs/compressed-pda", "programs/compressed-token", "programs/registry", - "programs/user-registry", "test-utils", "utils", "xtask", diff --git a/js/stateless.js/src/idls/index.ts b/js/stateless.js/src/idls/index.ts index c5e5d957ed..d53c3c4f83 100644 --- a/js/stateless.js/src/idls/index.ts +++ b/js/stateless.js/src/idls/index.ts @@ -9,11 +9,6 @@ import { IDL as LightCompressedPdaIDL, LightCompressedPda, } from './light_compressed_pda'; -import { - IDL as LightUserRegistryIDL, - LightUserRegistry, -} from './light_user_registry'; - export { AccountCompressionIDL, AccountCompression, @@ -21,6 +16,4 @@ export { LightRegistry, LightCompressedPdaIDL, LightCompressedPda, - LightUserRegistryIDL, - LightUserRegistry, }; diff --git a/js/stateless.js/src/idls/light_user_registry.ts b/js/stateless.js/src/idls/light_user_registry.ts deleted file mode 100644 index 163edc4dde..0000000000 --- a/js/stateless.js/src/idls/light_user_registry.ts +++ /dev/null @@ -1,137 +0,0 @@ -export type LightUserRegistry = { - version: '0.3.1'; - name: 'light_user_registry'; - instructions: [ - { - name: 'initializeUserEntry'; - accounts: [ - { - name: 'signer'; - isMut: true; - isSigner: true; - }, - { - name: 'systemProgram'; - isMut: false; - isSigner: false; - }, - { - name: 'userEntry'; - isMut: true; - isSigner: false; - }, - ]; - args: [ - { - name: 'lightPubkey'; - type: { - array: ['u8', 32]; - }; - }, - { - name: 'lightEncryptionPubkey'; - type: { - array: ['u8', 32]; - }; - }, - ]; - }, - ]; - accounts: [ - { - name: 'userEntry'; - type: { - kind: 'struct'; - fields: [ - { - name: 'solanaPubkey'; - type: { - array: ['u8', 32]; - }; - }, - { - name: 'lightPubkey'; - type: { - array: ['u8', 32]; - }; - }, - { - name: 'lightEncryptionPubkey'; - type: { - array: ['u8', 32]; - }; - }, - ]; - }; - }, - ]; -}; - -export const IDL: LightUserRegistry = { - version: '0.3.1', - name: 'light_user_registry', - instructions: [ - { - name: 'initializeUserEntry', - accounts: [ - { - name: 'signer', - isMut: true, - isSigner: true, - }, - { - name: 'systemProgram', - isMut: false, - isSigner: false, - }, - { - name: 'userEntry', - isMut: true, - isSigner: false, - }, - ], - args: [ - { - name: 'lightPubkey', - type: { - array: ['u8', 32], - }, - }, - { - name: 'lightEncryptionPubkey', - type: { - array: ['u8', 32], - }, - }, - ], - }, - ], - accounts: [ - { - name: 'userEntry', - type: { - kind: 'struct', - fields: [ - { - name: 'solanaPubkey', - type: { - array: ['u8', 32], - }, - }, - { - name: 'lightPubkey', - type: { - array: ['u8', 32], - }, - }, - { - name: 'lightEncryptionPubkey', - type: { - array: ['u8', 32], - }, - }, - ], - }, - }, - ], -}; diff --git a/programs/user-registry/Cargo.toml b/programs/user-registry/Cargo.toml deleted file mode 100644 index 5e5b89ba87..0000000000 --- a/programs/user-registry/Cargo.toml +++ /dev/null @@ -1,24 +0,0 @@ -[package] -name = "light-user-registry" -version = "0.3.1" -description = "Registry for Light Protocol users" -repository = "https://github.com/Lightprotocol/light-protocol" -license = "Apache-2.0" -edition = "2021" - -[lib] -crate-type = ["cdylib", "lib"] -name = "light_user_registry" - -[features] -no-entrypoint = [] -no-idl = [] -no-log-ix-name = [] -cpi = ["no-entrypoint"] -default = [] -bench-sbf = [] - -[dependencies] -aligned-sized = { version = "0.1.1", path = "../../macros/aligned-sized" } -anchor-lang = "0.29.0" -bytemuck = "1.14" diff --git a/programs/user-registry/Xargo.toml b/programs/user-registry/Xargo.toml deleted file mode 100644 index 475fb71ed1..0000000000 --- a/programs/user-registry/Xargo.toml +++ /dev/null @@ -1,2 +0,0 @@ -[target.bpfel-unknown-unknown.dependencies.std] -features = [] diff --git a/programs/user-registry/src/lib.rs b/programs/user-registry/src/lib.rs deleted file mode 100644 index 7d33f50dee..0000000000 --- a/programs/user-registry/src/lib.rs +++ /dev/null @@ -1,47 +0,0 @@ -use aligned_sized::aligned_sized; -use anchor_lang::prelude::*; - -declare_id!("6UqiSPd2mRCTTwkzhcs1M6DGYsqHWd5jiPueX3LwDMXQ"); - -const USER_ENTRY_SEED: &[u8] = b"user-entry"; - -#[program] -pub mod light_user_registry { - use super::*; - - pub fn initialize_user_entry( - ctx: Context, - light_pubkey: [u8; 32], - light_encryption_pubkey: [u8; 32], - ) -> Result<()> { - let user_entry = &mut ctx.accounts.user_entry; - user_entry.solana_pubkey = ctx.accounts.signer.key().to_bytes(); - user_entry.light_pubkey = light_pubkey; - user_entry.light_encryption_pubkey = light_encryption_pubkey; - - Ok(()) - } -} - -#[account] -#[aligned_sized(anchor)] -pub struct UserEntry { - pub solana_pubkey: [u8; 32], - pub light_pubkey: [u8; 32], - pub light_encryption_pubkey: [u8; 32], -} - -#[derive(Accounts)] -pub struct InitializeUserEntry<'info> { - #[account(mut)] - pub signer: Signer<'info>, - pub system_program: Program<'info, System>, - #[account( - init, - space = UserEntry::LEN, - seeds = [USER_ENTRY_SEED, signer.key().to_bytes().as_ref()], - bump, - payer = signer, - )] - pub user_entry: Account<'info, UserEntry>, -} diff --git a/scripts/push-stateless-js-idls.sh b/scripts/push-stateless-js-idls.sh index 9c1fd3d53d..ff26b8579e 100755 --- a/scripts/push-stateless-js-idls.sh +++ b/scripts/push-stateless-js-idls.sh @@ -9,7 +9,6 @@ FILES_TO_COPY=( "account_compression.ts" "light_compressed_pda.ts" "light_registry.ts" - "light_user_registry.ts" ) # copy each type file into the respective location