Selaa lähdekoodia

harness: Rename to spl-associated-token-account-mollusk-harness (#159)

#### Problem

In order to publish the new ATA crate, we also need to publish the
mollusk harness.

#### Summary of changes

Make the mollusk harness crate name conform a bit more to the rest of
the repo, by calling it `spl-associated-token-account-mollusk-harness`.
It's a bit of a mouthful, but it's certainly clear!

Also, rename the directory from test_harness -> mollusk_harness to go
with the crate name.
Jon C 3 viikkoa sitten
vanhempi
sitoutus
fbc213fc91

+ 2 - 2
.github/workflows/main.yml

@@ -8,7 +8,7 @@ on:
 
 env:
   SBPF_PROGRAM_PACKAGES: "['program']"
-  RUST_PACKAGES: "['interface', 'program', 'test_harness']"
+  RUST_PACKAGES: "['interface', 'program', 'mollusk_harness']"
   WASM_PACKAGES: "['interface', 'program']"
 
 jobs:
@@ -30,7 +30,7 @@ jobs:
         shell: bash
         run: |
           echo "SBPF_PROGRAM_PACKAGES=${{ env.SBPF_PROGRAM_PACKAGES }}" >> $GITHUB_OUTPUT
-          echo "RUST_PACKAGES=${{ env.RUST_PACKAGES }}" >> $GITHUB_OUTPUT 
+          echo "RUST_PACKAGES=${{ env.RUST_PACKAGES }}" >> $GITHUB_OUTPUT
           echo "WASM_PACKAGES=${{ env.WASM_PACKAGES }}" >> $GITHUB_OUTPUT
           echo "RUST_TOOLCHAIN_NIGHTLY=$(make rust-toolchain-nightly)" >> "$GITHUB_OUTPUT"
           echo "SOLANA_CLI_VERSION=$(make solana-cli-version)" >> "$GITHUB_OUTPUT"

+ 23 - 23
Cargo.lock

@@ -348,28 +348,6 @@ dependencies = [
  "tokio",
 ]
 
-[[package]]
-name = "ata-mollusk-harness"
-version = "1.0.0"
-dependencies = [
- "mollusk-svm",
- "mollusk-svm-programs-token",
- "solana-account",
- "solana-instruction",
- "solana-keypair",
- "solana-program-error",
- "solana-program-option",
- "solana-program-pack",
- "solana-pubkey",
- "solana-rent",
- "solana-signer",
- "solana-system-interface",
- "solana-sysvar",
- "spl-associated-token-account-interface 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "spl-token-2022-interface",
- "spl-token-interface",
-]
-
 [[package]]
 name = "atomic-waker"
 version = "1.1.2"
@@ -3624,7 +3602,6 @@ dependencies = [
 name = "spl-associated-token-account"
 version = "7.0.0"
 dependencies = [
- "ata-mollusk-harness",
  "borsh",
  "mollusk-svm",
  "num-derive",
@@ -3643,6 +3620,7 @@ dependencies = [
  "solana-system-interface",
  "solana-sysvar",
  "spl-associated-token-account-interface 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "spl-associated-token-account-mollusk-harness",
  "spl-token-2022-interface",
  "spl-token-interface",
  "thiserror 2.0.17",
@@ -3669,6 +3647,28 @@ dependencies = [
  "solana-pubkey",
 ]
 
+[[package]]
+name = "spl-associated-token-account-mollusk-harness"
+version = "1.0.0"
+dependencies = [
+ "mollusk-svm",
+ "mollusk-svm-programs-token",
+ "solana-account",
+ "solana-instruction",
+ "solana-keypair",
+ "solana-program-error",
+ "solana-program-option",
+ "solana-program-pack",
+ "solana-pubkey",
+ "solana-rent",
+ "solana-signer",
+ "solana-system-interface",
+ "solana-sysvar",
+ "spl-associated-token-account-interface 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "spl-token-2022-interface",
+ "spl-token-interface",
+]
+
 [[package]]
 name = "spl-discriminator"
 version = "0.5.1"

+ 2 - 2
Cargo.toml

@@ -1,6 +1,6 @@
 [workspace]
 resolver = "2"
-members = ["interface", "program", "test_harness"]
+members = ["interface", "program", "mollusk_harness"]
 
 [workspace.metadata.cli]
 solana = "3.0.0"
@@ -17,4 +17,4 @@ config = "scripts/spellcheck.toml"
 [workspace.metadata.release]
 pre-release-commit-message = "Publish {{crate_name}} v{{version}}"
 tag-message = "Publish {{crate_name}} v{{version}}"
-consolidate-commits = false
+consolidate-commits = false

+ 1 - 1
test_harness/Cargo.toml → mollusk_harness/Cargo.toml

@@ -1,5 +1,5 @@
 [package]
-name = "ata-mollusk-harness"
+name = "spl-associated-token-account-mollusk-harness"
 version = "1.0.0"
 edition = "2021"
 license = "Apache-2.0"

+ 0 - 0
test_harness/src/lib.rs → mollusk_harness/src/lib.rs


+ 1 - 1
program/Cargo.toml

@@ -32,7 +32,7 @@ spl-token-2022-interface = "2.0.0"
 thiserror = "2.0"
 
 [dev-dependencies]
-ata-mollusk-harness = { version = "1.0.0", path = "../test_harness" }
+spl-associated-token-account-mollusk-harness = { version = "1.0.0", path = "../mollusk_harness" }
 mollusk-svm = { version = "0.7.0" }
 solana-keypair = "3.0"
 solana-signer = "3.0"

+ 4 - 4
program/tests/create_idempotent.rs

@@ -1,11 +1,11 @@
 use {
-    ata_mollusk_harness::{
-        build_create_ata_instruction, token_2022_immutable_owner_account_len,
-        token_2022_immutable_owner_rent_exempt_balance, AtaTestHarness, CreateAtaInstructionType,
-    },
     mollusk_svm::result::Check,
     solana_program_error::ProgramError,
     solana_pubkey::Pubkey,
+    spl_associated_token_account_mollusk_harness::{
+        build_create_ata_instruction, token_2022_immutable_owner_account_len,
+        token_2022_immutable_owner_rent_exempt_balance, AtaTestHarness, CreateAtaInstructionType,
+    },
 };
 
 #[test]

+ 1 - 1
program/tests/extended_mint.rs

@@ -1,7 +1,7 @@
 use {
-    ata_mollusk_harness::AtaTestHarness,
     mollusk_svm::result::Check,
     solana_program_error::ProgramError,
+    spl_associated_token_account_mollusk_harness::AtaTestHarness,
     spl_token_2022_interface::{
         extension::{
             transfer_fee, BaseStateWithExtensions, ExtensionType, StateWithExtensionsOwned,

+ 4 - 4
program/tests/process_create_associated_token_account.rs

@@ -1,14 +1,14 @@
 use {
-    ata_mollusk_harness::{
-        build_create_ata_instruction, token_2022_immutable_owner_rent_exempt_balance,
-        AtaTestHarness, CreateAtaInstructionType,
-    },
     mollusk_svm::result::Check,
     solana_instruction::AccountMeta,
     solana_program_error::ProgramError,
     solana_pubkey::Pubkey,
     solana_sysvar as sysvar,
     spl_associated_token_account_interface::address::get_associated_token_address_with_program_id,
+    spl_associated_token_account_mollusk_harness::{
+        build_create_ata_instruction, token_2022_immutable_owner_rent_exempt_balance,
+        AtaTestHarness, CreateAtaInstructionType,
+    },
 };
 
 #[test]

+ 1 - 1
program/tests/recover_nested.rs

@@ -1,5 +1,4 @@
 use {
-    ata_mollusk_harness::AtaTestHarness,
     mollusk_svm::result::Check,
     solana_instruction::AccountMeta,
     solana_program_error::ProgramError,
@@ -7,6 +6,7 @@ use {
     spl_associated_token_account_interface::{
         address::get_associated_token_address_with_program_id, instruction,
     },
+    spl_associated_token_account_mollusk_harness::AtaTestHarness,
     spl_token_2022_interface::extension::StateWithExtensionsOwned,
 };
 

+ 1 - 1
program/tests/spl_token_create.rs

@@ -1,4 +1,4 @@
-use ata_mollusk_harness::{AtaTestHarness, CreateAtaInstructionType};
+use spl_associated_token_account_mollusk_harness::{AtaTestHarness, CreateAtaInstructionType};
 
 #[test]
 fn success_create() {