Skip to content

Commit

Permalink
transfer-hook-interface: Remove solana-program dependency (#7442)
Browse files Browse the repository at this point in the history
* transfer-hook-interface: Remove solana-program dependency

#### Problem

The transfer-hook-interface pulls in solana-program, but it doesn't need
to.

#### Summary of changes

Use the component crates. The only breaking change is the re-exports. It
still uses a dev-dependency on solana-program since the system program
id isn't available yet outside of solana-program.

* Add missing solana-pubkey feature

* Add all test programs

* Run cargo fmt

* Fixup imports
  • Loading branch information
joncinque authored Nov 1, 2024
1 parent 2454528 commit e07fe68
Show file tree
Hide file tree
Showing 27 changed files with 484 additions and 244 deletions.
62 changes: 62 additions & 0 deletions Cargo.lock

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

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ members = [
"token/program",
"token/program-2022",
"token/program-2022-test",
"token/program-2022-test/transfer-hook-test-programs/downgrade",
"token/program-2022-test/transfer-hook-test-programs/fail",
"token/program-2022-test/transfer-hook-test-programs/success",
"token/program-2022-test/transfer-hook-test-programs/swap",
"token/program-2022-test/transfer-hook-test-programs/swap-with-fee",
"token/transfer-hook/cli",
"token/transfer-hook/example",
"token/transfer-hook/interface",
Expand Down
26 changes: 26 additions & 0 deletions token/program-2022-test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## SPL Token 2022 Program Tests

All of the end-to-end tests for spl-token-2022 exist in this directory.

### Requirements

These tests require other built on-chain programs, including:

* spl-instruction-padding
* spl-transfer-hook-example
* spl-transfer-hook-example-downgrade
* spl-transfer-hook-example-fail
* spl-transfer-hook-example-success
* spl-transfer-hook-example-swap
* spl-transfer-hook-example-swap-with-fee

Built versions of these programs exist in `tests/fixtures`, and may be
regenerated from the following places in this repo:

* instruction-padding/program
* token/transfer-hook/example
* token/program-2022-test/transfer-hook-test-programs/downgrade
* token/program-2022-test/transfer-hook-test-programs/fail
* token/program-2022-test/transfer-hook-test-programs/success
* token/program-2022-test/transfer-hook-test-programs/swap
* token/program-2022-test/transfer-hook-test-programs/swap-with-fee
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit e07fe68

Please sign in to comment.