Add a library for creating Rewards transactions

And move out of the SDK
This commit is contained in:
Greg Fitzgerald
2019-02-14 10:22:20 -07:00
parent 2c5cbaff25
commit 7f3aca15dd
7 changed files with 105 additions and 11 deletions

View File

@ -12,7 +12,6 @@ pub mod native_program;
pub mod packet;
pub mod payment_plan;
pub mod pubkey;
pub mod rewards_program;
pub mod shortvec;
pub mod signature;
pub mod storage_program;

View File

@ -1,24 +0,0 @@
use crate::pubkey::Pubkey;
use bincode::serialized_size;
pub const REWARDS_PROGRAM_ID: [u8; 32] = [
133, 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() == REWARDS_PROGRAM_ID
}
pub fn id() -> Pubkey {
Pubkey::new(&REWARDS_PROGRAM_ID)
}
#[derive(Debug, Default, Serialize, Deserialize, PartialEq, Eq)]
struct RewardsState {}
/// Upper limit on the size of the Rewards State.
pub fn get_max_size() -> usize {
let rewards_state = RewardsState::default();
serialized_size(&rewards_state).unwrap() as usize
}