spl_token_create.rs 877 B

123456789101112131415161718192021222324252627
  1. use spl_associated_token_account_mollusk_harness::{AtaTestHarness, CreateAtaInstructionType};
  2. #[test]
  3. fn success_create() {
  4. let mut harness =
  5. AtaTestHarness::new(&spl_token_interface::id()).with_wallet_and_mint(1_000_000, 6);
  6. harness.create_ata(CreateAtaInstructionType::default());
  7. }
  8. #[test]
  9. fn success_using_deprecated_instruction_creator() {
  10. let mut harness =
  11. AtaTestHarness::new(&spl_token_interface::id()).with_wallet_and_mint(1_000_000, 6);
  12. harness.create_and_check_ata_with_custom_instruction(
  13. CreateAtaInstructionType::default(),
  14. |instruction| {
  15. instruction.data = vec![];
  16. instruction
  17. .accounts
  18. .push(solana_instruction::AccountMeta::new_readonly(
  19. solana_sysvar::rent::id(),
  20. false,
  21. ));
  22. },
  23. );
  24. }