From fd9026d68ebc7e1bc2aeb7af73d04e8161eeeaf8 Mon Sep 17 00:00:00 2001 From: Matiukhin Vlad <87382371+rwwwx@users.noreply.github.com> Date: Mon, 22 Jul 2024 12:05:06 +0300 Subject: [PATCH] update mpl token auth rules to the recent 1.18 solana (#154) update mpl-token-auth-rules to the recent 1.18 solana --- .github/.env | 4 ++-- .github/workflows/build-programs.yml | 4 ++-- programs/token-auth-rules/Cargo.toml | 13 ++++++++----- .../token-auth-rules/tests/buffered_rule_set.rs | 4 ++-- programs/token-auth-rules/tests/utils/mod.rs | 2 +- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/.env b/.github/.env index 0b9ea2dc..c7e3e1f1 100644 --- a/.github/.env +++ b/.github/.env @@ -1,7 +1,7 @@ CARGO_TERM_COLOR=always NODE_VERSION=18.x PROGRAMS=["token-auth-rules"] -RUST_VERSION=1.70.0 -SOLANA_VERSION=1.17.20 +RUST_VERSION=1.79.0 +SOLANA_VERSION=1.18.9 COMMIT_USER_NAME="github-actions[bot]" COMMIT_USER_EMAIL="41898282+github-actions[bot]@users.noreply.github.com" diff --git a/.github/workflows/build-programs.yml b/.github/workflows/build-programs.yml index 0650c6c3..8ba56c4d 100644 --- a/.github/workflows/build-programs.yml +++ b/.github/workflows/build-programs.yml @@ -11,12 +11,12 @@ on: inputs: rust: description: Rust version - default: 1.70.0 + default: 1.79.0 required: true type: string solana: description: Solana version - default: 1.17.20 + default: 1.18.9 required: true type: string diff --git a/programs/token-auth-rules/Cargo.toml b/programs/token-auth-rules/Cargo.toml index 4b40731a..5b247646 100644 --- a/programs/token-auth-rules/Cargo.toml +++ b/programs/token-auth-rules/Cargo.toml @@ -19,8 +19,8 @@ rmp-serde = "1.1.1" serde = { version = "1.0.149", features = ["derive"]} serde_with = { version = "1.14.0", optional = true } shank = "0.3.0" -solana-program = ">= 1.14.13, < 1.18" -solana-zk-token-sdk = ">= 1.14.13, < 1.18" +solana-program = ">= 1.14.13, < 1.19" +solana-zk-token-sdk = ">= 1.14.13, < 1.19" thiserror = "1.0" [features] @@ -31,9 +31,9 @@ test-sbf = [] [dev-dependencies] assert_matches = "1.5.0" serde_json = "1.0.87" -solana-logger = ">= 1.14.13, < 1.18" -solana-program-test = ">= 1.14.13, < 1.18" -solana-sdk = ">= 1.14.13, < 1.18" +solana-logger = ">= 1.14.13, < 1.19" +solana-program-test = ">= 1.14.13, < 1.19" +solana-sdk = ">= 1.14.13, < 1.19" spl-associated-token-account = { version = "1.1.1", features = ["no-entrypoint"] } spl-token = { version = "3.5.0", features = [ "no-entrypoint" ] } @@ -42,3 +42,6 @@ crate-type = ["cdylib", "lib"] [profile.release] overflow-checks = true # Enable integer overflow checks. + +[profile.test] +debug = 0 # Reduce space usage to avoid CD/CD fails when running test. diff --git a/programs/token-auth-rules/tests/buffered_rule_set.rs b/programs/token-auth-rules/tests/buffered_rule_set.rs index 0942dd84..42d069f4 100644 --- a/programs/token-auth-rules/tests/buffered_rule_set.rs +++ b/programs/token-auth-rules/tests/buffered_rule_set.rs @@ -110,7 +110,7 @@ async fn buffered_rule_set() { .instruction(); // Fail to validate Transfer operation. - let err = process_failing_validate_ix!(&mut context, validate_ix, vec![], None).await; + let err = process_failing_validate_ix!(&mut context, validate_ix, vec![], Some(300000)).await; // Check that error is what we expect. assert_custom_error!(err, RuleSetError::PubkeyListMatchCheckFailed); @@ -145,5 +145,5 @@ async fn buffered_rule_set() { .instruction(); // Validate Transfer operation. - process_passing_validate_ix!(&mut context, validate_ix, vec![], None).await; + process_passing_validate_ix!(&mut context, validate_ix, vec![], Some(300000)).await; } diff --git a/programs/token-auth-rules/tests/utils/mod.rs b/programs/token-auth-rules/tests/utils/mod.rs index d0a66380..bac55170 100644 --- a/programs/token-auth-rules/tests/utils/mod.rs +++ b/programs/token-auth-rules/tests/utils/mod.rs @@ -604,7 +604,7 @@ macro_rules! assert_custom_error { match $error { solana_program_test::BanksClientError::TransactionError( solana_sdk::transaction::TransactionError::InstructionError( - 0, + _, solana_program::instruction::InstructionError::Custom(x), ), ) => match num_traits::FromPrimitive::from_i32(x as i32) {