From 6d160768d74d5b01c054b6fdeb1f6351cf354df6 Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" <75863576+jeffwashington@users.noreply.github.com> Date: Mon, 26 Apr 2021 08:50:46 -0500 Subject: [PATCH] delete vest program (#16795) --- Cargo.lock | 18 - Cargo.toml | 1 - genesis/Cargo.toml | 1 - genesis/src/main.rs | 8 +- local-cluster/Cargo.toml | 1 - local-cluster/tests/local_cluster.rs | 7 +- programs/vest/Cargo.toml | 31 -- programs/vest/src/lib.rs | 13 - programs/vest/src/vest_instruction.rs | 171 ------- programs/vest/src/vest_processor.rs | 697 -------------------------- programs/vest/src/vest_schedule.rs | 166 ------ programs/vest/src/vest_state.rs | 191 ------- 12 files changed, 2 insertions(+), 1303 deletions(-) delete mode 100644 programs/vest/Cargo.toml delete mode 100644 programs/vest/src/lib.rs delete mode 100644 programs/vest/src/vest_instruction.rs delete mode 100644 programs/vest/src/vest_processor.rs delete mode 100644 programs/vest/src/vest_schedule.rs delete mode 100644 programs/vest/src/vest_state.rs diff --git a/Cargo.lock b/Cargo.lock index 74338df22e..0724a55fe2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4503,7 +4503,6 @@ dependencies = [ "solana-sdk", "solana-stake-program", "solana-version", - "solana-vest-program", "solana-vote-program", "tempfile", ] @@ -4687,7 +4686,6 @@ dependencies = [ "solana-runtime", "solana-sdk", "solana-stake-program", - "solana-vest-program", "solana-vote-program", "tempfile", ] @@ -5416,22 +5414,6 @@ dependencies = [ "solana-sdk", ] -[[package]] -name = "solana-vest-program" -version = "1.7.0" -dependencies = [ - "bincode", - "chrono", - "num-derive", - "num-traits", - "serde", - "serde_derive", - "solana-config-program", - "solana-runtime", - "solana-sdk", - "thiserror", -] - [[package]] name = "solana-vote-program" version = "1.7.0" diff --git a/Cargo.toml b/Cargo.toml index 3ad6587191..2a7a8d5650 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,7 +49,6 @@ members = [ "programs/noop", "programs/ownable", "programs/stake", - "programs/vest", "programs/vote", "remote-wallet", "ramp-tps", diff --git a/genesis/Cargo.toml b/genesis/Cargo.toml index d5bb773c3c..851f1b5084 100644 --- a/genesis/Cargo.toml +++ b/genesis/Cargo.toml @@ -26,7 +26,6 @@ solana-runtime = { path = "../runtime", version = "=1.7.0" } solana-sdk = { path = "../sdk", version = "=1.7.0" } solana-stake-program = { path = "../programs/stake", version = "=1.7.0" } solana-version = { path = "../version", version = "=1.7.0" } -solana-vest-program = { path = "../programs/vest", version = "=1.7.0" } solana-vote-program = { path = "../programs/vote", version = "=1.7.0" } tempfile = "3.1.0" diff --git a/genesis/src/main.rs b/genesis/src/main.rs index 30363d033b..683057b937 100644 --- a/genesis/src/main.rs +++ b/genesis/src/main.rs @@ -5,8 +5,6 @@ extern crate solana_budget_program; #[macro_use] extern crate solana_exchange_program; -#[macro_use] -extern crate solana_vest_program; use clap::{crate_description, crate_name, value_t, value_t_or_exit, App, Arg, ArgMatches}; use solana_clap_utils::{ @@ -494,11 +492,7 @@ fn main() -> Result<(), Box> { ); let native_instruction_processors = if cluster_type == ClusterType::Development { - vec![ - solana_vest_program!(), - solana_budget_program!(), - solana_exchange_program!(), - ] + vec![solana_budget_program!(), solana_exchange_program!()] } else { vec![] }; diff --git a/local-cluster/Cargo.toml b/local-cluster/Cargo.toml index 54f8408f95..5c1e3f307b 100644 --- a/local-cluster/Cargo.toml +++ b/local-cluster/Cargo.toml @@ -28,7 +28,6 @@ solana-logger = { path = "../logger", version = "=1.7.0" } solana-runtime = { path = "../runtime", version = "=1.7.0" } solana-sdk = { path = "../sdk", version = "=1.7.0" } solana-stake-program = { path = "../programs/stake", version = "=1.7.0" } -solana-vest-program = { path = "../programs/vest", version = "=1.7.0" } solana-vote-program = { path = "../programs/vote", version = "=1.7.0" } tempfile = "3.1.0" solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "=1.7.0" } diff --git a/local-cluster/tests/local_cluster.rs b/local-cluster/tests/local_cluster.rs index ab250c1102..c15de57310 100644 --- a/local-cluster/tests/local_cluster.rs +++ b/local-cluster/tests/local_cluster.rs @@ -1070,12 +1070,7 @@ fn test_mainnet_beta_cluster_type() { } // Programs that are not available at epoch 0 - for program_id in [ - &solana_sdk::bpf_loader_upgradeable::id(), - &solana_vest_program::id(), - ] - .iter() - { + for program_id in [&solana_sdk::bpf_loader_upgradeable::id()].iter() { assert_eq!( ( program_id, diff --git a/programs/vest/Cargo.toml b/programs/vest/Cargo.toml deleted file mode 100644 index bb41aab485..0000000000 --- a/programs/vest/Cargo.toml +++ /dev/null @@ -1,31 +0,0 @@ -[package] -name = "solana-vest-program" -version = "1.7.0" -description = "Solana Vest program" -authors = ["Solana Maintainers "] -repository = "https://github.com/solana-labs/solana" -license = "Apache-2.0" -homepage = "https://solana.com/" -documentation = "https://docs.rs/solana-vest-program" -edition = "2018" - -[dependencies] -bincode = "1.3.1" -chrono = { version = "0.4.11", features = ["serde"] } -num-derive = "0.3" -num-traits = "0.2" -serde = "1.0.122" -serde_derive = "1.0.103" -solana-sdk = { path = "../../sdk", version = "=1.7.0" } -solana-config-program = { path = "../config", version = "=1.7.0" } -thiserror = "1.0" - -[dev-dependencies] -solana-runtime = { path = "../../runtime", version = "=1.7.0" } - -[lib] -crate-type = ["lib"] -name = "solana_vest_program" - -[package.metadata.docs.rs] -targets = ["x86_64-unknown-linux-gnu"] diff --git a/programs/vest/src/lib.rs b/programs/vest/src/lib.rs deleted file mode 100644 index 415ef3d418..0000000000 --- a/programs/vest/src/lib.rs +++ /dev/null @@ -1,13 +0,0 @@ -#![allow(clippy::integer_arithmetic)] -pub mod vest_instruction; -pub mod vest_processor; -pub mod vest_schedule; -pub mod vest_state; - -use crate::vest_processor::process_instruction; - -solana_sdk::declare_program!( - "Vest111111111111111111111111111111111111111", - solana_vest_program, - process_instruction -); diff --git a/programs/vest/src/vest_instruction.rs b/programs/vest/src/vest_instruction.rs deleted file mode 100644 index c72af0ea61..0000000000 --- a/programs/vest/src/vest_instruction.rs +++ /dev/null @@ -1,171 +0,0 @@ -use crate::{id, vest_state::VestState}; -use bincode::serialized_size; -use chrono::prelude::{Date, DateTime, Utc}; -use num_derive::FromPrimitive; -use serde_derive::{Deserialize, Serialize}; -use solana_sdk::{ - decode_error::DecodeError, - instruction::{AccountMeta, Instruction, InstructionError}, - pubkey::Pubkey, - system_instruction, -}; -use thiserror::Error; - -#[derive(Error, Debug, Clone, PartialEq, FromPrimitive)] -pub enum VestError { - #[error("destination missing")] - DestinationMissing, - - #[error("unauthorized")] - Unauthorized, -} - -impl From for InstructionError { - fn from(e: VestError) -> Self { - InstructionError::Custom(e as u32) - } -} - -impl DecodeError for VestError { - fn type_of() -> &'static str { - "VestError" - } -} - -/// An instruction to progress the smart contract. -#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)] -pub enum VestInstruction { - /// Declare and instantiate a vesting schedule - InitializeAccount { - terminator_pubkey: Pubkey, // The address authorized to terminate this contract with a signed Terminate instruction - payee_pubkey: Pubkey, // The address authorized to redeem vested tokens - start_date_time: DateTime, // The day from which the vesting contract begins - date_pubkey: Pubkey, // Address of an account containing a trusted date, used to drive the vesting schedule - total_lamports: u64, // The number of lamports to send the payee if the schedule completes - }, - - /// Change the terminator pubkey - SetTerminator(Pubkey), - - /// Change the payee pubkey - SetPayee(Pubkey), - - /// Load an account and pass its data to the contract for inspection. - RedeemTokens, - - /// Tell the contract that the `InitializeAccount` with `Signature` has been - /// signed by the containing transaction's `Pubkey`. - Terminate, - - /// Reduce total_lamports by the given number of lamports. Tokens that have - /// already vested are unaffected. Use this instead of `Terminate` to minimize - /// the number of token transfers. - Renege(u64), - - /// Mark all available tokens as redeemable, regardless of the date. - VestAll, -} - -fn initialize_account( - terminator_pubkey: &Pubkey, - payee_pubkey: &Pubkey, - contract_pubkey: &Pubkey, - start_date: Date, - date_pubkey: &Pubkey, - total_lamports: u64, -) -> Instruction { - let keys = vec![AccountMeta::new(*contract_pubkey, false)]; - Instruction::new_with_bincode( - id(), - &VestInstruction::InitializeAccount { - terminator_pubkey: *terminator_pubkey, - payee_pubkey: *payee_pubkey, - start_date_time: start_date.and_hms(0, 0, 0), - date_pubkey: *date_pubkey, - total_lamports, - }, - keys, - ) -} - -pub fn create_account( - payer_pubkey: &Pubkey, - terminator_pubkey: &Pubkey, - contract_pubkey: &Pubkey, - payee_pubkey: &Pubkey, - start_date: Date, - date_pubkey: &Pubkey, - lamports: u64, -) -> Vec { - let space = serialized_size(&VestState::default()).unwrap(); - vec![ - system_instruction::create_account(&payer_pubkey, contract_pubkey, lamports, space, &id()), - initialize_account( - terminator_pubkey, - payee_pubkey, - contract_pubkey, - start_date, - date_pubkey, - lamports, - ), - ] -} - -pub fn set_terminator(contract: &Pubkey, old_pubkey: &Pubkey, new_pubkey: &Pubkey) -> Instruction { - let account_metas = vec![ - AccountMeta::new(*contract, false), - AccountMeta::new(*old_pubkey, true), - ]; - Instruction::new_with_bincode( - id(), - &VestInstruction::SetTerminator(*new_pubkey), - account_metas, - ) -} - -pub fn set_payee(contract: &Pubkey, old_pubkey: &Pubkey, new_pubkey: &Pubkey) -> Instruction { - let account_metas = vec![ - AccountMeta::new(*contract, false), - AccountMeta::new(*old_pubkey, true), - ]; - Instruction::new_with_bincode(id(), &VestInstruction::SetPayee(*new_pubkey), account_metas) -} - -pub fn redeem_tokens(contract: &Pubkey, date_pubkey: &Pubkey, to: &Pubkey) -> Instruction { - let account_metas = vec![ - AccountMeta::new(*contract, false), - AccountMeta::new_readonly(*date_pubkey, false), - AccountMeta::new(*to, false), - ]; - Instruction::new_with_bincode(id(), &VestInstruction::RedeemTokens, account_metas) -} - -pub fn terminate(contract: &Pubkey, from: &Pubkey, to: &Pubkey) -> Instruction { - let mut account_metas = vec![ - AccountMeta::new(*contract, false), - AccountMeta::new(*from, true), - ]; - if from != to { - account_metas.push(AccountMeta::new(*to, false)); - } - Instruction::new_with_bincode(id(), &VestInstruction::Terminate, account_metas) -} - -pub fn renege(contract: &Pubkey, from: &Pubkey, to: &Pubkey, lamports: u64) -> Instruction { - let mut account_metas = vec![ - AccountMeta::new(*contract, false), - AccountMeta::new(*from, true), - ]; - if from != to { - account_metas.push(AccountMeta::new(*to, false)); - } - Instruction::new_with_bincode(id(), &VestInstruction::Renege(lamports), account_metas) -} - -pub fn vest_all(contract: &Pubkey, from: &Pubkey) -> Instruction { - let account_metas = vec![ - AccountMeta::new(*contract, false), - AccountMeta::new(*from, true), - ]; - Instruction::new_with_bincode(id(), &VestInstruction::VestAll, account_metas) -} diff --git a/programs/vest/src/vest_processor.rs b/programs/vest/src/vest_processor.rs deleted file mode 100644 index 6adc653652..0000000000 --- a/programs/vest/src/vest_processor.rs +++ /dev/null @@ -1,697 +0,0 @@ -//! vest program -use crate::{ - vest_instruction::{VestError, VestInstruction}, - vest_state::VestState, -}; -use chrono::prelude::*; -use solana_config_program::date_instruction::DateConfig; -use solana_config_program::get_config_data; -use solana_sdk::{ - account::{AccountSharedData, ReadableAccount, WritableAccount}, - feature_set, - instruction::InstructionError, - keyed_account::{keyed_account_at_index, KeyedAccount}, - process_instruction::InvokeContext, - program_utils::limited_deserialize, - pubkey::Pubkey, -}; -use std::cell::RefMut; - -fn verify_date_account( - keyed_account: &KeyedAccount, - expected_pubkey: &Pubkey, -) -> Result, InstructionError> { - if keyed_account.owner()? != solana_config_program::id() { - return Err(InstructionError::IncorrectProgramId); - } - - let account = verify_account(keyed_account, expected_pubkey)?; - - let config_data = - get_config_data(&account.data()).map_err(|_| InstructionError::InvalidAccountData)?; - let date_config = - DateConfig::deserialize(config_data).ok_or(InstructionError::InvalidAccountData)?; - - Ok(date_config.date_time.date()) -} - -fn verify_account<'a>( - keyed_account: &'a KeyedAccount, - expected_pubkey: &Pubkey, -) -> Result, InstructionError> { - if keyed_account.unsigned_key() != expected_pubkey { - return Err(VestError::Unauthorized.into()); - } - - keyed_account.try_account_ref_mut() -} - -fn verify_signed_account<'a>( - keyed_account: &'a KeyedAccount, - expected_pubkey: &Pubkey, -) -> Result, InstructionError> { - if keyed_account.signer_key().is_none() { - return Err(InstructionError::MissingRequiredSignature); - } - - verify_account(keyed_account, expected_pubkey) -} - -pub fn process_instruction( - _program_id: &Pubkey, - data: &[u8], - invoke_context: &mut dyn InvokeContext, -) -> Result<(), InstructionError> { - let keyed_accounts = invoke_context.get_keyed_accounts()?; - - let contract_account = &mut keyed_account_at_index(keyed_accounts, 0)?.try_account_ref_mut()?; - if invoke_context.is_feature_active(&feature_set::check_program_owner::id()) - && contract_account.owner != crate::id() - { - return Err(InstructionError::InvalidAccountOwner); - } - - let instruction = limited_deserialize(data)?; - - let mut vest_state = if let VestInstruction::InitializeAccount { - terminator_pubkey, - payee_pubkey, - start_date_time, - date_pubkey, - total_lamports, - } = instruction - { - VestState { - terminator_pubkey, - payee_pubkey, - start_date_time, - date_pubkey, - total_lamports, - ..VestState::default() - } - } else { - VestState::deserialize(&contract_account.data())? - }; - - match instruction { - VestInstruction::InitializeAccount { .. } => {} - VestInstruction::SetTerminator(new_pubkey) => { - verify_signed_account( - keyed_account_at_index(keyed_accounts, 1)?, - &vest_state.terminator_pubkey, - )?; - vest_state.terminator_pubkey = new_pubkey; - } - VestInstruction::SetPayee(new_pubkey) => { - verify_signed_account( - keyed_account_at_index(keyed_accounts, 1)?, - &vest_state.payee_pubkey, - )?; - vest_state.payee_pubkey = new_pubkey; - } - VestInstruction::RedeemTokens => { - let current_date = verify_date_account( - keyed_account_at_index(keyed_accounts, 1)?, - &vest_state.date_pubkey, - )?; - let mut payee_account = verify_account( - keyed_account_at_index(keyed_accounts, 2)?, - &vest_state.payee_pubkey, - )?; - vest_state.redeem_tokens(contract_account, current_date, &mut payee_account); - } - VestInstruction::Terminate | VestInstruction::Renege(_) => { - let lamports = if let VestInstruction::Renege(lamports) = instruction { - lamports - } else { - contract_account.lamports - }; - let terminator_account = verify_signed_account( - keyed_account_at_index(keyed_accounts, 1)?, - &vest_state.terminator_pubkey, - )?; - let payee_keyed_account = keyed_account_at_index(keyed_accounts, 2); - let mut payee_account = if let Ok(payee_keyed_account) = payee_keyed_account { - payee_keyed_account.try_account_ref_mut()? - } else { - terminator_account - }; - vest_state.renege(contract_account, &mut payee_account, lamports); - } - VestInstruction::VestAll => { - verify_signed_account( - keyed_account_at_index(keyed_accounts, 1)?, - &vest_state.terminator_pubkey, - )?; - vest_state.vest_all(); - } - } - - vest_state.serialize(contract_account.data_as_mut_slice()) -} - -#[cfg(test)] -mod tests { - use super::*; - use crate::id; - use crate::vest_instruction; - use solana_config_program::date_instruction; - use solana_runtime::bank::Bank; - use solana_runtime::bank_client::BankClient; - use solana_sdk::client::SyncClient; - use solana_sdk::genesis_config::create_genesis_config; - use solana_sdk::hash::hash; - use solana_sdk::message::Message; - use solana_sdk::signature::{Keypair, Signature, Signer}; - use solana_sdk::transaction::TransactionError; - use solana_sdk::transport::Result; - use std::sync::Arc; - - fn create_bank(lamports: u64) -> (Bank, Keypair) { - let (genesis_config, mint_keypair) = create_genesis_config(lamports); - let mut bank = Bank::new(&genesis_config); - bank.add_builtin("vest_program", id(), process_instruction); - (bank, mint_keypair) - } - - fn create_bank_client(lamports: u64) -> (BankClient, Keypair) { - let (bank, mint_keypair) = create_bank(lamports); - (BankClient::new(bank), mint_keypair) - } - - /// Create a config account and use it as a date oracle. - fn create_date_account( - bank_client: &BankClient, - date_keypair: &Keypair, - payer_keypair: &Keypair, - date: Date, - ) -> Result { - let date_pubkey = date_keypair.pubkey(); - - let mut instructions = - date_instruction::create_account(&payer_keypair.pubkey(), &date_pubkey, 1); - instructions.push(date_instruction::store(&date_pubkey, date)); - - let message = Message::new(&instructions, Some(&payer_keypair.pubkey())); - bank_client.send_and_confirm_message(&[payer_keypair, date_keypair], message) - } - - fn store_date( - bank_client: &BankClient, - date_keypair: &Keypair, - payer_keypair: &Keypair, - date: Date, - ) -> Result { - let date_pubkey = date_keypair.pubkey(); - let instruction = date_instruction::store(&date_pubkey, date); - let message = Message::new(&[instruction], Some(&payer_keypair.pubkey())); - bank_client.send_and_confirm_message(&[payer_keypair, date_keypair], message) - } - - fn create_vest_account( - bank_client: &BankClient, - contract_keypair: &Keypair, - payer_keypair: &Keypair, - terminator_pubkey: &Pubkey, - payee_pubkey: &Pubkey, - start_date: Date, - date_pubkey: &Pubkey, - lamports: u64, - ) -> Result { - let instructions = vest_instruction::create_account( - &payer_keypair.pubkey(), - &terminator_pubkey, - &contract_keypair.pubkey(), - &payee_pubkey, - start_date, - &date_pubkey, - lamports, - ); - let message = Message::new(&instructions, Some(&payer_keypair.pubkey())); - bank_client.send_and_confirm_message(&[payer_keypair, contract_keypair], message) - } - - fn send_set_terminator( - bank_client: &BankClient, - contract_pubkey: &Pubkey, - old_keypair: &Keypair, - new_pubkey: &Pubkey, - ) -> Result { - let instruction = - vest_instruction::set_terminator(&contract_pubkey, &old_keypair.pubkey(), &new_pubkey); - bank_client.send_and_confirm_instruction(&old_keypair, instruction) - } - - fn send_set_payee( - bank_client: &BankClient, - contract_pubkey: &Pubkey, - old_keypair: &Keypair, - new_pubkey: &Pubkey, - ) -> Result { - let instruction = - vest_instruction::set_payee(&contract_pubkey, &old_keypair.pubkey(), &new_pubkey); - bank_client.send_and_confirm_instruction(&old_keypair, instruction) - } - - fn send_redeem_tokens( - bank_client: &BankClient, - contract_pubkey: &Pubkey, - payer_keypair: &Keypair, - payee_pubkey: &Pubkey, - date_pubkey: &Pubkey, - ) -> Result { - let instruction = - vest_instruction::redeem_tokens(&contract_pubkey, &date_pubkey, &payee_pubkey); - let message = Message::new(&[instruction], Some(&payer_keypair.pubkey())); - bank_client.send_and_confirm_message(&[payer_keypair], message) - } - - #[test] - fn test_verify_account_unauthorized() { - // Ensure client can't sneak in with an untrusted date account. - let date_pubkey = solana_sdk::pubkey::new_rand(); - let account = AccountSharedData::new_ref(1, 0, &solana_config_program::id()); - let keyed_account = KeyedAccount::new(&date_pubkey, false, &account); - - let mallory_pubkey = solana_sdk::pubkey::new_rand(); // <-- Attack! Not the expected account. - assert_eq!( - verify_account(&keyed_account, &mallory_pubkey).unwrap_err(), - VestError::Unauthorized.into() - ); - } - - #[test] - fn test_verify_signed_account_missing_signature() { - // Ensure client can't sneak in with an unsigned account. - let date_pubkey = solana_sdk::pubkey::new_rand(); - let account = AccountSharedData::new_ref(1, 0, &solana_config_program::id()); - let keyed_account = KeyedAccount::new(&date_pubkey, false, &account); // <-- Attack! Unsigned transaction. - - assert_eq!( - verify_signed_account(&keyed_account, &date_pubkey).unwrap_err(), - InstructionError::MissingRequiredSignature - ); - } - - #[test] - fn test_verify_date_account_incorrect_program_id() { - // Ensure client can't sneak in with a non-Config account. - let date_pubkey = solana_sdk::pubkey::new_rand(); - let account = AccountSharedData::new_ref(1, 0, &id()); // <-- Attack! Pass Vest account where Config account is expected. - let keyed_account = KeyedAccount::new(&date_pubkey, false, &account); - assert_eq!( - verify_date_account(&keyed_account, &date_pubkey).unwrap_err(), - InstructionError::IncorrectProgramId - ); - } - - #[test] - fn test_verify_date_account_uninitialized_config() { - // Ensure no panic when `get_config_data()` returns an error. - let date_pubkey = solana_sdk::pubkey::new_rand(); - let account = AccountSharedData::new_ref(1, 0, &solana_config_program::id()); // <-- Attack! Zero space. - let keyed_account = KeyedAccount::new(&date_pubkey, false, &account); - assert_eq!( - verify_date_account(&keyed_account, &date_pubkey).unwrap_err(), - InstructionError::InvalidAccountData - ); - } - - #[test] - fn test_verify_date_account_invalid_date_config() { - // Ensure no panic when `deserialize::()` returns an error. - let date_pubkey = solana_sdk::pubkey::new_rand(); - let account = AccountSharedData::new_ref(1, 1, &solana_config_program::id()); // Attack! 1 byte, enough to sneak by `get_config_data()`, but not DateConfig deserialize. - let keyed_account = KeyedAccount::new(&date_pubkey, false, &account); - assert_eq!( - verify_date_account(&keyed_account, &date_pubkey).unwrap_err(), - InstructionError::InvalidAccountData - ); - } - - #[test] - fn test_verify_date_account_deserialize() { - // Ensure no panic when `deserialize::()` returns an error. - let date_pubkey = solana_sdk::pubkey::new_rand(); - let account = AccountSharedData::new_ref(1, 1, &solana_config_program::id()); // Attack! 1 byte, enough to sneak by `get_config_data()`, but not DateConfig deserialize. - let keyed_account = KeyedAccount::new(&date_pubkey, false, &account); - assert_eq!( - verify_date_account(&keyed_account, &date_pubkey).unwrap_err(), - InstructionError::InvalidAccountData - ); - } - - #[test] - fn test_initialize_no_panic() { - let (bank_client, alice_keypair) = create_bank_client(3); - - let contract_keypair = Keypair::new(); - - let mut instructions = vest_instruction::create_account( - &alice_keypair.pubkey(), - &solana_sdk::pubkey::new_rand(), - &contract_keypair.pubkey(), - &solana_sdk::pubkey::new_rand(), - Utc::now().date(), - &solana_sdk::pubkey::new_rand(), - 1, - ); - instructions[1].accounts = vec![]; //