o1js-pack 0.3.1 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. package/.github/workflows/ci.yml +1 -1
  2. package/.husky/pre-commit +0 -0
  3. package/README.md +9 -30
  4. package/build/src/index.d.ts +5 -5
  5. package/build/src/index.js +5 -5
  6. package/build/src/lib/PackingPlant.d.ts +132 -92
  7. package/build/src/lib/PackingPlant.js +190 -74
  8. package/build/src/lib/PackingPlant.js.map +1 -1
  9. package/build/src/lib/packed-types/PackedBool.d.ts +85 -77
  10. package/build/src/lib/packed-types/PackedBool.js +49 -47
  11. package/build/src/lib/packed-types/PackedBool.js.map +1 -1
  12. package/build/src/lib/packed-types/PackedBool.test.d.ts +1 -1
  13. package/build/src/lib/packed-types/PackedBool.test.js +75 -75
  14. package/build/src/lib/packed-types/PackedBool.test.js.map +1 -1
  15. package/build/src/lib/packed-types/PackedString.d.ts +181 -78
  16. package/build/src/lib/packed-types/PackedString.js +127 -82
  17. package/build/src/lib/packed-types/PackedString.js.map +1 -1
  18. package/build/src/lib/packed-types/PackedString.test.d.ts +1 -1
  19. package/build/src/lib/packed-types/PackedString.test.js +100 -99
  20. package/build/src/lib/packed-types/PackedString.test.js.map +1 -1
  21. package/build/src/lib/packed-types/PackedUInt32.d.ts +85 -77
  22. package/build/src/lib/packed-types/PackedUInt32.js +49 -47
  23. package/build/src/lib/packed-types/PackedUInt32.js.map +1 -1
  24. package/build/src/lib/packed-types/PackedUInt32.test.d.ts +1 -1
  25. package/build/src/lib/packed-types/PackedUInt32.test.js +83 -83
  26. package/build/src/lib/packed-types/PackedUInt32.test.js.map +1 -1
  27. package/package.json +1 -1
  28. package/tests/provable/end_to_end.test.ts +65 -0
  29. package/tests/provable/example_packed_string_circuit.ts +47 -0
  30. package/tests/provable/example_packed_uint_circuit.ts +39 -0
  31. package/build/src/lib/packed-types/PackedCharacter.d.ts +0 -51
  32. package/build/src/lib/packed-types/PackedCharacter.js +0 -34
  33. package/build/src/lib/packed-types/PackedCharacter.js.map +0 -1
  34. package/build/src/lib/packed-types/PackedCharacter.test.d.ts +0 -1
  35. package/build/src/lib/packed-types/PackedCharacter.test.js +0 -31
  36. package/build/src/lib/packed-types/PackedCharacter.test.js.map +0 -1
  37. package/build/src/lib/scratch.d.ts +0 -1
  38. package/build/src/lib/scratch.js +0 -16
  39. package/build/src/lib/scratch.js.map +0 -1
  40. package/build/src/packed-types/PackedBool.d.ts +0 -51
  41. package/build/src/packed-types/PackedBool.js +0 -34
  42. package/build/src/packed-types/PackedBool.js.map +0 -1
  43. package/build/src/packed-types/PackedBool.test.d.ts +0 -1
  44. package/build/src/packed-types/PackedBool.test.js +0 -101
  45. package/build/src/packed-types/PackedBool.test.js.map +0 -1
  46. package/build/src/packed-types/PackedCharacter.d.ts +0 -51
  47. package/build/src/packed-types/PackedCharacter.js +0 -34
  48. package/build/src/packed-types/PackedCharacter.js.map +0 -1
  49. package/build/src/packed-types/PackedCharacter.test.d.ts +0 -1
  50. package/build/src/packed-types/PackedCharacter.test.js +0 -31
  51. package/build/src/packed-types/PackedCharacter.test.js.map +0 -1
  52. package/build/src/packed-types/PackedUInt32.d.ts +0 -51
  53. package/build/src/packed-types/PackedUInt32.js +0 -34
  54. package/build/src/packed-types/PackedUInt32.js.map +0 -1
  55. package/build/src/packed-types/PackedUInt32.test.d.ts +0 -1
  56. package/build/src/packed-types/PackedUInt32.test.js +0 -68
  57. package/build/src/packed-types/PackedUInt32.test.js.map +0 -1
  58. package/build/src/packed-types/PackingPlant.d.ts +0 -54
  59. package/build/src/packed-types/PackingPlant.js +0 -45
  60. package/build/src/packed-types/PackingPlant.js.map +0 -1
  61. package/build/src/packed-types/scratch.d.ts +0 -1
  62. package/build/src/packed-types/scratch.js +0 -5
  63. package/build/src/packed-types/scratch.js.map +0 -1
  64. package/coverage/clover.xml +0 -166
  65. package/coverage/coverage-final.json +0 -5
  66. package/coverage/lcov-report/PackedBool.ts.html +0 -268
  67. package/coverage/lcov-report/PackedUInt32.ts.html +0 -313
  68. package/coverage/lcov-report/base.css +0 -224
  69. package/coverage/lcov-report/block-navigation.js +0 -87
  70. package/coverage/lcov-report/favicon.png +0 -0
  71. package/coverage/lcov-report/index.html +0 -131
  72. package/coverage/lcov-report/lib/PackingPlant.ts.html +0 -478
  73. package/coverage/lcov-report/lib/index.html +0 -116
  74. package/coverage/lcov-report/lib/packed-types/PackedBool.ts.html +0 -238
  75. package/coverage/lcov-report/lib/packed-types/PackedString.ts.html +0 -364
  76. package/coverage/lcov-report/lib/packed-types/PackedUInt32.ts.html +0 -238
  77. package/coverage/lcov-report/lib/packed-types/index.html +0 -146
  78. package/coverage/lcov-report/prettify.css +0 -1
  79. package/coverage/lcov-report/prettify.js +0 -2
  80. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  81. package/coverage/lcov-report/sorter.js +0 -196
  82. package/coverage/lcov.info +0 -282
