1- use steel_api:: prelude:: * ;
21use solana_program:: hash:: Hash ;
32use solana_program_test:: { processor, BanksClient , ProgramTest } ;
43use solana_sdk:: { signature:: Keypair , signer:: Signer , transaction:: Transaction } ;
54use steel:: * ;
5+ use steel_api:: prelude:: * ;
66
77async fn setup ( ) -> ( BanksClient , Keypair , Hash ) {
88 let mut program_test = ProgramTest :: new (
@@ -19,28 +19,56 @@ async fn run_test() {
1919 // Setup test
2020 let ( mut banks, payer, blockhash) = setup ( ) . await ;
2121
22+ let account_to_create = Pubkey :: new_unique ( ) ;
23+ let account_to_change = Pubkey :: new_unique ( ) ;
24+
25+ // AccountInfo::new(
26+ // &account_to_change,
27+ // payer.pubkey(),
28+ // true,
29+ // 0,
30+ // data,
31+ // owner,
32+ // true,
33+ // rent_epoch,
34+ // );
35+ // getminu
36+
37+ // create_account(account_to_change., owner, seeds, system_program, payer);
38+
39+ // account!()
40+ // ToAccount
41+
42+ // // Initialize proof.
43+ // create_account::<Proof>(
44+ // proof_info,
45+ // &ore_api::ID,
46+ // &[PROOF, signer_info.key.as_ref(), &[args.bump]],
47+ // system_program,
48+ // payer_info,
49+ // )?;
50+
2251 // Submit initialize transaction.
23- let ix = initialize ( payer. pubkey ( ) ) ;
52+ let ix = check_accounts ( payer. pubkey ( ) , account_to_create , account_to_change ) ;
2453 let tx = Transaction :: new_signed_with_payer ( & [ ix] , Some ( & payer. pubkey ( ) ) , & [ & payer] , blockhash) ;
2554 let res = banks. process_transaction ( tx) . await ;
2655 assert ! ( res. is_ok( ) ) ;
2756
2857 // Verify counter was initialized.
29- let counter_address = counter_pda ( ) . 0 ;
30- let counter_account = banks. get_account ( counter_address) . await . unwrap ( ) . unwrap ( ) ;
31- let counter = Counter :: try_from_bytes ( & counter_account. data ) . unwrap ( ) ;
32- assert_eq ! ( counter_account. owner, steel_api:: ID ) ;
33- assert_eq ! ( counter. value, 0 ) ;
58+ // let counter_address = counter_pda().0;
59+ // let counter_account = banks.get_account(counter_address).await.unwrap().unwrap();
60+ // let counter = Counter::try_from_bytes(&counter_account.data).unwrap();
61+ // assert_eq!(counter_account.owner, steel_api::ID);
62+ // assert_eq!(counter.value, 0);
3463
3564 // Submit add transaction.
36- let ix = add ( payer. pubkey ( ) , 42 ) ;
37- let tx = Transaction :: new_signed_with_payer ( & [ ix] , Some ( & payer. pubkey ( ) ) , & [ & payer] , blockhash) ;
38- let res = banks. process_transaction ( tx) . await ;
39- assert ! ( res. is_ok( ) ) ;
65+ // let ix = add(payer.pubkey(), 42);
66+ // let tx = Transaction::new_signed_with_payer(&[ix], Some(&payer.pubkey()), &[&payer], blockhash);
67+ // let res = banks.process_transaction(tx).await;
68+ // assert!(res.is_ok());
4069
41- // Verify counter was incremented.
42- let counter_account = banks. get_account ( counter_address) . await . unwrap ( ) . unwrap ( ) ;
43- let counter = Counter :: try_from_bytes ( & counter_account. data ) . unwrap ( ) ;
44- assert_eq ! ( counter. value, 42 ) ;
70+ // // Verify counter was incremented.
71+ // let counter_account = banks.get_account(counter_address).await.unwrap().unwrap();
72+ // let counter = Counter::try_from_bytes(&counter_account.data).unwrap();
73+ // assert_eq!(counter.value, 42);
4574}
46-
0 commit comments