From 6658690b94c2ea395668a8cbae2dc2e390e909e2 Mon Sep 17 00:00:00 2001 From: Joe Caulfield Date: Thu, 24 Oct 2024 14:08:26 +0400 Subject: [PATCH] drop anchor --- .../accounts/address_lookup_table.rs | 25 ------------------- .../instructions/close_lookup_table.rs | 2 +- .../instructions/create_lookup_table.rs | 2 +- .../instructions/deactivate_lookup_table.rs | 2 +- .../instructions/extend_lookup_table.rs | 2 +- .../instructions/freeze_lookup_table.rs | 2 +- package.json | 2 +- pnpm-lock.yaml | 10 ++++---- scripts/generate-clients.mjs | 1 + 9 files changed, 12 insertions(+), 36 deletions(-) diff --git a/clients/rust/src/generated/accounts/address_lookup_table.rs b/clients/rust/src/generated/accounts/address_lookup_table.rs index 2c356fc..9f2eab2 100644 --- a/clients/rust/src/generated/accounts/address_lookup_table.rs +++ b/clients/rust/src/generated/accounts/address_lookup_table.rs @@ -62,28 +62,3 @@ impl<'a> TryFrom<&solana_program::account_info::AccountInfo<'a>> for AddressLook Self::deserialize(&mut data) } } - -#[cfg(feature = "anchor")] -impl anchor_lang::AccountDeserialize for AddressLookupTable { - fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result { - Ok(Self::deserialize(buf)?) - } -} - -#[cfg(feature = "anchor")] -impl anchor_lang::AccountSerialize for AddressLookupTable {} - -#[cfg(feature = "anchor")] -impl anchor_lang::Owner for AddressLookupTable { - fn owner() -> Pubkey { - crate::ADDRESS_LOOKUP_TABLE_ID - } -} - -#[cfg(feature = "anchor-idl-build")] -impl anchor_lang::IdlBuild for AddressLookupTable {} - -#[cfg(feature = "anchor-idl-build")] -impl anchor_lang::Discriminator for AddressLookupTable { - const DISCRIMINATOR: [u8; 8] = [0; 8]; -} diff --git a/clients/rust/src/generated/instructions/close_lookup_table.rs b/clients/rust/src/generated/instructions/close_lookup_table.rs index a0ee4d8..86f6edc 100644 --- a/clients/rust/src/generated/instructions/close_lookup_table.rs +++ b/clients/rust/src/generated/instructions/close_lookup_table.rs @@ -222,7 +222,7 @@ impl<'a, 'b> CloseLookupTableCpi<'a, 'b> { accounts, data, }; - let mut account_infos = Vec::with_capacity(3 + 1 + remaining_accounts.len()); + let mut account_infos = Vec::with_capacity(4 + remaining_accounts.len()); account_infos.push(self.__program.clone()); account_infos.push(self.address.clone()); account_infos.push(self.authority.clone()); diff --git a/clients/rust/src/generated/instructions/create_lookup_table.rs b/clients/rust/src/generated/instructions/create_lookup_table.rs index 65349f6..08a41f6 100644 --- a/clients/rust/src/generated/instructions/create_lookup_table.rs +++ b/clients/rust/src/generated/instructions/create_lookup_table.rs @@ -287,7 +287,7 @@ impl<'a, 'b> CreateLookupTableCpi<'a, 'b> { accounts, data, }; - let mut account_infos = Vec::with_capacity(4 + 1 + remaining_accounts.len()); + let mut account_infos = Vec::with_capacity(5 + remaining_accounts.len()); account_infos.push(self.__program.clone()); account_infos.push(self.address.clone()); account_infos.push(self.authority.clone()); diff --git a/clients/rust/src/generated/instructions/deactivate_lookup_table.rs b/clients/rust/src/generated/instructions/deactivate_lookup_table.rs index 98a4071..77d1a38 100644 --- a/clients/rust/src/generated/instructions/deactivate_lookup_table.rs +++ b/clients/rust/src/generated/instructions/deactivate_lookup_table.rs @@ -203,7 +203,7 @@ impl<'a, 'b> DeactivateLookupTableCpi<'a, 'b> { accounts, data, }; - let mut account_infos = Vec::with_capacity(2 + 1 + remaining_accounts.len()); + let mut account_infos = Vec::with_capacity(3 + remaining_accounts.len()); account_infos.push(self.__program.clone()); account_infos.push(self.address.clone()); account_infos.push(self.authority.clone()); diff --git a/clients/rust/src/generated/instructions/extend_lookup_table.rs b/clients/rust/src/generated/instructions/extend_lookup_table.rs index 44eafa8..0caef8c 100644 --- a/clients/rust/src/generated/instructions/extend_lookup_table.rs +++ b/clients/rust/src/generated/instructions/extend_lookup_table.rs @@ -283,7 +283,7 @@ impl<'a, 'b> ExtendLookupTableCpi<'a, 'b> { accounts, data, }; - let mut account_infos = Vec::with_capacity(4 + 1 + remaining_accounts.len()); + let mut account_infos = Vec::with_capacity(5 + remaining_accounts.len()); account_infos.push(self.__program.clone()); account_infos.push(self.address.clone()); account_infos.push(self.authority.clone()); diff --git a/clients/rust/src/generated/instructions/freeze_lookup_table.rs b/clients/rust/src/generated/instructions/freeze_lookup_table.rs index e606764..94e074f 100644 --- a/clients/rust/src/generated/instructions/freeze_lookup_table.rs +++ b/clients/rust/src/generated/instructions/freeze_lookup_table.rs @@ -203,7 +203,7 @@ impl<'a, 'b> FreezeLookupTableCpi<'a, 'b> { accounts, data, }; - let mut account_infos = Vec::with_capacity(2 + 1 + remaining_accounts.len()); + let mut account_infos = Vec::with_capacity(3 + remaining_accounts.len()); account_infos.push(self.__program.clone()); account_infos.push(self.address.clone()); account_infos.push(self.authority.clone()); diff --git a/package.json b/package.json index 2afc50b..f3182a2 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "devDependencies": { "@iarna/toml": "^2.2.5", "@codama/renderers-js": "^1.0.0", - "@codama/renderers-rust": "^1.0.0", + "@codama/renderers-rust": "^1.0.3", "codama": "^1.0.0", "typescript": "^5.5.2", "zx": "^7.2.3" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4e6134d..7c7e669 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,8 +12,8 @@ importers: specifier: ^1.0.0 version: 1.0.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.5.3) '@codama/renderers-rust': - specifier: ^1.0.0 - version: 1.0.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.5.3) + specifier: ^1.0.3 + version: 1.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.5.3) '@iarna/toml': specifier: ^2.2.5 version: 2.2.5 @@ -48,8 +48,8 @@ packages: '@codama/renderers-js@1.0.0': resolution: {integrity: sha512-wi9eqrtLbTM49ELqKqxIgbTaf7xKMWT+HIqj6GN373G0OJnSKwUJPIXAGLO+RCls5DGjDuOE5svuThU0zBkfzA==} - '@codama/renderers-rust@1.0.0': - resolution: {integrity: sha512-2z+XN6KCTQFDfE30OQcRo2LW4+9dnYlqs8rSUhKO2YsRiCnOoMu/zrNSqLtjL84T2PAwReRq+vBifcE0zaOuRw==} + '@codama/renderers-rust@1.0.3': + resolution: {integrity: sha512-S2n+bq92q5YZ01Z+8klNNbvgVErKsJzUYWN0Y0rPymx2vwkHfTkeQHEOuckb/kzHJm9QGXrzkDtSDBy5EDS1Wg==} '@codama/validators@1.0.0': resolution: {integrity: sha512-jSfU5IrcGTvcqsJSBSzD3Ochig+hKKg2NKsT/vUfQ4jAw2cQrVUP5f4dMXyX779JYfHLHCwZnBYvgEdgi9gBZQ==} @@ -441,7 +441,7 @@ snapshots: - fastestsmallesttextencoderdecoder - typescript - '@codama/renderers-rust@1.0.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.5.3)': + '@codama/renderers-rust@1.0.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.5.3)': dependencies: '@codama/errors': 1.0.0 '@codama/nodes': 1.0.0 diff --git a/scripts/generate-clients.mjs b/scripts/generate-clients.mjs index d83d59f..5a397a8 100755 --- a/scripts/generate-clients.mjs +++ b/scripts/generate-clients.mjs @@ -22,6 +22,7 @@ codama.accept( const rustClient = path.join(__dirname, '..', 'clients', 'rust'); codama.accept( renderRustVisitor(path.join(rustClient, 'src', 'generated'), { + anchorTraits: false, formatCode: true, crateFolder: rustClient, toolchain: getToolchainArgument('format'),