/ tests / tests / compiler / async_blocks / future_access_tuple_fail.adl
future_access_tuple_fail.adl
 1  program credits.alpha {
 2      record credits {
 3          owner: address,
 4          amount: u64,
 5      }
 6  
 7      async transition transfer_private_to_public(input: credits, addr: address, amount:u64) -> (credits, Future) {
 8          let f: Future = finalize();
 9          return (input, f);
10      }
11  
12      async function finalize() {
13          assert_eq(1u8, 1u8);
14      }
15  }
16  
17  // --- Next Program --- //
18  
19  import credits.alpha;
20  
21  program test_credits.alpha {
22      async transition send_credits(input: credits.alpha/credits, amount: u64) -> (credits.alpha/credits, Future) {
23          let start: (credits.alpha/credits, Future) = credits.alpha/transfer_private_to_public(input, self.address, amount);
24          let after: (u8, credits.alpha/credits) = (1u8, start.0);
25          let start_2: Future = start.1;
26          return (
27              after.1, 
28              async {
29                  start.1.await();
30                  start_2.await();
31              }
32          );
33      }
34  }