mod.rs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. pub mod add_car;
  2. pub mod book_rental;
  3. pub mod pick_up_car;
  4. pub mod return_car;
  5. pub use add_car::*;
  6. pub use book_rental::*;
  7. pub use pick_up_car::*;
  8. pub use return_car::*;
  9. use {
  10. borsh::{
  11. BorshDeserialize,
  12. BorshSerialize,
  13. },
  14. shank::ShankInstruction,
  15. };
  16. #[derive(BorshDeserialize, BorshSerialize, Clone, Debug, ShankInstruction)]
  17. pub enum CarRentalServiceInstruction {
  18. #[account(0, writable, name="car_account",
  19. desc="The account that will represent the Car being created")]
  20. #[account(1, writable, name="payer",
  21. desc = "Fee payer")]
  22. #[account(2, name="system_program",
  23. desc = "The System Program")]
  24. AddCar(AddCarArgs),
  25. #[account(0, writable, name="rental_account",
  26. desc="The account that will represent the actual order for the rental")]
  27. #[account(1, name="car_account",
  28. desc="The account representing the Car being rented in this order")]
  29. #[account(2, writable, name="payer",
  30. desc = "Fee payer")]
  31. #[account(3, name="system_program",
  32. desc = "The System Program")]
  33. BookRental(BookRentalArgs),
  34. #[account(0, writable, name="rental_account",
  35. desc="The account representing the active rental")]
  36. #[account(1, name="car_account",
  37. desc="The account representing the Car being rented in this order")]
  38. #[account(2, writable, name="payer",
  39. desc = "Fee payer")]
  40. PickUpCar,
  41. #[account(0, writable, name="rental_account",
  42. desc="The account representing the active rental")]
  43. #[account(1, name="car_account",
  44. desc="The account representing the Car being rented in this order")]
  45. #[account(2, writable, name="payer",
  46. desc = "Fee payer")]
  47. ReturnCar,
  48. }