add passive staking and rewards (#3579)

* add stake stuff

* more generic

* test decode bail cases

* favor early returns
This commit is contained in:
Rob Walker
2019-04-01 16:45:53 -07:00
committed by GitHub
parent 3152090a66
commit 25a2f08f8d
8 changed files with 547 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
pub mod stake_instruction;
pub mod stake_state;
use solana_sdk::pubkey::Pubkey;
const STAKE_PROGRAM_ID: [u8; 32] = [
135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0,
];
pub fn check_id(program_id: &Pubkey) -> bool {
program_id.as_ref() == STAKE_PROGRAM_ID
}
pub fn id() -> Pubkey {
Pubkey::new(&STAKE_PROGRAM_ID)
}