Skip to content

Commit

Permalink
transaction-status: Add confidential transfer tests (#3786)
Browse files Browse the repository at this point in the history
#### Problem

The new parsers for the confidential transfer extensions in #3431 don't
have any tests, which is dangerous because they involve indexing
directly into arrays, which can panic at runtime.

#### Summary of changes

Add tests for all the instructions involving proofs, which have the more
complicated parsing logic. Specifically, it's testing to make sure that
nothing panics.

These tests actually uncovered a bug that triggered a panic for
instructions with just barely enough accounts and also the instructions
sysvar.

(cherry picked from commit 8730dbb)

# Conflicts:
#	Cargo.toml
#	transaction-status/src/parse_token/extension/confidential_mint_burn.rs
#	transaction-status/src/parse_token/extension/confidential_transfer.rs
  • Loading branch information
joncinque authored and mergify[bot] committed Nov 26, 2024
1 parent 92f639b commit 242d98c
Show file tree
Hide file tree
Showing 6 changed files with 1,113 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ solana-zk-sdk = { path = "zk-sdk", version = "=2.1.3" }
solana-zk-token-proof-program = { path = "programs/zk-token-proof", version = "=2.1.3" }
solana-zk-token-sdk = { path = "zk-token-sdk", version = "=2.1.3" }
solana_rbpf = "=0.8.5"
<<<<<<< HEAD
spl-associated-token-account = "=4.0.0"
spl-instruction-padding = "0.2"
spl-memo = "=5.0.0"
Expand All @@ -538,6 +539,17 @@ spl-token = "=6.0.0"
spl-token-2022 = "=4.0.0"
spl-token-group-interface = "=0.3.0"
spl-token-metadata-interface = "=0.4.0"
=======
spl-associated-token-account = "=6.0.0"
spl-instruction-padding = "0.3"
spl-memo = "=6.0.0"
spl-pod = "=0.5.0"
spl-token = "=7.0.0"
spl-token-2022 = "=6.0.0"
spl-token-confidential-transfer-proof-extraction = "0.2.0"
spl-token-group-interface = "=0.5.0"
spl-token-metadata-interface = "=0.6.0"
>>>>>>> 8730dbbb88 (transaction-status: Add confidential transfer tests (#3786))
static_assertions = "1.1.0"
stream-cancel = "0.8.2"
strum = "0.24"
Expand Down
4 changes: 4 additions & 0 deletions transaction-status/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,9 @@ spl-token-group-interface = { workspace = true }
spl-token-metadata-interface = { workspace = true }
thiserror = { workspace = true }

[dev-dependencies]
bytemuck = { workspace = true }
spl-token-confidential-transfer-proof-extraction = { workspace = true }

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
Loading

0 comments on commit 242d98c

Please sign in to comment.