Skip to content

Commit

Permalink
chore: bump anchor to 0.30.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ananas-block committed Jan 5, 2025
1 parent 4cbc426 commit 728e2b4
Show file tree
Hide file tree
Showing 11 changed files with 275 additions and 134 deletions.
354 changes: 255 additions & 99 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ spl-token = "=4.0.0"
spl-token-2022 = {version="3.0.5", no-default-features = true, features = ["no-entrypoint"]}

# Anchor
anchor-lang = "=0.29.0"
anchor-spl = "=0.29.0"
anchor-lang = "=0.30.1"
anchor-spl = "=0.30.1"

# Anchor compatibility
borsh = "0.10.0"
Expand Down
2 changes: 1 addition & 1 deletion programs/account-compression/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ no-log-ix-name = []
cpi = ["no-entrypoint"]
custom-heap = ["light-heap"]
mem-profiling = []
default = ["custom-heap", "test"]
default = ["custom-heap", "test", "no-idl"]
test-sbf = []
bench-sbf = []
test = []
Expand Down
4 changes: 3 additions & 1 deletion programs/compressed-token/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ no-log-ix-name = []
cpi = ["no-entrypoint"]
custom-heap = ["light-heap"]
mem-profiling = []
default = ["custom-heap", "idl-build"]
default = ["custom-heap", "no-idl"]
test-sbf = []
bench-sbf = []
cpi-context = []
idl-build = ["anchor-lang/idl-build", "anchor-spl/idl-build"]
no-idl = []


[dependencies]
anchor-lang = { workspace = true }
Expand Down
12 changes: 0 additions & 12 deletions programs/compressed-token/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,18 +162,6 @@ pub mod light_compressed_token {
) -> Result<()> {
burn::process_burn(ctx, inputs)
}

/// This function is a stub to allow Anchor to include the input types in
/// the IDL. It should not be included in production builds nor be called in
/// practice.
#[cfg(feature = "idl-build")]
pub fn stub_idl_build<'info>(
_ctx: Context<'_, '_, '_, 'info, TransferInstruction<'info>>,
_inputs1: CompressedTokenInstructionDataTransfer,
_inputs2: TokenData,
) -> Result<()> {
Err(ErrorCode::InstructionNotCallable.into())
}
}

#[error_code]
Expand Down
4 changes: 1 addition & 3 deletions programs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
"version": "0.3.0",
"license": "Apache-2.0",
"scripts": {
"push-idls": "../scripts/push-stateless-js-idls.sh && ../scripts/push-compressed-token-idl.sh",
"build": "anchor build",
"build-idls": "anchor build && pnpm build-system && pnpm build-compressed-token && pnpm push-idls",
"build": "../scripts/build-programs.sh",
"build-system": "anchor build --program-name light_system_program -- --features idl-build custom-heap",
"build-compressed-token": "anchor build --program-name light_compressed_token -- --features idl-build custom-heap",
"test": "pnpm test-account-compression && pnpm test-system && pnpm test-compressed-token && pnpm test-registry",
Expand Down
2 changes: 1 addition & 1 deletion programs/registry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ no-log-ix-name = []
cpi = ["no-entrypoint"]
custom-heap = ["light-heap"]
mem-profiling = []
default = ["custom-heap", "mem-profiling"]
default = ["custom-heap", "mem-profiling", "no-idl"]
test-sbf = []
bench-sbf = []
sdk = []
Expand Down
3 changes: 2 additions & 1 deletion programs/system/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ no-log-ix-name = []
cpi = ["no-entrypoint"]
custom-heap = ["light-heap"]
mem-profiling = []
default = ["custom-heap", "idl-build"]
no-idl = []
default = ["custom-heap", "no-idl"]
test-sbf = []
bench-sbf = []
idl-build = ["anchor-lang/idl-build"]
Expand Down
14 changes: 0 additions & 14 deletions programs/system/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ pub mod errors;
pub mod sdk;
pub mod utils;
use errors::SystemProgramError;
use sdk::event::PublicTransactionEvent;

declare_id!("SySTEM1eSU2p4BGQfQpimFEWWSC1XDFeun3Nqzz3rT7");

Expand Down Expand Up @@ -104,17 +103,4 @@ pub mod light_system_program {
inputs.read_only_accounts,
)
}

/// This function is a stub to allow Anchor to include the input types in
/// the IDL. It should not be included in production builds nor be called in
/// practice.
#[cfg(feature = "idl-build")]
pub fn stub_idl_build<'info>(
_ctx: Context<'_, '_, '_, 'info, InvokeInstruction<'info>>,
_inputs1: InstructionDataInvoke,
_inputs2: InstructionDataInvokeCpi,
_inputs3: PublicTransactionEvent,
) -> Result<()> {
Err(SystemProgramError::InstructionNotCallable.into())
}
}
5 changes: 5 additions & 0 deletions scripts/build-programs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# use with npx nx run @lightprotocol/programs:build
cd account-compression/ && cargo build-sbf && cd -
cd registry/ && cargo build-sbf && cd -
cd system/ && cargo build-sbf && cd -
cd compressed-token/ && cargo build-sbf && cd -
5 changes: 5 additions & 0 deletions scripts/format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ cargo clippy \
--exclude name-service \
--exclude photon-api \
--exclude name-service \
# --exclude account-compression \
# --exclude light-compressed-token \
# --exclude light-system-program \
# --exclude light-registry \
# --exclude light-test-utils \
-- -A clippy::result_large_err \
-A clippy::empty-docs \
-A clippy::to-string-trait-impl \
Expand Down

0 comments on commit 728e2b4

Please sign in to comment.