Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 4d5c941

Browse files
authored
token-2022: Featurize the token-group processor (#5950)
1 parent 9f394ea commit 4d5c941

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

token/program-2022-test/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ version = "0.0.1"
1111
test-sbf = ["zk-ops"]
1212
default = ["zk-ops"]
1313
zk-ops = []
14-
proof-program = ["spl-token-2022/proof-program"]
1514

1615
[build-dependencies]
1716
walkdir = "2"

token/program-2022/Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ exclude = ["js/**"]
1212
no-entrypoint = []
1313
test-sbf = []
1414
serde-traits = ["dep:serde", "dep:serde_with", "dep:base64", "spl-pod/serde-traits"]
15-
# Remove these features once the underlying syscalls are released on all networks
16-
default = ["zk-ops"]
15+
default = ["token-group", "zk-ops"]
16+
# Remove this feature once the underlying syscalls are released on all networks
1717
zk-ops = []
18-
proof-program = []
18+
# Remove this feature once the token group implementation has been audited
19+
token-group = []
1920

2021
[dependencies]
2122
arrayref = "0.3.7"

token/program-2022/src/extension/token_group/processor.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ pub fn process_initialize_member(_program_id: &Pubkey, accounts: &[AccountInfo])
207207
}
208208

209209
/// Processes an [Instruction](enum.Instruction.html).
210+
#[cfg(feature = "token-group")]
210211
pub fn process_instruction(
211212
program_id: &Pubkey,
212213
accounts: &[AccountInfo],
@@ -231,3 +232,13 @@ pub fn process_instruction(
231232
}
232233
}
233234
}
235+
236+
/// Processes an [Instruction](enum.Instruction.html).
237+
#[cfg(not(feature = "token-group"))]
238+
pub fn process_instruction(
239+
_program_id: &Pubkey,
240+
_accounts: &[AccountInfo],
241+
_instruction: TokenGroupInstruction,
242+
) -> ProgramResult {
243+
Err(TokenError::InvalidInstruction.into())
244+
}

0 commit comments

Comments
 (0)