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

Commit b817b2d

Browse files
authored
transfer-hook: Move interface and example into subfolders (#5640)
1 parent 244c6e2 commit b817b2d

File tree

20 files changed

+24
-24
lines changed

20 files changed

+24
-24
lines changed

.github/workflows/pull-request-token.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ jobs:
146146
echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
147147
148148
- name: Build and test transfer hook example
149-
run: ./ci/cargo-test-sbf.sh token/transfer-hook-example
149+
run: ./ci/cargo-test-sbf.sh token/transfer-hook/example
150150

151151
- name: Upload program
152152
uses: actions/upload-artifact@v2

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ members = [
5757
"token/program",
5858
"token/program-2022",
5959
"token/program-2022-test",
60-
"token/transfer-hook-example",
61-
"token/transfer-hook-interface",
60+
"token/transfer-hook/example",
61+
"token/transfer-hook/interface",
6262
"token/client",
6363
"utils/cgen",
6464
"utils/test-client",

docs/src/token-2022/extensions.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,22 +1346,22 @@ explained in detail in many of the linked `README` files below under
13461346
#### Resources
13471347

13481348
The interface description and structs exist at
1349-
[spl-transfer-hook-interface](https://github.com/solana-labs/solana-program-library/tree/master/token/transfer-hook-interface),
1349+
[spl-transfer-hook-interface](https://github.com/solana-labs/solana-program-library/tree/master/token/transfer-hook/interface),
13501350
along with a sample minimal program implementation. You can find detailed
13511351
instructions on how to implement this interface for an on-chain program or
13521352
interact with a program that implements transfer-hook in the repository's
1353-
[README](https://github.com/solana-labs/solana-program-library/tree/master/token/transfer-hook-interface/README.md).
1353+
[README](https://github.com/solana-labs/solana-program-library/tree/master/token/transfer-hook/interface/README.md).
13541354

13551355
The `spl-transfer-hook-interface` library provides offchain and onchain helpers
13561356
for resolving the additional accounts required. See
1357-
[invoke.rs](https://github.com/solana-labs/solana-program-library/tree/master/token/transfer-hook-interface/src/invoke.rs)
1357+
[invoke.rs](https://github.com/solana-labs/solana-program-library/tree/master/token/transfer-hook/interface/src/invoke.rs)
13581358
for usage on-chain, and
1359-
[offchain.rs](https://github.com/solana-labs/solana-program-library/tree/master/token/transfer-hook-interface/src/offchain.rs)
1359+
[offchain.rs](https://github.com/solana-labs/solana-program-library/tree/master/token/transfer-hook/interface/src/offchain.rs)
13601360
for fetching the additional required account metas with any async off-chain client
13611361
like `BanksClient` or `RpcClient`.
13621362

13631363
A usable example program exists at
1364-
[spl-transfer-hook-example](https://github.com/solana-labs/solana-program-library/tree/master/token/transfer-hook-example).
1364+
[spl-transfer-hook-example](https://github.com/solana-labs/solana-program-library/tree/master/token/transfer-hook/example).
13651365
Token-2022 uses this example program in tests to ensure that it properly uses
13661366
the transfer hook interface.
13671367

token/client/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ spl-memo = { version = "4.0.0", path = "../../memo/program", features = ["no-ent
2525
spl-token = { version = "4.0", path="../program", features = [ "no-entrypoint" ] }
2626
spl-token-2022 = { version = "0.9", path="../program-2022" }
2727
spl-token-metadata-interface = { version = "0.2", path="../../token-metadata/interface" }
28-
spl-transfer-hook-interface = { version = "0.3", path="../transfer-hook-interface" }
28+
spl-transfer-hook-interface = { version = "0.3", path="../transfer-hook/interface" }
2929
thiserror = "1.0"
3030

3131
[features]

token/program-2022-test/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ spl-token-2022 = { version = "0.9", path="../program-2022", features = ["no-entr
3030
spl-instruction-padding = { version = "0.1.0", path="../../instruction-padding/program", features = ["no-entrypoint"] }
3131
spl-token-client = { version = "0.7", path = "../client" }
3232
spl-token-metadata-interface = { version = "0.2", path = "../../token-metadata/interface" }
33-
spl-transfer-hook-example = { version = "0.3", path="../transfer-hook-example", features = ["no-entrypoint"] }
34-
spl-transfer-hook-interface = { version = "0.3", path="../transfer-hook-interface" }
33+
spl-transfer-hook-example = { version = "0.3", path="../transfer-hook/example", features = ["no-entrypoint"] }
34+
spl-transfer-hook-interface = { version = "0.3", path="../transfer-hook/interface" }
3535
test-case = "3.2"

token/program-2022/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ solana-zk-token-sdk = "1.17.2"
2828
spl-memo = { version = "4.0.0", path = "../../memo/program", features = [ "no-entrypoint" ] }
2929
spl-token = { version = "4.0", path = "../program", features = ["no-entrypoint"] }
3030
spl-token-metadata-interface = { version = "0.2.0", path = "../../token-metadata/interface" }
31-
spl-transfer-hook-interface = { version = "0.3.0", path = "../transfer-hook-interface" }
31+
spl-transfer-hook-interface = { version = "0.3.0", path = "../transfer-hook/interface" }
3232
spl-type-length-value = { version = "0.3.0", path = "../../libraries/type-length-value" }
3333
spl-pod = { version = "0.1.0", path = "../../libraries/pod" }
3434
thiserror = "1.0"

token/transfer-hook-example/Cargo.toml renamed to token/transfer-hook/example/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ test-sbf = []
1414
[dependencies]
1515
arrayref = "0.3.7"
1616
solana-program = "1.17.2"
17-
spl-tlv-account-resolution = { version = "0.4" , path = "../../libraries/tlv-account-resolution" }
18-
spl-token-2022 = { version = "0.9", path = "../program-2022", features = ["no-entrypoint"] }
19-
spl-transfer-hook-interface = { version = "0.3" , path = "../transfer-hook-interface" }
20-
spl-type-length-value = { version = "0.3" , path = "../../libraries/type-length-value" }
17+
spl-tlv-account-resolution = { version = "0.4" , path = "../../../libraries/tlv-account-resolution" }
18+
spl-token-2022 = { version = "0.9", path = "../../program-2022", features = ["no-entrypoint"] }
19+
spl-transfer-hook-interface = { version = "0.3" , path = "../interface" }
20+
spl-type-length-value = { version = "0.3" , path = "../../../libraries/type-length-value" }
2121

2222
[dev-dependencies]
2323
solana-program-test = "1.17.2"

token/transfer-hook-example/README.md renamed to token/transfer-hook/example/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Full example program and tests implementing the `spl-transfer-hook-interface`,
44
to be used for testing a program that calls into the `spl-transfer-hook-interface`.
55

66
See the
7-
[SPL Transfer Hook Interface](https://github.com/solana-labs/solana-program-library/tree/master/token/transfer-hook-interface)
7+
[SPL Transfer Hook Interface](https://github.com/solana-labs/solana-program-library/tree/master/token/transfer-hook/interface)
88
code for more information.
99

1010
### Example usage of example

0 commit comments

Comments
 (0)