system_program.rs 546 B

123456789101112131415161718192021222324
  1. use crate::*;
  2. use solana_program::program_error::ProgramError;
  3. use solana_program::pubkey::Pubkey;
  4. pub use solana_program::system_program::ID;
  5. #[derive(Clone)]
  6. pub struct System;
  7. impl anchor_lang::AccountDeserialize for System {
  8. fn try_deserialize(buf: &mut &[u8]) -> Result<Self, ProgramError> {
  9. System::try_deserialize_unchecked(buf)
  10. }
  11. fn try_deserialize_unchecked(_buf: &mut &[u8]) -> Result<Self, ProgramError> {
  12. Ok(System)
  13. }
  14. }
  15. impl anchor_lang::Id for System {
  16. fn id() -> Pubkey {
  17. ID
  18. }
  19. }