2020-10-16 10:38:12 -07:00
|
|
|
//! Program entrypoint
|
|
|
|
|
2020-11-13 04:11:39 -08:00
|
|
|
#![cfg(all(target_arch = "bpf", not(feature = "no-entrypoint")))]
|
|
|
|
|
Stake pool: adding pool balance confirmation (Redo of #960) (#1116)
* Added validator stake account list storage, deprecated old tests
* Added join and leave stake pool instructions, error messages refactoring
* Stake pool tests refactoring, tests for join and leave pool added
* Added validator stake account creation instruction, join/leave pool instructions renamed, version field added
* Formatting fixes
* Added update list/pool instructions (no tests yet), updated deposit instruction logic, claim instruction removed, refactoring
* Updated deposit logic and tests, updated withdraw logic and added tests, refactoring
* Stake pool CLI updated to work with new deposit/withdraw instructions, claim usage removed
* Added validator stake account management and balance update commands to the stake pool CLI, updated dependency versions, updated devnet program address
* Merge conflicts fixed
* Removed deprecated tests
* Fixes for review comments
* Additional program id checks across the code
* Formatting errors fixed
* Changed minimum stake balance in CLI, removed deprecated tests, removed check for stake history id
* Added TODO for stake account warmup status check
* Cargo.lock conflict fix
* Formatting fixed
* Update Cargo lock file for CI
* Pin themis version of subtle
Co-authored-by: Yuriy Savchenko <yuriy.savchenko@gmail.com>
2021-01-21 05:48:46 -08:00
|
|
|
use crate::{error::StakePoolError, processor::Processor};
|
2020-10-22 21:44:27 -07:00
|
|
|
use solana_program::{
|
2020-10-16 10:38:12 -07:00
|
|
|
account_info::AccountInfo, entrypoint, entrypoint::ProgramResult,
|
|
|
|
program_error::PrintProgramError, pubkey::Pubkey,
|
|
|
|
};
|
|
|
|
|
|
|
|
entrypoint!(process_instruction);
|
2020-11-01 00:22:04 -07:00
|
|
|
fn process_instruction(
|
2020-10-16 10:38:12 -07:00
|
|
|
program_id: &Pubkey,
|
2020-11-01 00:22:04 -07:00
|
|
|
accounts: &[AccountInfo],
|
2020-10-16 10:38:12 -07:00
|
|
|
instruction_data: &[u8],
|
|
|
|
) -> ProgramResult {
|
|
|
|
if let Err(error) = Processor::process(program_id, accounts, instruction_data) {
|
|
|
|
// catch the error so we can print it
|
Stake pool: adding pool balance confirmation (Redo of #960) (#1116)
* Added validator stake account list storage, deprecated old tests
* Added join and leave stake pool instructions, error messages refactoring
* Stake pool tests refactoring, tests for join and leave pool added
* Added validator stake account creation instruction, join/leave pool instructions renamed, version field added
* Formatting fixes
* Added update list/pool instructions (no tests yet), updated deposit instruction logic, claim instruction removed, refactoring
* Updated deposit logic and tests, updated withdraw logic and added tests, refactoring
* Stake pool CLI updated to work with new deposit/withdraw instructions, claim usage removed
* Added validator stake account management and balance update commands to the stake pool CLI, updated dependency versions, updated devnet program address
* Merge conflicts fixed
* Removed deprecated tests
* Fixes for review comments
* Additional program id checks across the code
* Formatting errors fixed
* Changed minimum stake balance in CLI, removed deprecated tests, removed check for stake history id
* Added TODO for stake account warmup status check
* Cargo.lock conflict fix
* Formatting fixed
* Update Cargo lock file for CI
* Pin themis version of subtle
Co-authored-by: Yuriy Savchenko <yuriy.savchenko@gmail.com>
2021-01-21 05:48:46 -08:00
|
|
|
error.print::<StakePoolError>();
|
2020-10-16 10:38:12 -07:00
|
|
|
return Err(error);
|
|
|
|
}
|
|
|
|
Ok(())
|
|
|
|
}
|