@@ -1,166 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <coverage generated="1689651113685" clover="3.2.0">
3
- <project timestamp="1689651113686" name="All files">
4
- <metrics statements="142" coveredstatements="126" conditionals="18" coveredconditionals="11" methods="43" coveredmethods="39" elements="203" coveredelements="176" complexity="0" loc="142" ncloc="142" packages="2" files="4" classes="4"/>
5
- <package name="lib">
6
- <metrics statements="44" coveredstatements="33" conditionals="4" coveredconditionals="3" methods="14" coveredmethods="10"/>
7
- <file name="PackingPlant.ts" path="/Users/cobydurling/Projects/zkapps/snarkyjs-pack/src/lib/PackingPlant.ts">
8
- <metrics statements="44" coveredstatements="33" conditionals="4" coveredconditionals="3" methods="14" coveredmethods="10"/>
9
- <line num="10" count="3" type="stmt"/>
10
- <line num="17" count="10" type="cond" truecount="1" falsecount="0"/>
11
- <line num="18" count="2" type="stmt"/>
12
- <line num="25" count="8" type="stmt"/>
13
- <line num="26" count="8" type="stmt"/>
14
- <line num="29" count="10" type="stmt"/>
15
- <line num="32" count="12" type="cond" truecount="1" falsecount="0"/>
16
- <line num="33" count="2" type="stmt"/>
17
- <line num="37" count="10" type="stmt"/>
18
- <line num="38" count="10" type="stmt"/>
19
- <line num="42" count="0" type="stmt"/>
20
- <line num="43" count="0" type="stmt"/>
21
- <line num="47" count="0" type="stmt"/>
22
- <line num="48" count="0" type="stmt"/>
23
- <line num="49" count="0" type="stmt"/>
24
- <line num="53" count="4" type="stmt"/>
25
- <line num="57" count="4" type="stmt"/>
26
- <line num="64" count="2" type="stmt"/>
27
- <line num="65" count="2" type="stmt"/>
28
- <line num="66" count="2" type="stmt"/>
29
- <line num="69" count="8" type="stmt"/>
30
- <line num="76" count="8" type="cond" truecount="0" falsecount="1"/>
31
- <line num="77" count="0" type="stmt"/>
32
- <line num="81" count="8" type="stmt"/>
33
- <line num="85" count="8" type="stmt"/>
34
- <line num="86" count="8" type="stmt"/>
35
- <line num="87" count="8" type="stmt"/>
36
- <line num="90" count="8" type="stmt"/>
37
- <line num="93" count="10" type="cond" truecount="1" falsecount="0"/>
38
- <line num="94" count="2" type="stmt"/>
39
- <line num="96" count="8" type="stmt"/>
40
- <line num="97" count="8" type="stmt"/>
41
- <line num="101" count="0" type="stmt"/>
42
- <line num="102" count="0" type="stmt"/>
43
- <line num="106" count="0" type="stmt"/>
44
- <line num="107" count="0" type="stmt"/>
45
- <line num="108" count="0" type="stmt"/>
46
- <line num="112" count="5" type="stmt"/>
47
- <line num="116" count="2" type="stmt"/>
48
- <line num="123" count="1" type="stmt"/>
49
- <line num="124" count="1" type="stmt"/>
50
- <line num="125" count="1" type="stmt"/>
51
- <line num="126" count="3" type="stmt"/>
52
- <line num="130" count="8" type="stmt"/>
53
- </file>
54
- </package>
55
- <package name="lib.packed-types">
56
- <metrics statements="98" coveredstatements="93" conditionals="14" coveredconditionals="8" methods="29" coveredmethods="29"/>
57
- <file name="PackedBool.ts" path="/Users/cobydurling/Projects/zkapps/snarkyjs-pack/src/lib/packed-types/PackedBool.ts">
58
- <metrics statements="23" coveredstatements="22" conditionals="4" coveredconditionals="3" methods="10" coveredmethods="10"/>
59
- <line num="4" count="1" type="stmt"/>
60
- <line num="9" count="3" type="stmt"/>
61
- <line num="10" count="3" type="stmt"/>
62
- <line num="11" count="3" type="stmt"/>
63
- <line num="13" count="3" type="cond" truecount="3" falsecount="1"/>
64
- <line num="14" count="3" type="stmt"/>
65
- <line num="16" count="0" type="stmt"/>
66
- <line num="18" count="3" type="stmt"/>
67
- <line num="19" count="762" type="stmt"/>
68
- <line num="20" count="762" type="stmt"/>
69
- <line num="22" count="762" type="stmt"/>
70
- <line num="24" count="3" type="stmt"/>
71
- <line num="28" count="5" type="stmt"/>
72
- <line num="29" count="5" type="stmt"/>
73
- <line num="30" count="1265" type="stmt"/>
74
- <line num="31" count="1265" type="stmt"/>
75
- <line num="33" count="5" type="stmt"/>
76
- <line num="37" count="3" type="stmt"/>
77
- <line num="38" count="3" type="stmt"/>
78
- <line num="42" count="763" type="stmt"/>
79
- <line num="43" count="3" type="stmt"/>
80
- <line num="47" count="254" type="stmt"/>
81
- <line num="50" count="4" type="stmt"/>
82
- </file>
83
- <file name="PackedString.ts" path="/Users/cobydurling/Projects/zkapps/snarkyjs-pack/src/lib/packed-types/PackedString.ts">
84
- <metrics statements="52" coveredstatements="49" conditionals="6" coveredconditionals="2" methods="9" coveredmethods="9"/>
85
- <line num="4" count="1" type="stmt"/>
86
- <line num="5" count="1" type="stmt"/>
87
- <line num="12" count="6" type="stmt"/>
88
- <line num="13" count="6" type="stmt"/>
89
- <line num="14" count="6" type="stmt"/>
90
- <line num="15" count="6" type="stmt"/>
91
- <line num="16" count="6" type="stmt"/>
92
- <line num="17" count="6" type="stmt"/>
93
- <line num="18" count="6" type="stmt"/>
94
- <line num="19" count="6" type="stmt"/>
95
- <line num="20" count="14" type="cond" truecount="1" falsecount="0"/>
96
- <line num="21" count="13" type="stmt"/>
97
- <line num="24" count="6" type="cond" truecount="0" falsecount="1"/>
98
- <line num="25" count="0" type="stmt"/>
99
- <line num="27" count="6" type="stmt"/>
100
- <line num="28" count="14" type="stmt"/>
101
- <line num="30" count="6" type="stmt"/>
102
- <line num="31" count="14" type="stmt"/>
103
- <line num="32" count="14" type="stmt"/>
104
- <line num="33" count="210" type="stmt"/>
105
- <line num="34" count="210" type="stmt"/>
106
- <line num="35" count="210" type="stmt"/>
107
- <line num="38" count="6" type="stmt"/>
108
- <line num="39" count="210" type="stmt"/>
109
- <line num="42" count="6" type="stmt"/>
110
- <line num="46" count="10" type="stmt"/>
111
- <line num="47" count="10" type="stmt"/>
112
- <line num="48" count="10" type="stmt"/>
113
- <line num="49" count="29" type="stmt"/>
114
- <line num="50" count="29" type="cond" truecount="0" falsecount="1"/>
115
- <line num="51" count="0" type="stmt"/>
116
- <line num="55" count="29" type="stmt"/>
117
- <line num="56" count="29" type="stmt"/>
118
- <line num="57" count="29" type="stmt"/>
119
- <line num="58" count="374" type="stmt"/>
120
- <line num="59" count="374" type="cond" truecount="0" falsecount="1"/>
121
- <line num="60" count="0" type="stmt"/>
122
- <line num="62" count="374" type="cond" truecount="1" falsecount="1"/>
123
- <line num="63" count="374" type="stmt"/>
124
- <line num="64" count="374" type="stmt"/>
125
- <line num="66" count="29" type="stmt"/>
126
- <line num="68" count="10" type="stmt"/>
127
- <line num="72" count="6" type="stmt"/>
128
- <line num="73" count="6" type="stmt"/>
129
- <line num="74" count="277" type="stmt"/>
130
- <line num="77" count="6" type="stmt"/>
131
- <line num="81" count="7" type="stmt"/>
132
- <line num="82" count="7" type="stmt"/>
133
- <line num="86" count="4" type="stmt"/>
134
- <line num="87" count="4" type="stmt"/>
135
- <line num="88" count="104" type="stmt"/>
136
- <line num="92" count="8" type="stmt"/>
137
- </file>
138
- <file name="PackedUInt32.ts" path="/Users/cobydurling/Projects/zkapps/snarkyjs-pack/src/lib/packed-types/PackedUInt32.ts">
139
- <metrics statements="23" coveredstatements="22" conditionals="4" coveredconditionals="3" methods="10" coveredmethods="10"/>
140
- <line num="4" count="1" type="stmt"/>
141
- <line num="9" count="3" type="stmt"/>
142
- <line num="10" count="3" type="stmt"/>
143
- <line num="11" count="3" type="stmt"/>
144
- <line num="13" count="3" type="cond" truecount="3" falsecount="1"/>
145
- <line num="14" count="3" type="stmt"/>
146
- <line num="16" count="0" type="stmt"/>
147
- <line num="18" count="3" type="stmt"/>
148
- <line num="19" count="21" type="stmt"/>
149
- <line num="20" count="21" type="stmt"/>
150
- <line num="22" count="21" type="stmt"/>
151
- <line num="24" count="3" type="stmt"/>
152
- <line num="28" count="5" type="stmt"/>
153
- <line num="29" count="5" type="stmt"/>
154
- <line num="30" count="30" type="stmt"/>
155
- <line num="31" count="30" type="stmt"/>
156
- <line num="33" count="5" type="stmt"/>
157
- <line num="37" count="3" type="stmt"/>
158
- <line num="38" count="3" type="stmt"/>
159
- <line num="42" count="22" type="stmt"/>
160
- <line num="43" count="3" type="stmt"/>
161
- <line num="47" count="7" type="stmt"/>
162
- <line num="50" count="4" type="stmt"/>
163
- </file>
164
- </package>
165
- </project>
166
- </coverage>
@@ -1,5 +0,0 @@
1
- {"/Users/cobydurling/Projects/zkapps/snarkyjs-pack/src/lib/PackingPlant.ts": {"path":"/Users/cobydurling/Projects/zkapps/snarkyjs-pack/src/lib/PackingPlant.ts","statementMap":{"0":{"start":{"line":10,"column":27},"end":{"line":10,"column":31}},"1":{"start":{"line":17,"column":2},"end":{"line":21,"column":null}},"2":{"start":{"line":18,"column":4},"end":{"line":20,"column":6}},"3":{"start":{"line":32,"column":6},"end":{"line":36,"column":null}},"4":{"start":{"line":33,"column":8},"end":{"line":35,"column":10}},"5":{"start":{"line":37,"column":6},"end":{"line":37,"column":24}},"6":{"start":{"line":29,"column":4},"end":{"line":29,"column":30}},"7":{"start":{"line":38,"column":6},"end":{"line":38,"column":21}},"8":{"start":{"line":42,"column":6},"end":{"line":42,"column":52}},"9":{"start":{"line":43,"column":6},"end":{"line":43,"column":16}},"10":{"start":{"line":47,"column":6},"end":{"line":47,"column":45}},"11":{"start":{"line":48,"column":14},"end":{"line":48,"column":22}},"12":{"start":{"line":49,"column":6},"end":{"line":49,"column":15}},"13":{"start":{"line":53,"column":6},"end":{"line":53,"column":45}},"14":{"start":{"line":57,"column":6},"end":{"line":57,"column":45}},"15":{"start":{"line":64,"column":23},"end":{"line":64,"column":65}},"16":{"start":{"line":65,"column":21},"end":{"line":65,"column":40}},"17":{"start":{"line":66,"column":6},"end":{"line":66,"column":40}},"18":{"start":{"line":25,"column":11},"end":{"line":25,"column":50}},"19":{"start":{"line":26,"column":11},"end":{"line":26,"column":25}},"20":{"start":{"line":69,"column":2},"end":{"line":69,"column":17}},"21":{"start":{"line":76,"column":2},"end":{"line":80,"column":null}},"22":{"start":{"line":77,"column":4},"end":{"line":79,"column":6}},"23":{"start":{"line":81,"column":12},"end":{"line":81,"column":65}},"24":{"start":{"line":93,"column":6},"end":{"line":95,"column":null}},"25":{"start":{"line":94,"column":8},"end":{"line":94,"column":58}},"26":{"start":{"line":96,"column":6},"end":{"line":96,"column":24}},"27":{"start":{"line":90,"column":4},"end":{"line":90,"column":30}},"28":{"start":{"line":97,"column":6},"end":{"line":97,"column":21}},"29":{"start":{"line":101,"column":6},"end":{"line":101,"column":52}},"30":{"start":{"line":102,"column":6},"end":{"line":102,"column":16}},"31":{"start":{"line":106,"column":6},"end":{"line":106,"column":45}},"32":{"start":{"line":107,"column":14},"end":{"line":107,"column":24}},"33":{"start":{"line":108,"column":6},"end":{"line":108,"column":15}},"34":{"start":{"line":112,"column":6},"end":{"line":112,"column":50}},"35":{"start":{"line":116,"column":6},"end":{"line":116,"column":75}},"36":{"start":{"line":123,"column":23},"end":{"line":123,"column":65}},"37":{"start":{"line":124,"column":21},"end":{"line":124,"column":40}},"38":{"start":{"line":125,"column":6},"end":{"line":127,"column":null}},"39":{"start":{"line":125,"column":19},"end":{"line":125,"column":20}},"40":{"start":{"line":126,"column":8},"end":{"line":126,"column":48}},"41":{"start":{"line":85,"column":11},"end":{"line":85,"column":69}},"42":{"start":{"line":86,"column":11},"end":{"line":86,"column":25}},"43":{"start":{"line":87,"column":11},"end":{"line":87,"column":25}},"44":{"start":{"line":130,"column":2},"end":{"line":130,"column":17}}},"fnMap":{"0":{"name":"PackingPlant","decl":{"start":{"line":12,"column":16},"end":{"line":12,"column":28}},"loc":{"start":{"line":15,"column":17},"end":{"line":70,"column":1}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":31,"column":4},"end":{"line":31,"column":16}},"loc":{"start":{"line":31,"column":44},"end":{"line":39,"column":5}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":41,"column":4},"end":{"line":41,"column":10}},"loc":{"start":{"line":41,"column":60},"end":{"line":44,"column":5}}},"3":{"name":"(anonymous_3)","decl":{"start":{"line":46,"column":4},"end":{"line":46,"column":10}},"loc":{"start":{"line":46,"column":29},"end":{"line":50,"column":5}}},"4":{"name":"(anonymous_4)","decl":{"start":{"line":52,"column":4},"end":{"line":52,"column":10}},"loc":{"start":{"line":52,"column":26},"end":{"line":54,"column":5}}},"5":{"name":"(anonymous_5)","decl":{"start":{"line":56,"column":4},"end":{"line":56,"column":16}},"loc":{"start":{"line":56,"column":31},"end":{"line":58,"column":5}}},"6":{"name":"(anonymous_6)","decl":{"start":{"line":63,"column":4},"end":{"line":63,"column":10}},"loc":{"start":{"line":63,"column":41},"end":{"line":67,"column":5}}},"7":{"name":"MultiPackingPlant","decl":{"start":{"line":72,"column":16},"end":{"line":72,"column":33}},"loc":{"start":{"line":75,"column":44},"end":{"line":131,"column":1}}},"8":{"name":"(anonymous_8)","decl":{"start":{"line":92,"column":4},"end":{"line":92,"column":16}},"loc":{"start":{"line":92,"column":51},"end":{"line":98,"column":5}}},"9":{"name":"(anonymous_9)","decl":{"start":{"line":100,"column":4},"end":{"line":100,"column":10}},"loc":{"start":{"line":100,"column":67},"end":{"line":103,"column":5}}},"10":{"name":"(anonymous_10)","decl":{"start":{"line":105,"column":4},"end":{"line":105,"column":10}},"loc":{"start":{"line":105,"column":29},"end":{"line":109,"column":5}}},"11":{"name":"(anonymous_11)","decl":{"start":{"line":111,"column":4},"end":{"line":111,"column":10}},"loc":{"start":{"line":111,"column":38},"end":{"line":113,"column":5}}},"12":{"name":"(anonymous_12)","decl":{"start":{"line":115,"column":4},"end":{"line":115,"column":16}},"loc":{"start":{"line":115,"column":31},"end":{"line":117,"column":5}}},"13":{"name":"(anonymous_13)","decl":{"start":{"line":122,"column":4},"end":{"line":122,"column":10}},"loc":{"start":{"line":122,"column":48},"end":{"line":128,"column":5}}}},"branchMap":{"0":{"loc":{"start":{"line":17,"column":2},"end":{"line":21,"column":null}},"type":"if","locations":[{"start":{"line":17,"column":2},"end":{"line":21,"column":null}}]},"1":{"loc":{"start":{"line":32,"column":6},"end":{"line":36,"column":null}},"type":"if","locations":[{"start":{"line":32,"column":6},"end":{"line":36,"column":null}}]},"2":{"loc":{"start":{"line":76,"column":2},"end":{"line":80,"column":null}},"type":"if","locations":[{"start":{"line":76,"column":2},"end":{"line":80,"column":null}}]},"3":{"loc":{"start":{"line":93,"column":6},"end":{"line":95,"column":null}},"type":"if","locations":[{"start":{"line":93,"column":6},"end":{"line":95,"column":null}}]}},"s":{"0":3,"1":10,"2":2,"3":12,"4":2,"5":10,"6":10,"7":10,"8":0,"9":0,"10":0,"11":0,"12":0,"13":4,"14":4,"15":2,"16":2,"17":2,"18":8,"19":8,"20":8,"21":8,"22":0,"23":8,"24":10,"25":2,"26":8,"27":8,"28":8,"29":0,"30":0,"31":0,"32":0,"33":0,"34":5,"35":2,"36":1,"37":1,"38":1,"39":1,"40":3,"41":8,"42":8,"43":8,"44":8},"f":{"0":10,"1":12,"2":0,"3":0,"4":4,"5":4,"6":2,"7":8,"8":10,"9":0,"10":0,"11":5,"12":2,"13":1},"b":{"0":[2],"1":[2],"2":[0],"3":[2]}}
2
- ,"/Users/cobydurling/Projects/zkapps/snarkyjs-pack/src/lib/packed-types/PackedBool.ts": {"path":"/Users/cobydurling/Projects/zkapps/snarkyjs-pack/src/lib/packed-types/PackedBool.ts","statementMap":{"0":{"start":{"line":4,"column":21},"end":{"line":4,"column":23}},"1":{"start":{"line":9,"column":24},"end":{"line":23,"column":8}},"2":{"start":{"line":10,"column":21},"end":{"line":10,"column":33}},"3":{"start":{"line":11,"column":8},"end":{"line":11,"column":24}},"4":{"start":{"line":13,"column":8},"end":{"line":17,"column":null}},"5":{"start":{"line":14,"column":10},"end":{"line":14,"column":44}},"6":{"start":{"line":16,"column":10},"end":{"line":16,"column":54}},"7":{"start":{"line":18,"column":8},"end":{"line":21,"column":null}},"8":{"start":{"line":18,"column":21},"end":{"line":18,"column":22}},"9":{"start":{"line":19,"column":10},"end":{"line":19,"column":60}},"10":{"start":{"line":20,"column":10},"end":{"line":20,"column":35}},"11":{"start":{"line":22,"column":8},"end":{"line":22,"column":60}},"12":{"start":{"line":22,"column":33},"end":{"line":22,"column":58}},"13":{"start":{"line":24,"column":6},"end":{"line":24,"column":23}},"14":{"start":{"line":28,"column":14},"end":{"line":28,"column":30}},"15":{"start":{"line":29,"column":6},"end":{"line":32,"column":null}},"16":{"start":{"line":29,"column":19},"end":{"line":29,"column":20}},"17":{"start":{"line":30,"column":18},"end":{"line":30,"column":58}},"18":{"start":{"line":31,"column":8},"end":{"line":31,"column":43}},"19":{"start":{"line":33,"column":6},"end":{"line":33,"column":15}},"20":{"start":{"line":37,"column":21},"end":{"line":37,"column":42}},"21":{"start":{"line":38,"column":6},"end":{"line":38,"column":42}},"22":{"start":{"line":42,"column":22},"end":{"line":42,"column":49}},"23":{"start":{"line":42,"column":41},"end":{"line":42,"column":48}},"24":{"start":{"line":43,"column":6},"end":{"line":43,"column":41}},"25":{"start":{"line":47,"column":6},"end":{"line":47,"column":71}},"26":{"start":{"line":47,"column":56},"end":{"line":47,"column":69}},"27":{"start":{"line":50,"column":2},"end":{"line":50,"column":21}}},"fnMap":{"0":{"name":"PackedBoolFactory","decl":{"start":{"line":6,"column":16},"end":{"line":6,"column":33}},"loc":{"start":{"line":6,"column":43},"end":{"line":51,"column":1}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":8,"column":4},"end":{"line":8,"column":10}},"loc":{"start":{"line":8,"column":60},"end":{"line":25,"column":5}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":9,"column":66},"end":{"line":9,"column":69}},"loc":{"start":{"line":9,"column":71},"end":{"line":23,"column":7}}},"3":{"name":"(anonymous_3)","decl":{"start":{"line":22,"column":26},"end":{"line":22,"column":27}},"loc":{"start":{"line":22,"column":33},"end":{"line":22,"column":58}}},"4":{"name":"(anonymous_4)","decl":{"start":{"line":27,"column":4},"end":{"line":27,"column":10}},"loc":{"start":{"line":27,"column":32},"end":{"line":34,"column":5}}},"5":{"name":"(anonymous_5)","decl":{"start":{"line":36,"column":4},"end":{"line":36,"column":10}},"loc":{"start":{"line":36,"column":41},"end":{"line":39,"column":5}}},"6":{"name":"(anonymous_6)","decl":{"start":{"line":41,"column":4},"end":{"line":41,"column":10}},"loc":{"start":{"line":41,"column":47},"end":{"line":44,"column":5}}},"7":{"name":"(anonymous_7)","decl":{"start":{"line":42,"column":34},"end":{"line":42,"column":35}},"loc":{"start":{"line":42,"column":41},"end":{"line":42,"column":48}}},"8":{"name":"(anonymous_8)","decl":{"start":{"line":46,"column":4},"end":{"line":46,"column":14}},"loc":{"start":{"line":46,"column":14},"end":{"line":48,"column":5}}},"9":{"name":"(anonymous_9)","decl":{"start":{"line":47,"column":49},"end":{"line":47,"column":50}},"loc":{"start":{"line":47,"column":56},"end":{"line":47,"column":69}}}},"branchMap":{"0":{"loc":{"start":{"line":13,"column":8},"end":{"line":17,"column":null}},"type":"if","locations":[{"start":{"line":13,"column":8},"end":{"line":17,"column":null}},{"start":{"line":15,"column":15},"end":{"line":17,"column":null}}]},"1":{"loc":{"start":{"line":13,"column":12},"end":{"line":13,"column":33}},"type":"binary-expr","locations":[{"start":{"line":13,"column":12},"end":{"line":13,"column":17}},{"start":{"line":13,"column":21},"end":{"line":13,"column":33}}]}},"s":{"0":1,"1":3,"2":3,"3":3,"4":3,"5":3,"6":0,"7":3,"8":3,"9":762,"10":762,"11":3,"12":762,"13":3,"14":5,"15":5,"16":5,"17":1265,"18":1265,"19":5,"20":3,"21":3,"22":3,"23":763,"24":3,"25":1,"26":254,"27":4},"f":{"0":5,"1":3,"2":3,"3":762,"4":5,"5":3,"6":3,"7":763,"8":1,"9":254},"b":{"0":[3,0],"1":[3,3]}}
3
- ,"/Users/cobydurling/Projects/zkapps/snarkyjs-pack/src/lib/packed-types/PackedString.ts": {"path":"/Users/cobydurling/Projects/zkapps/snarkyjs-pack/src/lib/packed-types/PackedString.ts","statementMap":{"0":{"start":{"line":4,"column":21},"end":{"line":4,"column":24}},"1":{"start":{"line":5,"column":24},"end":{"line":5,"column":26}},"2":{"start":{"line":12,"column":24},"end":{"line":41,"column":8}},"3":{"start":{"line":13,"column":21},"end":{"line":13,"column":33}},"4":{"start":{"line":14,"column":8},"end":{"line":14,"column":24}},"5":{"start":{"line":15,"column":23},"end":{"line":15,"column":40}},"6":{"start":{"line":16,"column":8},"end":{"line":16,"column":26}},"7":{"start":{"line":17,"column":26},"end":{"line":17,"column":43}},"8":{"start":{"line":18,"column":8},"end":{"line":18,"column":44}},"9":{"start":{"line":19,"column":8},"end":{"line":23,"column":null}},"10":{"start":{"line":19,"column":21},"end":{"line":19,"column":22}},"11":{"start":{"line":20,"column":10},"end":{"line":22,"column":null}},"12":{"start":{"line":21,"column":12},"end":{"line":21,"column":44}},"13":{"start":{"line":24,"column":8},"end":{"line":26,"column":null}},"14":{"start":{"line":25,"column":10},"end":{"line":25,"column":78}},"15":{"start":{"line":27,"column":8},"end":{"line":29,"column":null}},"16":{"start":{"line":27,"column":21},"end":{"line":27,"column":22}},"17":{"start":{"line":28,"column":10},"end":{"line":28,"column":61}},"18":{"start":{"line":30,"column":8},"end":{"line":37,"column":null}},"19":{"start":{"line":30,"column":21},"end":{"line":30,"column":22}},"20":{"start":{"line":31,"column":24},"end":{"line":31,"column":35}},"21":{"start":{"line":32,"column":10},"end":{"line":36,"column":null}},"22":{"start":{"line":32,"column":23},"end":{"line":32,"column":24}},"23":{"start":{"line":33,"column":22},"end":{"line":33,"column":45}},"24":{"start":{"line":34,"column":12},"end":{"line":34,"column":62}},"25":{"start":{"line":35,"column":12},"end":{"line":35,"column":37}},"26":{"start":{"line":38,"column":8},"end":{"line":40,"column":10}},"27":{"start":{"line":39,"column":10},"end":{"line":39,"column":62}},"28":{"start":{"line":42,"column":6},"end":{"line":42,"column":23}},"29":{"start":{"line":46,"column":19},"end":{"line":46,"column":21}},"30":{"start":{"line":47,"column":23},"end":{"line":47,"column":31}},"31":{"start":{"line":48,"column":6},"end":{"line":67,"column":null}},"32":{"start":{"line":49,"column":28},"end":{"line":49,"column":46}},"33":{"start":{"line":50,"column":8},"end":{"line":52,"column":null}},"34":{"start":{"line":51,"column":10},"end":{"line":51,"column":53}},"35":{"start":{"line":55,"column":16},"end":{"line":55,"column":33}},"36":{"start":{"line":56,"column":18},"end":{"line":56,"column":66}},"37":{"start":{"line":57,"column":8},"end":{"line":65,"column":null}},"38":{"start":{"line":57,"column":21},"end":{"line":57,"column":22}},"39":{"start":{"line":58,"column":23},"end":{"line":58,"column":41}},"40":{"start":{"line":59,"column":10},"end":{"line":61,"column":null}},"41":{"start":{"line":60,"column":12},"end":{"line":60,"column":55}},"42":{"start":{"line":62,"column":24},"end":{"line":62,"column":46}},"43":{"start":{"line":63,"column":20},"end":{"line":63,"column":60}},"44":{"start":{"line":64,"column":10},"end":{"line":64,"column":34}},"45":{"start":{"line":66,"column":8},"end":{"line":66,"column":23}},"46":{"start":{"line":68,"column":6},"end":{"line":68,"column":20}},"47":{"start":{"line":72,"column":23},"end":{"line":72,"column":25}},"48":{"start":{"line":73,"column":6},"end":{"line":75,"column":null}},"49":{"start":{"line":73,"column":19},"end":{"line":73,"column":20}},"50":{"start":{"line":74,"column":8},"end":{"line":74,"column":54}},"51":{"start":{"line":77,"column":6},"end":{"line":77,"column":44}},"52":{"start":{"line":81,"column":21},"end":{"line":81,"column":35}},"53":{"start":{"line":82,"column":6},"end":{"line":82,"column":44}},"54":{"start":{"line":86,"column":23},"end":{"line":86,"column":45}},"55":{"start":{"line":87,"column":6},"end":{"line":89,"column":18}},"56":{"start":{"line":88,"column":23},"end":{"line":88,"column":48}},"57":{"start":{"line":92,"column":2},"end":{"line":92,"column":23}}},"fnMap":{"0":{"name":"PackedStringFactory","decl":{"start":{"line":7,"column":16},"end":{"line":7,"column":35}},"loc":{"start":{"line":7,"column":45},"end":{"line":93,"column":1}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":9,"column":4},"end":{"line":9,"column":10}},"loc":{"start":{"line":10,"column":50},"end":{"line":43,"column":5}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":12,"column":71},"end":{"line":12,"column":74}},"loc":{"start":{"line":12,"column":76},"end":{"line":41,"column":7}}},"3":{"name":"(anonymous_3)","decl":{"start":{"line":38,"column":26},"end":{"line":38,"column":27}},"loc":{"start":{"line":39,"column":10},"end":{"line":39,"column":62}}},"4":{"name":"(anonymous_4)","decl":{"start":{"line":45,"column":4},"end":{"line":45,"column":10}},"loc":{"start":{"line":45,"column":32},"end":{"line":69,"column":5}}},"5":{"name":"(anonymous_5)","decl":{"start":{"line":71,"column":4},"end":{"line":71,"column":10}},"loc":{"start":{"line":71,"column":33},"end":{"line":78,"column":5}}},"6":{"name":"(anonymous_6)","decl":{"start":{"line":80,"column":4},"end":{"line":80,"column":10}},"loc":{"start":{"line":80,"column":46},"end":{"line":83,"column":5}}},"7":{"name":"(anonymous_7)","decl":{"start":{"line":85,"column":4},"end":{"line":85,"column":12}},"loc":{"start":{"line":85,"column":12},"end":{"line":90,"column":5}}},"8":{"name":"(anonymous_8)","decl":{"start":{"line":88,"column":16},"end":{"line":88,"column":17}},"loc":{"start":{"line":88,"column":23},"end":{"line":88,"column":48}}}},"branchMap":{"0":{"loc":{"start":{"line":20,"column":10},"end":{"line":22,"column":null}},"type":"if","locations":[{"start":{"line":20,"column":10},"end":{"line":22,"column":null}}]},"1":{"loc":{"start":{"line":24,"column":8},"end":{"line":26,"column":null}},"type":"if","locations":[{"start":{"line":24,"column":8},"end":{"line":26,"column":null}}]},"2":{"loc":{"start":{"line":50,"column":8},"end":{"line":52,"column":null}},"type":"if","locations":[{"start":{"line":50,"column":8},"end":{"line":52,"column":null}}]},"3":{"loc":{"start":{"line":59,"column":10},"end":{"line":61,"column":null}},"type":"if","locations":[{"start":{"line":59,"column":10},"end":{"line":61,"column":null}}]},"4":{"loc":{"start":{"line":62,"column":24},"end":{"line":62,"column":46}},"type":"binary-expr","locations":[{"start":{"line":62,"column":24},"end":{"line":62,"column":34}},{"start":{"line":62,"column":38},"end":{"line":62,"column":46}}]}},"s":{"0":1,"1":1,"2":6,"3":6,"4":6,"5":6,"6":6,"7":6,"8":6,"9":6,"10":6,"11":14,"12":13,"13":6,"14":0,"15":6,"16":6,"17":14,"18":6,"19":6,"20":14,"21":14,"22":14,"23":210,"24":210,"25":210,"26":6,"27":210,"28":6,"29":10,"30":10,"31":10,"32":29,"33":29,"34":0,"35":29,"36":29,"37":29,"38":29,"39":374,"40":374,"41":0,"42":374,"43":374,"44":374,"45":29,"46":10,"47":6,"48":6,"49":6,"50":277,"51":6,"52":7,"53":7,"54":4,"55":4,"56":104,"57":8},"f":{"0":8,"1":6,"2":6,"3":210,"4":10,"5":6,"6":7,"7":4,"8":104},"b":{"0":[13],"1":[0],"2":[0],"3":[0],"4":[374,0]}}
4
- ,"/Users/cobydurling/Projects/zkapps/snarkyjs-pack/src/lib/packed-types/PackedUInt32.ts": {"path":"/Users/cobydurling/Projects/zkapps/snarkyjs-pack/src/lib/packed-types/PackedUInt32.ts","statementMap":{"0":{"start":{"line":4,"column":21},"end":{"line":4,"column":24}},"1":{"start":{"line":9,"column":24},"end":{"line":23,"column":8}},"2":{"start":{"line":10,"column":21},"end":{"line":10,"column":33}},"3":{"start":{"line":11,"column":8},"end":{"line":11,"column":24}},"4":{"start":{"line":13,"column":8},"end":{"line":17,"column":null}},"5":{"start":{"line":14,"column":10},"end":{"line":14,"column":44}},"6":{"start":{"line":16,"column":10},"end":{"line":16,"column":54}},"7":{"start":{"line":18,"column":8},"end":{"line":21,"column":null}},"8":{"start":{"line":18,"column":21},"end":{"line":18,"column":22}},"9":{"start":{"line":19,"column":10},"end":{"line":19,"column":60}},"10":{"start":{"line":20,"column":10},"end":{"line":20,"column":35}},"11":{"start":{"line":22,"column":8},"end":{"line":22,"column":49}},"12":{"start":{"line":22,"column":33},"end":{"line":22,"column":47}},"13":{"start":{"line":24,"column":6},"end":{"line":24,"column":23}},"14":{"start":{"line":28,"column":14},"end":{"line":28,"column":26}},"15":{"start":{"line":29,"column":6},"end":{"line":32,"column":null}},"16":{"start":{"line":29,"column":19},"end":{"line":29,"column":20}},"17":{"start":{"line":30,"column":18},"end":{"line":30,"column":58}},"18":{"start":{"line":31,"column":8},"end":{"line":31,"column":39}},"19":{"start":{"line":33,"column":6},"end":{"line":33,"column":15}},"20":{"start":{"line":37,"column":21},"end":{"line":37,"column":44}},"21":{"start":{"line":38,"column":6},"end":{"line":38,"column":44}},"22":{"start":{"line":42,"column":22},"end":{"line":42,"column":56}},"23":{"start":{"line":42,"column":41},"end":{"line":42,"column":55}},"24":{"start":{"line":43,"column":6},"end":{"line":43,"column":41}},"25":{"start":{"line":47,"column":6},"end":{"line":47,"column":72}},"26":{"start":{"line":47,"column":58},"end":{"line":47,"column":70}},"27":{"start":{"line":50,"column":2},"end":{"line":50,"column":23}}},"fnMap":{"0":{"name":"PackedUInt32Factory","decl":{"start":{"line":6,"column":16},"end":{"line":6,"column":35}},"loc":{"start":{"line":6,"column":45},"end":{"line":51,"column":1}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":8,"column":4},"end":{"line":8,"column":10}},"loc":{"start":{"line":8,"column":60},"end":{"line":25,"column":5}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":9,"column":68},"end":{"line":9,"column":71}},"loc":{"start":{"line":9,"column":73},"end":{"line":23,"column":7}}},"3":{"name":"(anonymous_3)","decl":{"start":{"line":22,"column":26},"end":{"line":22,"column":27}},"loc":{"start":{"line":22,"column":33},"end":{"line":22,"column":47}}},"4":{"name":"(anonymous_4)","decl":{"start":{"line":27,"column":4},"end":{"line":27,"column":10}},"loc":{"start":{"line":27,"column":34},"end":{"line":34,"column":5}}},"5":{"name":"(anonymous_5)","decl":{"start":{"line":36,"column":4},"end":{"line":36,"column":10}},"loc":{"start":{"line":36,"column":43},"end":{"line":39,"column":5}}},"6":{"name":"(anonymous_6)","decl":{"start":{"line":41,"column":4},"end":{"line":41,"column":10}},"loc":{"start":{"line":41,"column":45},"end":{"line":44,"column":5}}},"7":{"name":"(anonymous_7)","decl":{"start":{"line":42,"column":34},"end":{"line":42,"column":35}},"loc":{"start":{"line":42,"column":41},"end":{"line":42,"column":55}}},"8":{"name":"(anonymous_8)","decl":{"start":{"line":46,"column":4},"end":{"line":46,"column":13}},"loc":{"start":{"line":46,"column":13},"end":{"line":48,"column":5}}},"9":{"name":"(anonymous_9)","decl":{"start":{"line":47,"column":51},"end":{"line":47,"column":52}},"loc":{"start":{"line":47,"column":58},"end":{"line":47,"column":70}}}},"branchMap":{"0":{"loc":{"start":{"line":13,"column":8},"end":{"line":17,"column":null}},"type":"if","locations":[{"start":{"line":13,"column":8},"end":{"line":17,"column":null}},{"start":{"line":15,"column":15},"end":{"line":17,"column":null}}]},"1":{"loc":{"start":{"line":13,"column":12},"end":{"line":13,"column":33}},"type":"binary-expr","locations":[{"start":{"line":13,"column":12},"end":{"line":13,"column":17}},{"start":{"line":13,"column":21},"end":{"line":13,"column":33}}]}},"s":{"0":1,"1":3,"2":3,"3":3,"4":3,"5":3,"6":0,"7":3,"8":3,"9":21,"10":21,"11":3,"12":21,"13":3,"14":5,"15":5,"16":5,"17":30,"18":30,"19":5,"20":3,"21":3,"22":3,"23":22,"24":3,"25":1,"26":7,"27":4},"f":{"0":5,"1":3,"2":3,"3":21,"4":5,"5":3,"6":3,"7":22,"8":1,"9":7},"b":{"0":[3,0],"1":[3,3]}}
5
- }
@@ -1,268 +0,0 @@
1
-
2
- <!doctype html>
3
- <html lang="en">
4
-
5
- <head>
6
- <title>Code coverage report for PackedBool.ts</title>
7
- <meta charset="utf-8" />
8
- <link rel="stylesheet" href="prettify.css" />
9
- <link rel="stylesheet" href="base.css" />
10
- <link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
11
- <meta name="viewport" content="width=device-width, initial-scale=1" />
12
- <style type='text/css'>
13
- .coverage-summary .sorter {
14
- background-image: url(sort-arrow-sprite.png);
15
- }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <div class='wrapper'>
21
- <div class='pad1'>
22
- <h1><a href="index.html">All files</a> PackedBool.ts</h1>
23
- <div class='clearfix'>
24
-
25
- <div class='fl pad1y space-right2'>
26
- <span class="strong">88% </span>
27
- <span class="quiet">Statements</span>
28
- <span class='fraction'>22/25</span>
29
- </div>
30
-
31
-
32
- <div class='fl pad1y space-right2'>
33
- <span class="strong">50% </span>
34
- <span class="quiet">Branches</span>
35
- <span class='fraction'>1/2</span>
36
- </div>
37
-
38
-
39
- <div class='fl pad1y space-right2'>
40
- <span class="strong">87.5% </span>
41
- <span class="quiet">Functions</span>
42
- <span class='fraction'>7/8</span>
43
- </div>
44
-
45
-
46
- <div class='fl pad1y space-right2'>
47
- <span class="strong">86.36% </span>
48
- <span class="quiet">Lines</span>
49
- <span class='fraction'>19/22</span>
50
- </div>
51
-
52
-
53
- </div>
54
- <p class="quiet">
55
- Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
56
- </p>
57
- <template id="filterTemplate">
58
- <div class="quiet">
59
- Filter:
60
- <input oninput="onInput()" type="search" id="fileSearch">
61
- </div>
62
- </template>
63
- </div>
64
- <div class='status-line high'></div>
65
- <pre><table class="coverage">
66
- <tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
67
- <a name='L2'></a><a href='#L2'>2</a>
68
- <a name='L3'></a><a href='#L3'>3</a>
69
- <a name='L4'></a><a href='#L4'>4</a>
70
- <a name='L5'></a><a href='#L5'>5</a>
71
- <a name='L6'></a><a href='#L6'>6</a>
72
- <a name='L7'></a><a href='#L7'>7</a>
73
- <a name='L8'></a><a href='#L8'>8</a>
74
- <a name='L9'></a><a href='#L9'>9</a>
75
- <a name='L10'></a><a href='#L10'>10</a>
76
- <a name='L11'></a><a href='#L11'>11</a>
77
- <a name='L12'></a><a href='#L12'>12</a>
78
- <a name='L13'></a><a href='#L13'>13</a>
79
- <a name='L14'></a><a href='#L14'>14</a>
80
- <a name='L15'></a><a href='#L15'>15</a>
81
- <a name='L16'></a><a href='#L16'>16</a>
82
- <a name='L17'></a><a href='#L17'>17</a>
83
- <a name='L18'></a><a href='#L18'>18</a>
84
- <a name='L19'></a><a href='#L19'>19</a>
85
- <a name='L20'></a><a href='#L20'>20</a>
86
- <a name='L21'></a><a href='#L21'>21</a>
87
- <a name='L22'></a><a href='#L22'>22</a>
88
- <a name='L23'></a><a href='#L23'>23</a>
89
- <a name='L24'></a><a href='#L24'>24</a>
90
- <a name='L25'></a><a href='#L25'>25</a>
91
- <a name='L26'></a><a href='#L26'>26</a>
92
- <a name='L27'></a><a href='#L27'>27</a>
93
- <a name='L28'></a><a href='#L28'>28</a>
94
- <a name='L29'></a><a href='#L29'>29</a>
95
- <a name='L30'></a><a href='#L30'>30</a>
96
- <a name='L31'></a><a href='#L31'>31</a>
97
- <a name='L32'></a><a href='#L32'>32</a>
98
- <a name='L33'></a><a href='#L33'>33</a>
99
- <a name='L34'></a><a href='#L34'>34</a>
100
- <a name='L35'></a><a href='#L35'>35</a>
101
- <a name='L36'></a><a href='#L36'>36</a>
102
- <a name='L37'></a><a href='#L37'>37</a>
103
- <a name='L38'></a><a href='#L38'>38</a>
104
- <a name='L39'></a><a href='#L39'>39</a>
105
- <a name='L40'></a><a href='#L40'>40</a>
106
- <a name='L41'></a><a href='#L41'>41</a>
107
- <a name='L42'></a><a href='#L42'>42</a>
108
- <a name='L43'></a><a href='#L43'>43</a>
109
- <a name='L44'></a><a href='#L44'>44</a>
110
- <a name='L45'></a><a href='#L45'>45</a>
111
- <a name='L46'></a><a href='#L46'>46</a>
112
- <a name='L47'></a><a href='#L47'>47</a>
113
- <a name='L48'></a><a href='#L48'>48</a>
114
- <a name='L49'></a><a href='#L49'>49</a>
115
- <a name='L50'></a><a href='#L50'>50</a>
116
- <a name='L51'></a><a href='#L51'>51</a>
117
- <a name='L52'></a><a href='#L52'>52</a>
118
- <a name='L53'></a><a href='#L53'>53</a>
119
- <a name='L54'></a><a href='#L54'>54</a>
120
- <a name='L55'></a><a href='#L55'>55</a>
121
- <a name='L56'></a><a href='#L56'>56</a>
122
- <a name='L57'></a><a href='#L57'>57</a>
123
- <a name='L58'></a><a href='#L58'>58</a>
124
- <a name='L59'></a><a href='#L59'>59</a>
125
- <a name='L60'></a><a href='#L60'>60</a>
126
- <a name='L61'></a><a href='#L61'>61</a>
127
- <a name='L62'></a><a href='#L62'>62</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
128
- <span class="cline-any cline-neutral">&nbsp;</span>
129
- <span class="cline-any cline-neutral">&nbsp;</span>
130
- <span class="cline-any cline-neutral">&nbsp;</span>
131
- <span class="cline-any cline-neutral">&nbsp;</span>
132
- <span class="cline-any cline-neutral">&nbsp;</span>
133
- <span class="cline-any cline-yes">4x</span>
134
- <span class="cline-any cline-yes">4x</span>
135
- <span class="cline-any cline-neutral">&nbsp;</span>
136
- <span class="cline-any cline-neutral">&nbsp;</span>
137
- <span class="cline-any cline-neutral">&nbsp;</span>
138
- <span class="cline-any cline-neutral">&nbsp;</span>
139
- <span class="cline-any cline-yes">4x</span>
140
- <span class="cline-any cline-yes">4x</span>
141
- <span class="cline-any cline-neutral">&nbsp;</span>
142
- <span class="cline-any cline-neutral">&nbsp;</span>
143
- <span class="cline-any cline-neutral">&nbsp;</span>
144
- <span class="cline-any cline-neutral">&nbsp;</span>
145
- <span class="cline-any cline-neutral">&nbsp;</span>
146
- <span class="cline-any cline-neutral">&nbsp;</span>
147
- <span class="cline-any cline-neutral">&nbsp;</span>
148
- <span class="cline-any cline-neutral">&nbsp;</span>
149
- <span class="cline-any cline-yes">4x</span>
150
- <span class="cline-any cline-yes">4x</span>
151
- <span class="cline-any cline-yes">4x</span>
152
- <span class="cline-any cline-yes">4x</span>
153
- <span class="cline-any cline-yes">104x</span>
154
- <span class="cline-any cline-yes">104x</span>
155
- <span class="cline-any cline-neutral">&nbsp;</span>
156
- <span class="cline-any cline-yes">104x</span>
157
- <span class="cline-any cline-neutral">&nbsp;</span>
158
- <span class="cline-any cline-yes">4x</span>
159
- <span class="cline-any cline-neutral">&nbsp;</span>
160
- <span class="cline-any cline-neutral">&nbsp;</span>
161
- <span class="cline-any cline-neutral">&nbsp;</span>
162
- <span class="cline-any cline-yes">4x</span>
163
- <span class="cline-any cline-yes">4x</span>
164
- <span class="cline-any cline-yes">56x</span>
165
- <span class="cline-any cline-yes">56x</span>
166
- <span class="cline-any cline-neutral">&nbsp;</span>
167
- <span class="cline-any cline-yes">4x</span>
168
- <span class="cline-any cline-neutral">&nbsp;</span>
169
- <span class="cline-any cline-neutral">&nbsp;</span>
170
- <span class="cline-any cline-neutral">&nbsp;</span>
171
- <span class="cline-any cline-yes">2x</span>
172
- <span class="cline-any cline-neutral">&nbsp;</span>
173
- <span class="cline-any cline-neutral">&nbsp;</span>
174
- <span class="cline-any cline-neutral">&nbsp;</span>
175
- <span class="cline-any cline-neutral">&nbsp;</span>
176
- <span class="cline-any cline-neutral">&nbsp;</span>
177
- <span class="cline-any cline-neutral">&nbsp;</span>
178
- <span class="cline-any cline-no">&nbsp;</span>
179
- <span class="cline-any cline-no">&nbsp;</span>
180
- <span class="cline-any cline-no">&nbsp;</span>
181
- <span class="cline-any cline-neutral">&nbsp;</span>
182
- <span class="cline-any cline-neutral">&nbsp;</span>
183
- <span class="cline-any cline-neutral">&nbsp;</span>
184
- <span class="cline-any cline-neutral">&nbsp;</span>
185
- <span class="cline-any cline-neutral">&nbsp;</span>
186
- <span class="cline-any cline-yes">4x</span>
187
- <span class="cline-any cline-neutral">&nbsp;</span>
188
- <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import { Field, Provable, Struct, Bool, provable } from 'snarkyjs';
189
- &nbsp;
190
- export function PackedBoolFactory(l: number) {
191
- class PackedBool_ extends Struct({
192
- packed: Field,
193
- }) {
194
- static type = provable({ packed: Field }, {});
195
- static l: number = l;
196
- packed: Field;
197
- aux: Bool[];
198
- &nbsp;
199
- constructor(packed: Field, aux: Bool[]) {
200
- super({ packed });
201
- this.aux = aux;
202
- }
203
- &nbsp;
204
- /**
205
- * Unpacks a Field into its component Bool parts
206
- * @param value
207
- * @returns the unpacked auxilliary data used to pack the value
208
- */
209
- static toAuxiliary(value?: { packed: Field } | undefined): Bool[] {
210
- const auxiliary = Provable.witness(Provable.Array(Bool, l), () =&gt; {
211
- let bools_: bigint[] = [];
212
- let packedN = value?.packed.toBigInt() || <span class="branch-1 cbranch-no" title="branch not covered" >0n;</span>
213
- for (let i = 0; i &lt; l; i++) {
214
- bools_[i] = packedN &amp; ((1n &lt;&lt; 1n) - 1n);
215
- packedN &gt;&gt;= 1n;
216
- }
217
- return bools_.map((x) =&gt; Bool.fromJSON(Boolean(x)));
218
- });
219
- return auxiliary;
220
- }
221
- &nbsp;
222
- static pack(aux: Bool[]): Field {
223
- let f = Field(0);
224
- for (let i = 0; i &lt; l; i++) {
225
- const c = Field((2n ** 1n) ** BigInt(i));
226
- f = f.add(aux[i].toField().mul(c));
227
- }
228
- return f;
229
- }
230
- &nbsp;
231
- static unpack(f: Field): Bool[] {
232
- return this.toAuxiliary({ packed: f });
233
- }
234
- &nbsp;
235
- /**
236
- * In-Circuit verifiaction of the packed Field
237
- */
238
- <span class="fstat-no" title="function not covered" > static </span>check(value: { packed: Field }) {
239
- const unpacked = <span class="cstat-no" title="statement not covered" >this.toAuxiliary({ packed: value.packed });</span>
240
- const packed = <span class="cstat-no" title="statement not covered" >this.pack(unpacked);</span>
241
- <span class="cstat-no" title="statement not covered" > packed.assertEquals(value.packed);</span>
242
- }
243
- &nbsp;
244
- // TODO
245
- // static fromFields()
246
- }
247
- return PackedBool_;
248
- }
249
- &nbsp;</pre></td></tr></table></pre>
250
-
251
- <div class='push'></div><!-- for sticky footer -->
252
- </div><!-- /wrapper -->
253
- <div class='footer quiet pad2 space-top1 center small'>
254
- Code coverage generated by
255
- <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
256
- at 2023-07-15T18:22:19.535Z
257
- </div>
258
- <script src="prettify.js"></script>
259
- <script>
260
- window.onload = function () {
261
- prettyPrint();
262
- };
263
- </script>
264
- <script src="sorter.js"></script>
265
- <script src="block-navigation.js"></script>
266
- </body>
267
- </html>
268
-