instruction.rs 516 B

1234567891011121314151617181920212223
  1. use steel::*;
  2. #[repr(u8)]
  3. #[derive(Clone, Copy, Debug, Eq, PartialEq, TryFromPrimitive)]
  4. pub enum EscrowInstruction {
  5. MakeOffer = 0,
  6. TakerOffer = 1,
  7. }
  8. #[repr(C)]
  9. #[derive(Clone, Copy, Debug, Pod, Zeroable)]
  10. pub struct MakeOffer {
  11. pub id: [u8; 8],
  12. pub token_a_offered_amount: [u8; 8],
  13. pub token_b_wanted_amount: [u8; 8],
  14. }
  15. #[repr(C)]
  16. #[derive(Clone, Copy, Debug, Pod, Zeroable)]
  17. pub struct TakerOffer {}
  18. instruction!(EscrowInstruction, MakeOffer);
  19. instruction!(EscrowInstruction, TakerOffer);