From d1cac82c6c8a5ef8e2536c5365d785c5a489260d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wei=C3=9Fer=20Hase?= Date: Thu, 19 Sep 2024 16:06:06 +0200 Subject: [PATCH] fix: running tests on workflow --- .github/workflows/rust.yml | 6 +----- program/src/instruction.rs | 4 ++-- program/src/state.rs | 4 +--- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index f7771a1..7f607d8 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -26,10 +26,6 @@ jobs: - name: Setup Rust uses: actions-rust-lang/setup-rust-toolchain@v1 - - name: Build - working-directory: program - run: cargo build --verbose - - name: Run tests working-directory: program - run: cargo test --verbose + run: cargo test --features test-bpf diff --git a/program/src/instruction.rs b/program/src/instruction.rs index fd18f6b..5e3f828 100644 --- a/program/src/instruction.rs +++ b/program/src/instruction.rs @@ -29,9 +29,9 @@ impl Arbitrary for VestingInstruction { 1 => { let schedules: [Schedule; 10] = u.arbitrary()?; let key_bytes: [u8; 32] = u.arbitrary()?; - let mint_address: Pubkey = Pubkey::new(&key_bytes); + let mint_address: Pubkey = Pubkey::new_from_array(key_bytes); let key_bytes: [u8; 32] = u.arbitrary()?; - let destination_token_address: Pubkey = Pubkey::new(&key_bytes); + let destination_token_address: Pubkey = Pubkey::new_from_array(key_bytes); return Ok(Self::Create { seeds, mint_address, diff --git a/program/src/state.rs b/program/src/state.rs index 2d3d921..e8a0fd0 100644 --- a/program/src/state.rs +++ b/program/src/state.rs @@ -1,12 +1,10 @@ -use std::convert::TryFrom; - use solana_program::{ program_error::ProgramError, program_pack::{IsInitialized, Pack, Sealed}, pubkey::Pubkey, }; -use std::convert::TryInto; +use std::convert::{TryFrom, TryInto}; #[derive(Debug, PartialEq)] pub struct VestingSchedule { pub release_time: u64,