/ tests / tests / compiler / core / cheatcodes / invalid_cheatcodes_fail.adl
invalid_cheatcodes_fail.adl
 1  
 2  // The 'test_dep' program.
 3  program test_dep.alpha {
 4      mapping Yo: u32 => u32;
 5      record yeets {
 6          owner: address,
 7          val: u32,
 8      }
 9  
10      async transition main_dep(a:u32) -> (yeets, Future) {
11          let f: Future = finalize_main_dep(a, 1u32);
12          let l: yeets = yeets {owner: self.signer, val: 1u32};
13          return (l, f);
14      }
15  
16      async function finalize_main_dep(a:u32, b:u32) {
17          Mapping::set(Yo, a, b);
18          let c:u32 = a + b;
19      }
20  }
21  
22  // --- Next Program --- //
23  
24  import test_dep.alpha;
25  
26  program test.alpha {
27      mapping account: address => u64;
28  
29      async transition main(public a: u64) -> Future {
30          return finish(a);
31      }
32  
33      async function finish(public a: u64, b: address) {
34          CheatCode::print_mapping(Yo);
35          CheatCode::print_mapping(test_dep.alpha/account);
36          CheatCode::set_block_height(1u64);
37          CheatCode::set_block_height(a);
38          CheatCode::set_block_timestamp(1u32);
39          CheatCode::set_block_timestamp(b);
40          CheatCode::set_signer(b);
41          // Invalid private key.
42          CheatCode::set_signer("APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPW");
43      }
44  }