vector_oob.out
1 program test_oob.alpha; 2 3 struct Optional__EsDmm5O6sv6: 4 is_some as boolean; 5 val as u32; 6 7 mapping vec__: 8 key as u32.public; 9 value as u32.public; 10 11 mapping vec__len__: 12 key as boolean.public; 13 value as u32.public; 14 15 function oob_get: 16 async oob_get into r0; 17 output r0 as test_oob.alpha/oob_get.future; 18 19 finalize oob_get: 20 set 0u32 into vec__len__[false]; 21 get.or_use vec__len__[false] 0u32 into r0; 22 is.eq r0 0u32 into r1; 23 assert.eq r1 true; 24 get.or_use vec__len__[false] 0u32 into r2; 25 lt 0u32 r2 into r3; 26 get.or_use vec__[0u32] 0u32 into r4; 27 cast true r4 into r5 as Optional__EsDmm5O6sv6; 28 cast false 0u32 into r6 as Optional__EsDmm5O6sv6; 29 ternary r3 r5.is_some r6.is_some into r7; 30 ternary r3 r5.val r6.val into r8; 31 cast r7 r8 into r9 as Optional__EsDmm5O6sv6; 32 cast false 0u32 into r10 as Optional__EsDmm5O6sv6; 33 is.eq r9 r10 into r11; 34 assert.eq r11 true; 35 36 function oob_set: 37 async oob_set into r0; 38 output r0 as test_oob.alpha/oob_set.future; 39 40 finalize oob_set: 41 set 0u32 into vec__len__[false]; 42 get.or_use vec__len__[false] 0u32 into r0; 43 is.eq r0 0u32 into r1; 44 assert.eq r1 true; 45 get.or_use vec__len__[false] 0u32 into r2; 46 lt 0u32 r2 into r3; 47 assert.eq r3 true; 48 set 123u32 into vec__[0u32]; 49 50 function oob_swap_remove: 51 async oob_swap_remove into r0; 52 output r0 as test_oob.alpha/oob_swap_remove.future; 53 54 finalize oob_swap_remove: 55 set 0u32 into vec__len__[false]; 56 get.or_use vec__len__[false] 0u32 into r0; 57 is.eq r0 0u32 into r1; 58 assert.eq r1 true; 59 get.or_use vec__len__[false] 0u32 into r2; 60 lt 0u32 r2 into r3; 61 assert.eq r3 true; 62 get vec__[0u32] into r4; 63 sub r2 1u32 into r5; 64 get vec__[r5] into r6; 65 set r6 into vec__[0u32]; 66 set r5 into vec__len__[false]; 67 68 function oob_pop: 69 async oob_pop into r0; 70 output r0 as test_oob.alpha/oob_pop.future; 71 72 finalize oob_pop: 73 set 0u32 into vec__len__[false]; 74 get.or_use vec__len__[false] 0u32 into r0; 75 is.eq r0 0u32 into r1; 76 assert.eq r1 true; 77 get.or_use vec__len__[false] 0u32 into r2; 78 gt r2 0u32 into r3; 79 sub.w r2 1u32 into r4; 80 ternary r3 r4 r2 into r5; 81 set r5 into vec__len__[false]; 82 get.or_use vec__[r4] 0u32 into r6; 83 cast true r6 into r7 as Optional__EsDmm5O6sv6; 84 cast false 0u32 into r8 as Optional__EsDmm5O6sv6; 85 ternary r3 r7.is_some r8.is_some into r9; 86 ternary r3 r7.val r8.val into r10; 87 cast r9 r10 into r11 as Optional__EsDmm5O6sv6; 88 cast false 0u32 into r12 as Optional__EsDmm5O6sv6; 89 is.eq r11 r12 into r13; 90 assert.eq r13 true; 91 92 constructor: 93 assert.eq edition 0u16; 94 verified: true 95 status: accepted 96 { 97 "transitions": [ 98 { 99 "id": "au19fpt4zw3efpkk6h7q3fhwt3ygnh0rfp3yp94z7qdw8jf00640cyq099xkc", 100 "program": "test_oob.alpha", 101 "function": "oob_get", 102 "inputs": [], 103 "outputs": [ 104 { 105 "type": "future", 106 "id": "5731236878452207723013327020032677030311481754208491666975077923570611197812field", 107 "value": "{\n program_id: test_oob.alpha,\n function_name: oob_get,\n arguments: []\n}" 108 } 109 ], 110 "tpk": "3624323403681901343598936873162095754730183994733191464570438014739528535008group", 111 "tcm": "8026203841700191376238532538224025813107545641164319720703859520165390186410field", 112 "scm": "8111960946564644093806049080368640250465700351145129603686771509712125953784field" 113 } 114 ], 115 "global_state_root": "sr1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq6gk0xu" 116 } 117 118 verified: true 119 status: rejected 120 { 121 "transitions": [ 122 { 123 "id": "au1mk8rz8kdyl2s6aqyegj2kdx7km8722mxwy7ucagrxu2utx3zmcxsml9l7a", 124 "program": "test_oob.alpha", 125 "function": "oob_set", 126 "inputs": [], 127 "outputs": [ 128 { 129 "type": "future", 130 "id": "3084372646656352154386021029975669844871419101934868738592978512838741027738field", 131 "value": "{\n program_id: test_oob.alpha,\n function_name: oob_set,\n arguments: []\n}" 132 } 133 ], 134 "tpk": "400812782568195639516329277224501285789970750488543866531779058014165881522group", 135 "tcm": "7526198462873088570248167433339267185457490371331812664054957953360345622695field", 136 "scm": "2771105956429082324621928901173889972492135582642565056291749840109780838399field" 137 } 138 ], 139 "global_state_root": "sr1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq6gk0xu" 140 } 141 142 verified: true 143 status: rejected 144 { 145 "transitions": [ 146 { 147 "id": "au1v4msxgtcghkrxckz5xydycz57zlvpywgwafxsljtjvddgql3j5yqa5jxm2", 148 "program": "test_oob.alpha", 149 "function": "oob_swap_remove", 150 "inputs": [], 151 "outputs": [ 152 { 153 "type": "future", 154 "id": "2453578089359433043444411541301644333516589980017298958387602317033411630376field", 155 "value": "{\n program_id: test_oob.alpha,\n function_name: oob_swap_remove,\n arguments: []\n}" 156 } 157 ], 158 "tpk": "6391520642900957007179861346929854585582237374908426201126737378047496289808group", 159 "tcm": "7186253704433632951446902606866199469774293810685911560184664495473933469756field", 160 "scm": "4253146435129910350904226225849096049229979348376537827238912416479652512103field" 161 } 162 ], 163 "global_state_root": "sr1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq6gk0xu" 164 } 165 166 verified: true 167 status: accepted 168 { 169 "transitions": [ 170 { 171 "id": "au1gwmkgyjs79prc4avhv4xyewpp9gqxsjgeddceazww6gcs6dkyggsfhkmxm", 172 "program": "test_oob.alpha", 173 "function": "oob_pop", 174 "inputs": [], 175 "outputs": [ 176 { 177 "type": "future", 178 "id": "1813102599485495876799781152863176423240825511882716175707150543130600029238field", 179 "value": "{\n program_id: test_oob.alpha,\n function_name: oob_pop,\n arguments: []\n}" 180 } 181 ], 182 "tpk": "5554347281219211935554922593863866828516568901206525108098751846506574401168group", 183 "tcm": "3261327963017627577931781756983646162517606910157576873473161535805673767250field", 184 "scm": "4329527014580250744951242912448572211006929100476245838357352280912332831880field" 185 } 186 ], 187 "global_state_root": "sr1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq6gk0xu" 188 } 189