@aztec/ivc-integration 5.0.0-rc.2 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  {
2
- "noir_version": "1.0.0-beta.21+f1a4575adac59af0a86b036cf73ff5883d142a91",
3
- "hash": "18195193484685251511",
2
+ "noir_version": "1.0.0-beta.22+c57152f91260ecdb9faad4efc20abb14b6d2ece7",
3
+ "hash": "847616990029399285",
4
4
  "abi": {
5
5
  "parameters": [
6
6
  {
@@ -61,7 +61,7 @@
61
61
  "name": "key",
62
62
  "type": {
63
63
  "kind": "array",
64
- "length": 143,
64
+ "length": 163,
65
65
  "type": {
66
66
  "kind": "field"
67
67
  }
@@ -126,436 +126,440 @@
126
126
  }
127
127
  }
128
128
  },
129
- "bytecode": "H4sIAAAAAAAA/7XZ11MUSRwH8A1gAHPOYs4BMWeiogIKBoy4wriOLrPLMotiHnOWnUUUM1EkKLiIiujDnY+/Ku8P4MW3q3vy5R6vvFnQ78CqbA8wWkV9aujp/vWve7t/xZpld0FppoUXmg2rpNoomyX9SJT9WJxLSI+22GxSWXJk4rpYWXq2gxcFLjvbEPaLRvXJXLrLmc3ncJFWq5OzWkTeLhQ0G27jtWCoB9QT6gX1hkKgUKgP1BfqB/WHBkADoUHQYGgINBQaBg2HRkAjoVHQaGgMNBYaB42HwqAJ0ERoEjQZmgJNhaZB06EZ0ExoFjQbmgPNheZB86FwaAEUAS2EFkGLoSXQUmgZtBxaAa2EVkGroTXQWigSioKioRgoFoqD1kHroXhoA7QR2gQlQIlQErQZ2gIlQynQVmgbtB3aAaVCO6Fd0G5oD7QX2gelQfshC3QASocyIA46CFmhQxAPHYaOQDYoExIgO+SAsiAnlA2JkAvKgY5Cx6Bc6Dh0AjoJnYJOQ2cgOqtSUnlO5XmVF1ReVHlJ5WWVV1ReVXlN5XWVN1TeVHlLpXr6Up5Kt0r1VCdPXpsm+UapItouZIsWQfwUZuj4n1GqinLyNhtv9V0F+Qa3VJ7CC1Yb58lzy4HfNgZs0tpjpsPG0WMlTIaAKiOVDesUd3FOu8ftYYiBHrOESk8+hc3PSHR+CX864+3m2AZJSt07PeLv9bnvHO7oL/96viqNOjH2k8BTMnQtxyYtOX6qT45N9JQpx0U65NhERZpzbJTb5zhQUL7N0VHv3759+0/tseNwjL4fMlakGCphW5vAVRwVM7UqCWuX6zwPUyI6biR/9S1zMUtPJQwp1boXqIiKmdazmGHH+A8eqFPlwy6znIks8ZVqjI9tF5ex9JrAZdqdufECL3rM+VRKZb7/5a1PtS/IEyrqjn3V2qiIpVE5w2eoonU6SQ7Z7PmDyulZu4nJDIutnDps+/EZy54wsUysgmH12k7sT2ViFX5TLaPnndg3lZpTWklVnRinOuA4Jr9xqqmmE+O8CDiO2W+cF/Sya7e0WcstXavPLW2mWqZbuk6HW9pMdbpXQkFacvxKnxwH0SumHHt1yHEQefWvhOp0q4TqodfdVgnVM7V63ZlKqI6lEqpn6em1HpWQl+qZ1rNeh0pI+bCz3HpmlvgaNNYswfnU0MWapY683bEDWht5WRq90XTBBisX0ht6q7lmUc4Htp3zlmX1glgm9k5TzRKs1Cxv6J3fVMuo0e9JJb33e1JNTX5PXtCH9h9qljkZWOb0keHoZjh0PoZpj4/uMAZoCJR0rXtHqWRL2Qre50wTKWCZyPNOnE0BRy6iKqYI77JEWKVPhDVMEd5jibBGnwhfMkVYyBLhSz22q5ca2M66RqaJ3GeZSKMeqfbSe6YIH7BE+F6fCJuYInzIEmGTPhF+YIrwEUuEHzQWJD0K6Q4V0F26R4V0nx7QQ3pUmcyJLqcQYxEt7doG5RtN5iDl7/PKjeH7pbHZcMfgexTco2ev3iGhffr26z9g4KDBQ4YOGz5i5KjRY8aOGx82YeKkyVOmTps+Y+as2XPmzpsfviBi4aLFS5YuW75i5arVa9ZGRkXHxMatWx+/YeOmhMSkzVuSU7Zu274jdeeu3Xv27kvbbzmQnsEdtB7iDx+xZQp2R5YzW3TlHD2We/zEyVOnz9BZkugcnacLdJEu0WW6QlfpGl2nG3STbtFtyiM3yeSh/DylcJZKI9N5Zx/5s3fR7OV9U6eezfv+aMrPj8Llz6ObuL/WNP/TrNx+tRm8k0sXla+Z03ghR1nfQqms5XsKj1Qe0/Ir5WvceEHkrJyzZFvEAoaSye/9IdreN0jVvnXIUNYh2u7IRTcGNR507DeSqSyO52wZDEPURPGCxZnb0jzJkf+jA3N5bJbLYsv+aUyTVL7BlemIPyijaS//0Y2Moxt/N7qhJIbPQW9qDKUpot3hltVp/0iE3Nh28VpSnJblsos8J4j3/MML0bYMJv/3Q7t5GUPUjn+TD1Pl9wHbpMWg5uc3bxlLEly2NusWsHmK68Avei9JsOfIv9gHfosRiun8D867MRP0IQAA",
130
- "debug_symbols": "pZTbioMwEED/Jc8+ZHIz7q8sS0nbtAhBJdXCUvrvO2aibWEVaV/mqHEOkwmZGzv6/XDe1c2pvbCv7xvbxzqE+rwL7cH1ddvg19u9YNPrro/e4yf2tI5ZnYu+6dlXM4RQsKsLQ/rp0rkmsXcRV3nBfHNEovBUBz8+3YtHNl9OlbrMyUqqOV1VL/mwki81ZIF8NojNFWihskAbuVSBXKkA7CSQAh4VaL7ZIKScDXrRoJcNpixNNpiyeuzCbBeYahJYMG8IrChnATbvf8FaE6Sdm6BAv9NGPP/ZoMslA/BP+7hu2NLIVcPHndRKT33Qyiz1Ye1K2OlOGV69XIkffHOHOr6MEQZ43wom8JeCyRRVijpFk2KZokVlwaoUgROAgOm4b8B8i1AETTCEkmAJVYLgSSyAQEUIqkJQGYLqEFSIQAsekbCEKkFyAhAEAS2AnZAqU2eaTDQBblyiCvBAZEVUPBMyRabMVEmvNMEQqCw1usYGjq5xFFxdrN0++DyvT0NzeBrf/W83rUwDvovtwR+H6MczSmt4an8=",
129
+ "bytecode": "H4sIAAAAAAAA/7XZV1QTSxgH8BTw2nuv2HtB7J2qqICCBStGWHE1JCEkKPbYuyFBFLtSRGwogmCXIqifgj7z4ts998mX+3iPdwH9D0Qls8jCOZzf2czOfPPN7M53iNaRnJoRpxMN1arZtlw/vS56q59xe5DVEO2v0+ttmeG+ofMDHbabK0WLQUhIUHn9otGjcCHaak4QEwXf2FizEKuziEZDarUqHbd5Qi2gv6CWUCuoNdQGagu1g9pDHaCOUCeoM9QF6gp1g7pDPaCeUC+oN9QH6gv1g/pDAyAvaCA0CBoMDYGGQsOg4dAIaCQ0ChoNjYHGQuOg8dAEyBuaCPlAk6DJ0BRoKjQNmg7NgGZCs6DZ0BxoLjQP8oX8IH8oAAqEgqD50AIoGFoILYIWQyFQKBQGLYGWQuFQBLQMWg6tgFZCkdAqaDW0BloLrYPWQ1HQBkgHbYSioRhIgDZBsdBmSIS2QFshPRQHGSAjZILiITOUAFkgK5QIbYO2Q0nQDmgntAvaDe2B9kK0j9HGuJ/xAONBxkOMhxmPMB5lPMZ4nPEE40nGU4ynGc8w2hmTGdlbnZyMKYxnGVMZzzGeZ0xjvMB4kfES42XGK4xXGa8xXme8wchOFspgzGTMYrxprzf9bLUt299oSLDoDJZSL1XjP2rbbT+zqNeLsTXHXIoq2ZYVIRpi9YLTnuxwf7fabZO6HuNMeoEeOu12joByfKWH0WxZLZiNzmQnRwz0kCdUyiv1mhATav7ifW1k4ZLAApstct0In78XJBWZkv2//Ov8KjVqwth57qek+rMca+Tk+JEyOdbQI64c5yuQYw3ly86x2tEwx+6CqtkcjfX+7du3/1iPjYejrvnjwIoUQI/51sZ9hUoFXK0eezXItd3JlYjGGzm+1ixzAU9PjzlSKncvUD4VcK1nAceOcR3cXafSw+7geSfyxFcoMz6+XVzE02uIEGc0JwUbRItTm0KFVFTzm1V3Vf6C5FF+c+yrukb5PI2ecDxD2XXTCTM5tM5iekJPG0zMwbHY0luHbz8+5dkTGp6JPeNYvfoTK5Em9sxlqkX0vAn75oXslL6gl00Y55XbcTQu47yi100Yp9jtOFqXcYqp5M9Oaa2cU7pUmVNaS6Vcp3SZAqe0lsoUr4Q85OT4jTI59qA3XDkuVyDHHlSufCVUplglVAG9bbZKqIKr1dumVEJlPJVQBU9Pb5WohMqpgms9KxSohKSHnefU0/LE905mzeKZQu/+sGYpo/Lm2AF1jcp5Gr2XdcB6SgfSeyLZNYv0fuDbOcSzeh48E/sgq2bxlGqW9/TBZapF9NHlyguqdLnyiqpcrhTTp4YPNc+cVDxz+szx6uZ46Xz2kh8f3eIMUOUu6XL3jlTJFvIVvM+5JpLDM5HnTXg3uR05n15yRXibJ8KXykT4mivCOzwRvlYmwhKuCO/yRFiixHYtp3d877qPXBO5xzORj0qkupwquSK8zxNhpTIRVnFFmMsTYZUyEX7iivABT4SfZBYkLdLoFuXQbbpDd+ke3adcepATLlisZkOAzqJr0NYjRa3Rekj/n5dOjJoP1dWqW6qaS54t/mrZqnWbtu3ad+jYqXOXrt269+jZq3efvv36D/AaOGjwkKHDho8YOWr0mLHjxk/wnugzafKUqdOmz5g5a/acufN8/fwDAoPmLwheuGhxSGjYkqXhEcuWr1gZuWr1mrXr1kdt0G2MjhE2xW4Wt2zVxxmMpnhzgsWauG170o6du3bv2Uv7yEb76QAdpEN0mI7QUTpGx+kEnaRTdJrOkJ2SyUFOSqGzlErn6Dyl0QW6SJfoMl2hq3SNrtMNSqcMyqQsuknZdqnAtmX4Rovmto7KvMljZrSLHLbP/v3S0J8veTsq+zwTquZW/1MtnZK5MaJZiLZIX7VHiYZEaR+k2TJrv89w2rICaj+SvsoONliEWMGcvtxnIkdp5XJ/V3n3q2x3atYrRlovf6MpCd2oWDzo2GUkTWaQKOhjOIa46ycadOak2uZhppQfHWizAuOtOn3CT2NqbFkLrXGm4E0ONG3pOrqac3T170ZXpQeIieiNxZARYTGakh1s2j8S4XhSf/FqUxwVbzVaRMFgOe8aXmt5y6Bxvb9NMy9ja9bxb/Khyfk+YL20qFh+fnOXOj3Eqq+3bm6bR1g3/qL39BBjouMX+8BlMdpgOv8DMAE7tfgiAAA=",
130
+ "debug_symbols": "pZTBjoIwEIbfpWcOzExbqK+y2RjUakgIEgSTjfHdd+gU0AOEXS/9gDpfpn9tH+rkD/1lX9bn603tvh7q0JZVVV721fVYdOW15q+PZ6LG133Xes+f1Ms8VzVF6+tO7eq+qhJ1L6o+/OjWFHVgV7Q8mybK1ycmC89l5YenZzJXp8ulZLJYrElP5Qbe6mGlnqyJAtI6nwwIWzswqKPAWFrqgFY6ABzXT2DmCAxuN1g3GdyiwSwbrM4hGqx2cwp2uyAbU7CGs/u7wBBOAqMXBGsh8NLHEMjAf2KkbNoIcrRkgPTTHNcNW4JcNXyc5LwIfsSlHNaOxJxC6t6OxDe/FceyfbtGFPB5SxTyGU4UhVGH0YTRhjELY87KRLkwQioAAZfzVQBcnzO0wAisIBPkAheAaRAjCKQJlC5Q2kDpA6URZAv/0zAXuABKBSBAAVuAkyAdaSJtJJuAF06sAt4QckKdRkIkRlKkDnptBFYgbenBNQQ4uIbNvxdtWRwqH+/rc18fX67v7qcZZ8YLvmmvR3/qWz/sUZjjXfsF",
131
131
  "file_map": {
132
132
  "6": {
133
- "source": "use crate::{cmp::Eq, convert::From, runtime::is_unconstrained, static_assert};\n\n/// A `BoundedVec<T, MaxLen>` is a growable storage similar to a built-in vector except that it\n/// is bounded with a maximum possible length. `BoundedVec` is also not\n/// subject to the same restrictions vectors are (notably, nested vectors are disallowed).\n///\n/// Since a BoundedVec is backed by a normal array under the hood, growing the BoundedVec by\n/// pushing an additional element is also more efficient - the length only needs to be increased\n/// by one.\n///\n/// For these reasons `BoundedVec<T, N>` should generally be preferred over vectors when there\n/// is a reasonable maximum bound that can be placed on the vector.\n///\n/// Example:\n///\n/// ```noir\n/// let mut vector: BoundedVec<Field, 10> = BoundedVec::new();\n/// for i in 0..5 {\n/// vector.push(i);\n/// }\n/// assert(vector.len() == 5);\n/// assert(vector.max_len() == 10);\n/// ```\npub struct BoundedVec<T, let MaxLen: u32> {\n storage: [T; MaxLen],\n len: u32,\n}\n\nimpl<T, let MaxLen: u32> BoundedVec<T, MaxLen> {\n /// Creates a new, empty vector of length zero.\n ///\n /// Since this container is backed by an array internally, it still needs an initial value\n /// to give each element. To resolve this, each element is zeroed internally. This value\n /// is guaranteed to be inaccessible unless `get_unchecked` is used.\n ///\n /// Example:\n ///\n /// ```noir\n /// let empty_vector: BoundedVec<Field, 10> = BoundedVec::new();\n /// assert(empty_vector.len() == 0);\n /// ```\n ///\n /// Note that whenever calling `new` the maximum length of the vector should always be specified\n /// via a type signature:\n ///\n /// ```noir\n /// fn good() -> BoundedVec<Field, 10> {\n /// // Ok! MaxLen is specified with a type annotation\n /// let v1: BoundedVec<Field, 3> = BoundedVec::new();\n /// let v2 = BoundedVec::new();\n ///\n /// // Ok! MaxLen is known from the type of `good`'s return value\n /// v2\n /// }\n ///\n /// fn bad() {\n /// // Error: Type annotation needed\n /// // The compiler can't infer `MaxLen` from the following code:\n /// let mut v3 = BoundedVec::new();\n /// v3.push(5);\n /// }\n /// ```\n ///\n /// This defaulting of `MaxLen` (and numeric generics in general) to zero may change in future noir versions\n /// but for now make sure to use type annotations when using bounded vectors. Otherwise, you will receive a\n /// constraint failure at runtime when the vec is pushed to.\n pub fn new() -> Self {\n let zeroed = crate::mem::zeroed();\n BoundedVec { storage: [zeroed; MaxLen], len: 0 }\n }\n\n /// Retrieves an element from the vector at the given index, starting from zero.\n ///\n /// If the given index is equal to or greater than the length of the vector, this\n /// will issue a constraint failure.\n ///\n /// Example:\n ///\n /// ```noir\n /// fn foo<let N: u32>(v: BoundedVec<u32, N>) {\n /// let first = v.get(0);\n /// let last = v.get(v.len() - 1);\n /// assert(first != last);\n /// }\n /// ```\n pub fn get(&self, index: u32) -> T {\n assert(index < self.len, \"Attempted to read past end of BoundedVec\");\n self.get_unchecked(index)\n }\n\n /// Retrieves an element from the vector at the given index, starting from zero, without\n /// performing a bounds check.\n ///\n /// Since this function does not perform a bounds check on length before accessing the element,\n /// it is unsafe! Use at your own risk!\n ///\n /// Example:\n ///\n /// ```noir\n /// fn sum_of_first_three<let N: u32>(v: BoundedVec<u32, N>) -> u32 {\n /// // Always ensure the length is larger than the largest\n /// // index passed to get_unchecked\n /// assert(v.len() > 2);\n /// let first = v.get_unchecked(0);\n /// let second = v.get_unchecked(1);\n /// let third = v.get_unchecked(2);\n /// first + second + third\n /// }\n /// ```\n pub fn get_unchecked(&self, index: u32) -> T {\n self.storage[index]\n }\n\n /// Writes an element to the vector at the given index, starting from zero.\n ///\n /// If the given index is equal to or greater than the length of the vector, this will issue a constraint failure.\n ///\n /// Example:\n ///\n /// ```noir\n /// fn foo<let N: u32>(v: BoundedVec<u32, N>) {\n /// let first = v.get(0);\n /// assert(first != 42);\n /// v.set(0, 42);\n /// let new_first = v.get(0);\n /// assert(new_first == 42);\n /// }\n /// ```\n pub fn set(&mut self, index: u32, value: T) {\n assert(index < self.len, \"Attempted to write past end of BoundedVec\");\n self.set_unchecked(index, value)\n }\n\n /// Writes an element to the vector at the given index, starting from zero, without performing a bounds check.\n ///\n /// Since this function does not perform a bounds check on length before accessing the element, it is unsafe! Use at your own risk!\n ///\n /// Example:\n ///\n /// ```noir\n /// fn set_unchecked_example() {\n /// let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n /// vec.extend_from_array([1, 2]);\n ///\n /// // Here we're safely writing within the valid range of `vec`\n /// // `vec` now has the value [42, 2]\n /// vec.set_unchecked(0, 42);\n ///\n /// // We can then safely read this value back out of `vec`.\n /// // Notice that we use the checked version of `get` which would prevent reading unsafe values.\n /// assert_eq(vec.get(0), 42);\n ///\n /// // We've now written past the end of `vec`.\n /// // As this index is still within the maximum potential length of `v`,\n /// // it won't cause a constraint failure.\n /// vec.set_unchecked(2, 42);\n /// println(vec);\n ///\n /// // This will write past the end of the maximum potential length of `vec`,\n /// // it will then trigger a constraint failure.\n /// vec.set_unchecked(5, 42);\n /// println(vec);\n /// }\n /// ```\n pub fn set_unchecked(&mut self, index: u32, value: T) {\n self.storage[index] = value;\n }\n\n /// Pushes an element to the end of the vector. This increases the length\n /// of the vector by one.\n ///\n /// Panics if the new length of the vector will be greater than the max length.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 2> = BoundedVec::new();\n ///\n /// v.push(1);\n /// v.push(2);\n ///\n /// // Panics with failed assertion \"push out of bounds\"\n /// v.push(3);\n /// ```\n pub fn push(&mut self, elem: T) {\n assert(self.len < MaxLen, \"push out of bounds\");\n\n self.storage[self.len] = elem;\n self.len += 1;\n }\n\n /// Returns the current length of this vector\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 4> = BoundedVec::new();\n /// assert(v.len() == 0);\n ///\n /// v.push(100);\n /// assert(v.len() == 1);\n ///\n /// v.push(200);\n /// v.push(300);\n /// v.push(400);\n /// assert(v.len() == 4);\n ///\n /// let _ = v.pop();\n /// let _ = v.pop();\n /// assert(v.len() == 2);\n /// ```\n pub fn len(&self) -> u32 {\n self.len\n }\n\n /// Returns the maximum length of this vector. This is always\n /// equal to the `MaxLen` parameter this vector was initialized with.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 5> = BoundedVec::new();\n ///\n /// assert(v.max_len() == 5);\n /// v.push(10);\n /// assert(v.max_len() == 5);\n /// ```\n pub fn max_len(_self: &BoundedVec<T, MaxLen>) -> u32 {\n MaxLen\n }\n\n /// Returns the internal array within this vector.\n ///\n /// Since arrays in Noir are immutable, mutating the returned storage array will not mutate\n /// the storage held internally by this vector.\n ///\n /// Note that uninitialized elements may be zeroed out!\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 5> = BoundedVec::new();\n ///\n /// assert(v.storage() == [0, 0, 0, 0, 0]);\n ///\n /// v.push(57);\n /// assert(v.storage() == [57, 0, 0, 0, 0]);\n /// ```\n pub fn storage(self) -> [T; MaxLen] {\n self.storage\n }\n\n /// Pushes each element from the given array to this vector.\n ///\n /// Panics if pushing each element would cause the length of this vector\n /// to exceed the maximum length.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut vec: BoundedVec<Field, 3> = BoundedVec::new();\n /// vec.extend_from_array([2, 4]);\n ///\n /// assert(vec.len == 2);\n /// assert(vec.get(0) == 2);\n /// assert(vec.get(1) == 4);\n /// ```\n pub fn extend_from_array<let Len: u32>(&mut self, array: [T; Len]) {\n let new_len = self.len + array.len();\n assert(new_len <= MaxLen, \"extend_from_array out of bounds\");\n for i in 0..array.len() {\n self.storage[self.len + i] = array[i];\n }\n self.len = new_len;\n }\n\n /// Pushes each element from the given vector to this vector.\n ///\n /// Panics if pushing each element would cause the length of this vector\n /// to exceed the maximum length.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut vec: BoundedVec<Field, 3> = BoundedVec::new();\n /// vec.extend_from_vector([2, 4].as_vector());\n ///\n /// assert(vec.len == 2);\n /// assert(vec.get(0) == 2);\n /// assert(vec.get(1) == 4);\n /// ```\n pub fn extend_from_vector(&mut self, vector: [T]) {\n let new_len = self.len + vector.len();\n assert(new_len <= MaxLen, \"extend_from_vector out of bounds\");\n for i in 0..vector.len() {\n self.storage[self.len + i] = vector[i];\n }\n self.len = new_len;\n }\n\n /// Pushes each element from the other vector to this vector. The length of\n /// the other vector is left unchanged.\n ///\n /// Panics if pushing each element would cause the length of this vector\n /// to exceed the maximum length.\n ///\n /// ```noir\n /// let mut v1: BoundedVec<Field, 5> = BoundedVec::new();\n /// let mut v2: BoundedVec<Field, 7> = BoundedVec::new();\n ///\n /// v2.extend_from_array([1, 2, 3]);\n /// v1.extend_from_bounded_vec(v2);\n ///\n /// assert(v1.storage() == [1, 2, 3, 0, 0]);\n /// assert(v2.storage() == [1, 2, 3, 0, 0, 0, 0]);\n /// ```\n pub fn extend_from_bounded_vec<let Len: u32>(&mut self, vec: BoundedVec<T, Len>) {\n let append_len = vec.len();\n let new_len = self.len + append_len;\n assert(new_len <= MaxLen, \"extend_from_bounded_vec out of bounds\");\n\n if is_unconstrained() {\n for i in 0..append_len {\n self.storage[self.len + i] = vec.get_unchecked(i);\n }\n } else {\n // The source vector can be longer than the destination, or vice versa;\n // regardless we will only ever be able to read or write whichever is\n // the shorter max length of the two. We asserted that the actual content fits,\n // but the capacity of the source vector could be higher.\n let max = crate::cmp::min(Len, MaxLen);\n\n // Save the last item in case we have to do a fixup on an already full array.\n let last = if MaxLen > 0 {\n self.storage[MaxLen - 1]\n } else {\n crate::mem::zeroed()\n };\n\n for src in 0..max {\n // Since we are iterating to the static capacity of the arrays,\n // the destination could be out of bounds. If that's the case,\n // overwrite the last item, which we'll fixup in the end.\n // NB using cmp::min resulted in more opcodes here.\n let mut dst = self.len + src;\n if dst >= MaxLen { dst = MaxLen - 1; };\n // Assigning the source or zeroed to avoid having to merge arrays in SSA.\n self.storage[dst] = if src < append_len {\n vec.get_unchecked(src)\n } else {\n last\n }\n }\n\n // Fixup the last item if we have to.\n if MaxLen > 0 {\n self.storage[MaxLen - 1] = if (self.len + append_len == MaxLen) & (append_len > 0) {\n vec.get_unchecked(append_len - 1)\n } else {\n last\n }\n }\n }\n self.len = new_len;\n }\n\n /// Creates a new vector, populating it with values derived from an array input.\n /// The maximum length of the vector is determined based on the type signature.\n ///\n /// Example:\n ///\n /// ```noir\n /// let bounded_vec: BoundedVec<Field, 10> = BoundedVec::from_array([1, 2, 3])\n /// ```\n pub fn from_array<let Len: u32>(array: [T; Len]) -> Self {\n static_assert(Len <= MaxLen, \"from array out of bounds\");\n let mut vec: BoundedVec<T, MaxLen> = BoundedVec::new();\n vec.extend_from_array(array);\n vec\n }\n\n /// Pops the element at the end of the vector. This will decrease the length\n /// of the vector by one.\n ///\n /// Panics if the vector is empty.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 2> = BoundedVec::new();\n /// v.push(1);\n /// v.push(2);\n ///\n /// let two = v.pop();\n /// let one = v.pop();\n ///\n /// assert(two == 2);\n /// assert(one == 1);\n ///\n /// // error: cannot pop from an empty vector\n /// let _ = v.pop();\n /// ```\n pub fn pop(&mut self) -> T {\n assert(self.len > 0, \"cannot pop from an empty vector\");\n self.len -= 1;\n\n let elem = self.storage[self.len];\n self.storage[self.len] = crate::mem::zeroed();\n elem\n }\n\n /// Returns true if the given predicate returns true for any element\n /// in this vector.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<u32, 3> = BoundedVec::new();\n /// v.extend_from_array([2, 4, 6]);\n ///\n /// let all_even = !v.any(|elem: u32| elem % 2 != 0);\n /// assert(all_even);\n /// ```\n pub fn any<Env>(self, predicate: fn[Env](T) -> bool) -> bool {\n let mut ret = false;\n if is_unconstrained() {\n for i in 0..self.len {\n ret |= predicate(self.storage[i]);\n }\n } else {\n let mut exceeded_len = false;\n for i in 0..MaxLen {\n exceeded_len |= i == self.len;\n if !exceeded_len {\n ret |= predicate(self.storage[i]);\n }\n }\n }\n ret\n }\n\n /// Creates a new vector of equal size by calling a closure on each element in this vector.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n /// let result = vec.map(|value| value * 2);\n ///\n /// let expected = BoundedVec::from_array([2, 4, 6, 8]);\n /// assert_eq(result, expected);\n /// ```\n pub fn map<U, Env>(&self, f: fn[Env](T) -> U) -> BoundedVec<U, MaxLen> {\n let mut ret = BoundedVec::new();\n ret.len = self.len();\n\n if is_unconstrained() {\n for i in 0..self.len() {\n ret.storage[i] = f(self.get_unchecked(i));\n }\n } else {\n for i in 0..MaxLen {\n ret.storage[i] = if i < self.len() {\n f(self.get_unchecked(i))\n } else {\n crate::mem::zeroed()\n }\n }\n }\n\n ret\n }\n\n /// Creates a new vector of equal size by calling a closure on each element\n /// in this vector, along with its index.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n /// let result = vec.mapi(|i, value| i + value * 2);\n ///\n /// let expected = BoundedVec::from_array([2, 5, 8, 11]);\n /// assert_eq(result, expected);\n /// ```\n pub fn mapi<U, Env>(&self, f: fn[Env](u32, T) -> U) -> BoundedVec<U, MaxLen> {\n let mut ret = BoundedVec::new();\n ret.len = self.len();\n\n if is_unconstrained() {\n for i in 0..self.len() {\n ret.storage[i] = f(i, self.get_unchecked(i));\n }\n } else {\n for i in 0..MaxLen {\n ret.storage[i] = if i < self.len() {\n f(i, self.get_unchecked(i))\n } else {\n crate::mem::zeroed()\n }\n }\n }\n\n ret\n }\n\n /// Calls a closure on each element in this vector.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n /// let mut result = BoundedVec::<u32, 4>::new();\n /// vec.for_each(|value| result.push(value * 2));\n ///\n /// let expected = BoundedVec::from_array([2, 4, 6, 8]);\n /// assert_eq(result, expected);\n /// ```\n pub fn for_each<Env>(&self, f: fn[Env](T) -> ()) {\n if is_unconstrained() {\n for i in 0..self.len() {\n f(self.get_unchecked(i));\n }\n } else {\n for i in 0..MaxLen {\n if i < self.len() {\n f(self.get_unchecked(i));\n }\n }\n }\n }\n\n /// Calls a closure on each element in this vector, along with its index.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n /// let mut result = BoundedVec::<u32, 4>::new();\n /// vec.for_eachi(|i, value| result.push(i + value * 2));\n ///\n /// let expected = BoundedVec::from_array([2, 5, 8, 11]);\n /// assert_eq(result, expected);\n /// ```\n pub fn for_eachi<Env>(&self, f: fn[Env](u32, T) -> ()) {\n if is_unconstrained() {\n for i in 0..self.len() {\n f(i, self.get_unchecked(i));\n }\n } else {\n for i in 0..MaxLen {\n if i < self.len() {\n f(i, self.get_unchecked(i));\n }\n }\n }\n }\n\n /// Creates a new BoundedVec from the given array and length.\n /// The given length must be less than or equal to the length of the array.\n ///\n /// This function will zero out any elements at or past index `len` of `array`.\n /// This incurs an extra runtime cost of O(MaxLen). If you are sure your array is\n /// zeroed after that index, you can use [`from_parts_unchecked`][Self::from_parts_unchecked] to remove the extra loop.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_parts([1, 2, 3, 0], 3);\n /// assert_eq(vec.len(), 3);\n /// ```\n pub fn from_parts(mut array: [T; MaxLen], len: u32) -> Self {\n assert(len <= MaxLen);\n let zeroed = crate::mem::zeroed();\n\n if is_unconstrained() {\n for i in len..MaxLen {\n array[i] = zeroed;\n }\n } else {\n for i in 0..MaxLen {\n if i >= len {\n array[i] = zeroed;\n }\n }\n }\n\n BoundedVec { storage: array, len }\n }\n\n /// Creates a new BoundedVec from the given array and length.\n /// The given length must be less than or equal to the length of the array.\n ///\n /// This function is unsafe because it expects all elements past the `len` index\n /// of `array` to be zeroed, but does not check for this internally. Use `from_parts`\n /// for a safe version of this function which does zero out any indices past the\n /// given length. Invalidating this assumption can notably cause `BoundedVec::eq`\n /// to give incorrect results since it will check even elements past `len`.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 0], 3);\n /// assert_eq(vec.len(), 3);\n ///\n /// // invalid use!\n /// let vec1: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 1], 3);\n /// let vec2: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 2], 3);\n ///\n /// // both vecs have length 3 so we'd expect them to be equal, but this\n /// // fails because elements past the length are still checked in eq\n /// assert_eq(vec1, vec2); // fails\n /// ```\n pub fn from_parts_unchecked(array: [T; MaxLen], len: u32) -> Self {\n assert(len <= MaxLen);\n BoundedVec { storage: array, len }\n }\n}\n\nimpl<T, let MaxLen: u32> Eq for BoundedVec<T, MaxLen>\nwhere\n T: Eq,\n{\n fn eq(self, other: BoundedVec<T, MaxLen>) -> bool {\n // TODO: https://github.com/noir-lang/noir/issues/4837\n //\n // We make the assumption that the user has used the proper interface for working with `BoundedVec`s\n // rather than directly manipulating the internal fields as this can result in an inconsistent internal state.\n if self.len == other.len {\n self.storage == other.storage\n } else {\n false\n }\n }\n}\n\nimpl<T, let MaxLen: u32, let Len: u32> From<[T; Len]> for BoundedVec<T, MaxLen> {\n fn from(array: [T; Len]) -> BoundedVec<T, MaxLen> {\n BoundedVec::from_array(array)\n }\n}\n\nmod bounded_vec_tests {\n\n mod get {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test(should_fail_with = \"Attempted to read past end of BoundedVec\")]\n fn panics_when_reading_elements_past_end_of_vec() {\n let vec: BoundedVec<Field, 5> = BoundedVec::new();\n\n let _ = vec.get(0);\n }\n\n #[test(should_fail_with = \"Attempted to read past end of BoundedVec\")]\n fn panics_when_reading_beyond_length() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n let _ = vec.get(3);\n }\n\n #[test]\n fn get_works_within_bounds() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(2), 3);\n assert_eq(vec.get(4), 5);\n }\n\n #[test]\n fn get_unchecked_works() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n assert_eq(vec.get_unchecked(0), 1);\n assert_eq(vec.get_unchecked(2), 3);\n }\n\n #[test]\n fn get_unchecked_works_past_len() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n assert_eq(vec.get_unchecked(4), 0);\n }\n }\n\n mod set {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn set_updates_values_properly() {\n let mut vec = BoundedVec::from_array([0, 0, 0, 0, 0]);\n\n vec.set(0, 42);\n assert_eq(vec.storage, [42, 0, 0, 0, 0]);\n\n vec.set(1, 43);\n assert_eq(vec.storage, [42, 43, 0, 0, 0]);\n\n vec.set(2, 44);\n assert_eq(vec.storage, [42, 43, 44, 0, 0]);\n\n vec.set(1, 10);\n assert_eq(vec.storage, [42, 10, 44, 0, 0]);\n\n vec.set(0, 0);\n assert_eq(vec.storage, [0, 10, 44, 0, 0]);\n }\n\n #[test(should_fail_with = \"Attempted to write past end of BoundedVec\")]\n fn panics_when_writing_elements_past_end_of_vec() {\n let mut vec: BoundedVec<Field, 5> = BoundedVec::new();\n vec.set(0, 42);\n }\n\n #[test(should_fail_with = \"Attempted to write past end of BoundedVec\")]\n fn panics_when_setting_beyond_length() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n vec.set(3, 4);\n }\n\n #[test]\n fn set_unchecked_operations() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.push(2);\n\n vec.set_unchecked(0, 10);\n assert_eq(vec.get(0), 10);\n }\n\n #[test(should_fail_with = \"Attempted to read past end of BoundedVec\")]\n fn set_unchecked_operations_past_len() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.push(2);\n\n vec.set_unchecked(3, 40);\n assert_eq(vec.get(3), 40);\n }\n\n #[test]\n fn set_preserves_other_elements() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n\n vec.set(2, 30);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(1), 2);\n assert_eq(vec.get(2), 30);\n assert_eq(vec.get(3), 4);\n assert_eq(vec.get(4), 5);\n }\n }\n\n mod any {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn returns_false_if_predicate_not_satisfied() {\n let vec: BoundedVec<bool, 4> = BoundedVec::from_array([false, false, false, false]);\n let result = vec.any(|value| value);\n\n assert(!result);\n }\n\n #[test]\n fn returns_true_if_predicate_satisfied() {\n let vec: BoundedVec<bool, 4> = BoundedVec::from_array([false, false, true, true]);\n let result = vec.any(|value| value);\n\n assert(result);\n }\n\n #[test]\n fn returns_false_on_empty_boundedvec() {\n let vec: BoundedVec<bool, 0> = BoundedVec::new();\n let result = vec.any(|value| value);\n\n assert(!result);\n }\n\n #[test]\n fn any_with_complex_predicates() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n\n assert(vec.any(|x| x > 3));\n assert(!vec.any(|x| x > 10));\n assert(vec.any(|x| x % 2 == 0)); // has a even number\n assert(vec.any(|x| x == 3)); // has a specific value\n }\n\n #[test]\n fn any_with_partial_vector() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.push(2);\n\n assert(vec.any(|x| x == 1));\n assert(vec.any(|x| x == 2));\n assert(!vec.any(|x| x == 3));\n }\n }\n\n mod map {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn applies_function_correctly() {\n // docs:start:bounded-vec-map-example\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.map(|value| value * 2);\n // docs:end:bounded-vec-map-example\n let expected = BoundedVec::from_array([2, 4, 6, 8]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn applies_function_that_changes_return_type() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.map(|value| (value * 2) as Field);\n let expected: BoundedVec<Field, 4> = BoundedVec::from_array([2, 4, 6, 8]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn does_not_apply_function_past_len() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([0, 1]);\n let result = vec.map(|value| if value == 0 { 5 } else { value });\n let expected = BoundedVec::from_array([5, 1]);\n\n assert_eq(result, expected);\n assert_eq(result.get_unchecked(2), 0);\n }\n\n #[test]\n fn map_with_conditional_logic() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n\n let result = vec.map(|x| if x % 2 == 0 { x * 2 } else { x });\n let expected = BoundedVec::from_array([1, 4, 3, 8]);\n assert_eq(result, expected);\n }\n\n #[test]\n fn map_preserves_length() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.map(|x| x * 2);\n\n assert_eq(result.len(), vec.len());\n assert_eq(result.max_len(), vec.max_len());\n }\n\n #[test]\n fn map_on_empty_vector() {\n let vec: BoundedVec<u32, 5> = BoundedVec::new();\n let result = vec.map(|x| x * 2);\n assert_eq(result, vec);\n assert_eq(result.len(), 0);\n assert_eq(result.max_len(), 5);\n }\n }\n\n mod mapi {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn applies_function_correctly() {\n // docs:start:bounded-vec-mapi-example\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.mapi(|i, value| i + value * 2);\n // docs:end:bounded-vec-mapi-example\n let expected = BoundedVec::from_array([2, 5, 8, 11]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn applies_function_that_changes_return_type() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.mapi(|i, value| (i + value * 2) as Field);\n let expected: BoundedVec<Field, 4> = BoundedVec::from_array([2, 5, 8, 11]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn does_not_apply_function_past_len() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([0, 1]);\n let result = vec.mapi(|_, value| if value == 0 { 5 } else { value });\n let expected = BoundedVec::from_array([5, 1]);\n\n assert_eq(result, expected);\n assert_eq(result.get_unchecked(2), 0);\n }\n\n #[test]\n fn mapi_with_index_branching_logic() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n\n let result = vec.mapi(|i, x| if i % 2 == 0 { x * 2 } else { x });\n let expected = BoundedVec::from_array([2, 2, 6, 4]);\n assert_eq(result, expected);\n }\n }\n\n mod for_each {\n use crate::collections::bounded_vec::BoundedVec;\n\n // map in terms of for_each\n fn for_each_map<T, U, Env, let MaxLen: u32>(\n input: BoundedVec<T, MaxLen>,\n f: fn[Env](T) -> U,\n ) -> BoundedVec<U, MaxLen> {\n let mut output = BoundedVec::<U, MaxLen>::new();\n let output_ref = &mut output;\n input.for_each(|x| output_ref.push(f(x)));\n output\n }\n\n #[test]\n fn smoke_test() {\n let mut acc = 0;\n let acc_ref = &mut acc;\n // docs:start:bounded-vec-for-each-example\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n vec.for_each(|value| { *acc_ref += value; });\n // docs:end:bounded-vec-for-each-example\n assert_eq(acc, 6);\n }\n\n #[test]\n fn applies_function_correctly() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = for_each_map(vec, |value| value * 2);\n let expected = BoundedVec::from_array([2, 4, 6, 8]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn applies_function_that_changes_return_type() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = for_each_map(vec, |value| (value * 2) as Field);\n let expected: BoundedVec<Field, 4> = BoundedVec::from_array([2, 4, 6, 8]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn does_not_apply_function_past_len() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([0, 1]);\n let result = for_each_map(vec, |value| if value == 0 { 5 } else { value });\n let expected = BoundedVec::from_array([5, 1]);\n\n assert_eq(result, expected);\n assert_eq(result.get_unchecked(2), 0);\n }\n\n #[test]\n fn for_each_on_empty_vector() {\n let vec: BoundedVec<u32, 5> = BoundedVec::new();\n let mut count = 0;\n let count_ref = &mut count;\n vec.for_each(|_| { *count_ref += 1; });\n assert_eq(count, 0);\n }\n\n #[test]\n fn for_each_with_side_effects() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n let mut seen = BoundedVec::<u32, 3>::new();\n let seen_ref = &mut seen;\n vec.for_each(|x| seen_ref.push(x));\n assert_eq(seen, vec);\n }\n }\n\n mod for_eachi {\n use crate::collections::bounded_vec::BoundedVec;\n\n // mapi in terms of for_eachi\n fn for_eachi_mapi<T, U, Env, let MaxLen: u32>(\n input: BoundedVec<T, MaxLen>,\n f: fn[Env](u32, T) -> U,\n ) -> BoundedVec<U, MaxLen> {\n let mut output = BoundedVec::<U, MaxLen>::new();\n let output_ref = &mut output;\n input.for_eachi(|i, x| output_ref.push(f(i, x)));\n output\n }\n\n #[test]\n fn smoke_test() {\n let mut acc = 0;\n let acc_ref = &mut acc;\n // docs:start:bounded-vec-for-eachi-example\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n vec.for_eachi(|i, value| { *acc_ref += i * value; });\n // docs:end:bounded-vec-for-eachi-example\n\n // 0 * 1 + 1 * 2 + 2 * 3\n assert_eq(acc, 8);\n }\n\n #[test]\n fn applies_function_correctly() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = for_eachi_mapi(vec, |i, value| i + value * 2);\n let expected = BoundedVec::from_array([2, 5, 8, 11]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn applies_function_that_changes_return_type() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = for_eachi_mapi(vec, |i, value| (i + value * 2) as Field);\n let expected: BoundedVec<Field, 4> = BoundedVec::from_array([2, 5, 8, 11]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn does_not_apply_function_past_len() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([0, 1]);\n let result = for_eachi_mapi(vec, |_, value| if value == 0 { 5 } else { value });\n let expected = BoundedVec::from_array([5, 1]);\n\n assert_eq(result, expected);\n assert_eq(result.get_unchecked(2), 0);\n }\n\n #[test]\n fn for_eachi_on_empty_vector() {\n let vec: BoundedVec<u32, 5> = BoundedVec::new();\n let mut count = 0;\n let count_ref = &mut count;\n vec.for_eachi(|_, _| { *count_ref += 1; });\n assert_eq(count, 0);\n }\n\n #[test]\n fn for_eachi_with_index_tracking() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([10, 20, 30]);\n let mut indices = BoundedVec::<u32, 3>::new();\n let indices_ref = &mut indices;\n vec.for_eachi(|i, _| indices_ref.push(i));\n\n let expected = BoundedVec::from_array([0, 1, 2]);\n assert_eq(indices, expected);\n }\n\n }\n\n mod from_array {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn empty() {\n let empty_array: [Field; 0] = [];\n let bounded_vec = BoundedVec::from_array([]);\n\n assert_eq(bounded_vec.max_len(), 0);\n assert_eq(bounded_vec.len(), 0);\n assert_eq(bounded_vec.storage(), empty_array);\n }\n\n #[test]\n fn equal_len() {\n let array = [1, 2, 3];\n let bounded_vec = BoundedVec::from_array(array);\n\n assert_eq(bounded_vec.max_len(), 3);\n assert_eq(bounded_vec.len(), 3);\n assert_eq(bounded_vec.storage(), array);\n }\n\n #[test]\n fn max_len_greater_then_array_len() {\n let array = [1, 2, 3];\n let bounded_vec: BoundedVec<Field, 10> = BoundedVec::from_array(array);\n\n assert_eq(bounded_vec.max_len(), 10);\n assert_eq(bounded_vec.len(), 3);\n assert_eq(bounded_vec.get(0), 1);\n assert_eq(bounded_vec.get(1), 2);\n assert_eq(bounded_vec.get(2), 3);\n }\n\n #[test(should_fail_with = \"from array out of bounds\")]\n fn max_len_lower_then_array_len() {\n let _: BoundedVec<Field, 2> = BoundedVec::from_array([0; 3]);\n }\n\n #[test]\n fn from_array_preserves_order() {\n let array = [5, 3, 1, 4, 2];\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array(array);\n for i in 0..array.len() {\n assert_eq(vec.get(i), array[i]);\n }\n }\n\n #[test]\n fn from_array_with_different_types() {\n let bool_array = [true, false, true];\n let bool_vec: BoundedVec<bool, 3> = BoundedVec::from_array(bool_array);\n assert_eq(bool_vec.len(), 3);\n assert_eq(bool_vec.get(0), true);\n assert_eq(bool_vec.get(1), false);\n }\n }\n\n mod trait_from {\n use crate::collections::bounded_vec::BoundedVec;\n use crate::convert::From;\n\n #[test]\n fn simple() {\n let array = [1, 2];\n let bounded_vec: BoundedVec<Field, 10> = BoundedVec::from(array);\n\n assert_eq(bounded_vec.max_len(), 10);\n assert_eq(bounded_vec.len(), 2);\n assert_eq(bounded_vec.get(0), 1);\n assert_eq(bounded_vec.get(1), 2);\n }\n }\n\n mod trait_eq {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn empty_equality() {\n let bounded_vec1: BoundedVec<Field, 3> = BoundedVec::new();\n let bounded_vec2: BoundedVec<Field, 3> = BoundedVec::new();\n\n assert_eq(bounded_vec1, bounded_vec2);\n }\n\n #[test]\n fn inequality() {\n let mut bounded_vec1: BoundedVec<Field, 3> = BoundedVec::new();\n let mut bounded_vec2: BoundedVec<Field, 3> = BoundedVec::new();\n bounded_vec1.push(1);\n bounded_vec2.push(2);\n\n assert(bounded_vec1 != bounded_vec2);\n }\n }\n\n mod from_parts {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn from_parts() {\n // docs:start:from-parts\n let vec: BoundedVec<u32, 4> = BoundedVec::from_parts([1, 2, 3, 0], 3);\n assert_eq(vec.len(), 3);\n\n // Any elements past the given length are zeroed out, so these\n // two BoundedVecs will be completely equal\n let vec1: BoundedVec<u32, 4> = BoundedVec::from_parts([1, 2, 3, 1], 3);\n let vec2: BoundedVec<u32, 4> = BoundedVec::from_parts([1, 2, 3, 2], 3);\n assert_eq(vec1, vec2);\n // docs:end:from-parts\n }\n\n #[test]\n fn from_parts_unchecked() {\n // docs:start:from-parts-unchecked\n let vec: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 0], 3);\n assert_eq(vec.len(), 3);\n\n // invalid use!\n let vec1: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 1], 3);\n let vec2: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 2], 3);\n\n // both vecs have length 3 so we'd expect them to be equal, but this\n // fails because elements past the length are still checked in eq\n assert(vec1 != vec2);\n // docs:end:from-parts-unchecked\n }\n }\n\n mod push_pop {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn push_and_pop_operations() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n\n assert_eq(vec.len(), 0);\n\n vec.push(1);\n assert_eq(vec.len(), 1);\n assert_eq(vec.get(0), 1);\n\n vec.push(2);\n assert_eq(vec.len(), 2);\n assert_eq(vec.get(1), 2);\n\n let popped = vec.pop();\n assert_eq(popped, 2);\n assert_eq(vec.len(), 1);\n\n let popped2 = vec.pop();\n assert_eq(popped2, 1);\n assert_eq(vec.len(), 0);\n }\n\n #[test(should_fail_with = \"push out of bounds\")]\n fn push_to_full_vector() {\n let mut vec: BoundedVec<u32, 2> = BoundedVec::new();\n vec.push(1);\n vec.push(2);\n vec.push(3); // should panic\n }\n\n #[test(should_fail_with = \"cannot pop from an empty vector\")]\n fn pop_from_empty_vector() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n let _ = vec.pop(); // should panic\n }\n\n #[test]\n fn push_pop_cycle() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::new();\n\n // push to full\n vec.push(1);\n vec.push(2);\n vec.push(3);\n assert_eq(vec.len(), 3);\n\n // pop all\n assert_eq(vec.pop(), 3);\n assert_eq(vec.pop(), 2);\n assert_eq(vec.pop(), 1);\n assert_eq(vec.len(), 0);\n\n // push again\n vec.push(4);\n assert_eq(vec.len(), 1);\n assert_eq(vec.get(0), 4);\n }\n }\n\n mod extend {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn extend_from_array() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.extend_from_array([2, 3]);\n\n assert_eq(vec.len(), 3);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(1), 2);\n assert_eq(vec.get(2), 3);\n }\n\n #[test]\n fn extend_from_vector() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.extend_from_vector([2, 3].as_vector());\n\n assert_eq(vec.len(), 3);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(1), 2);\n assert_eq(vec.get(2), 3);\n }\n\n #[test]\n fn extend_from_bounded_vec() {\n // The source deliberately has a higher capacity,\n // to make sure we are not trying to assign out-of-bounds.\n let mut vec1: BoundedVec<u32, 5> = BoundedVec::new();\n let mut vec2: BoundedVec<u32, 9> = BoundedVec::new();\n\n vec1.push(1);\n vec2.push(2);\n vec2.push(3);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 3);\n assert_eq(vec1.get(0), 1);\n assert_eq(vec1.get(1), 2);\n assert_eq(vec1.get(2), 3);\n }\n\n #[test]\n fn extend_from_bounded_vec_limit() {\n // Capacity and contents chosen so the last item must be assigned to.\n let mut vec1: BoundedVec<u32, 2> = BoundedVec::new();\n let mut vec2: BoundedVec<u32, 5> = BoundedVec::new();\n\n vec1.push(1);\n vec2.push(2);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 2);\n assert_eq(vec1.get(0), 1);\n assert_eq(vec1.get(1), 2);\n }\n\n #[test]\n fn extend_from_bounded_vec_full_and_empty() {\n // Capacity and contents chosen so the last item must be assigned to.\n let mut vec1: BoundedVec<u32, 2> = BoundedVec::new();\n let vec2: BoundedVec<u32, 5> = BoundedVec::new();\n\n vec1.push(1);\n vec1.push(2);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 2);\n assert_eq(vec1.get(0), 1);\n assert_eq(vec1.get(1), 2);\n }\n\n #[test]\n fn extend_from_bounded_vec_zero_len() {\n let mut vec1: BoundedVec<u32, 0> = BoundedVec::new();\n let vec2: BoundedVec<u32, 0> = BoundedVec::new();\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 0);\n }\n\n #[test]\n fn extend_from_bounded_vec_last_zeroed() {\n let mut vec1: BoundedVec<u32, 4> = BoundedVec::new();\n let mut vec2: BoundedVec<u32, 4> = BoundedVec::new();\n\n vec1.push(1);\n vec1.push(2);\n vec2.push(3);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 3);\n assert_eq(vec1.get_unchecked(3), 0);\n }\n\n #[test]\n fn extend_from_bounded_vec_empty_self() {\n // self.len == 0 with Len > MaxLen: the loop doesn't reach\n // the last storage slot, so the fixup must write it.\n let mut vec1: BoundedVec<u32, 3> = BoundedVec::new();\n let vec2: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 3);\n assert_eq(vec1.get(0), 1);\n assert_eq(vec1.get(1), 2);\n assert_eq(vec1.get(2), 3);\n }\n\n #[test]\n fn extend_from_bounded_vec_equal_capacity() {\n // Len == MaxLen, fills to capacity.\n let mut vec1: BoundedVec<u32, 4> = BoundedVec::new();\n vec1.push(1);\n let vec2: BoundedVec<u32, 4> = BoundedVec::from_array([2, 3, 4]);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 4);\n assert_eq(vec1.get(0), 1);\n assert_eq(vec1.get(1), 2);\n assert_eq(vec1.get(2), 3);\n assert_eq(vec1.get(3), 4);\n }\n\n #[test(should_fail_with = \"extend_from_array out of bounds\")]\n fn extend_array_beyond_max_len() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::new();\n vec.push(1);\n vec.extend_from_array([2, 3, 4]); // should panic\n }\n\n #[test(should_fail_with = \"extend_from_vector out of bounds\")]\n fn extend_vector_beyond_max_len() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::new();\n vec.push(1);\n vec.extend_from_vector([2, 3, 4].as_vector()); // S]should panic\n }\n\n #[test(should_fail_with = \"extend_from_bounded_vec out of bounds\")]\n fn extend_bounded_vec_beyond_max_len() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::new();\n let other: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n vec.extend_from_bounded_vec(other); // should panic\n }\n\n #[test]\n fn extend_with_empty_collections() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n let original_len = vec.len();\n\n vec.extend_from_array([]);\n assert_eq(vec.len(), original_len);\n\n vec.extend_from_vector([].as_vector());\n assert_eq(vec.len(), original_len);\n\n let empty: BoundedVec<u32, 3> = BoundedVec::new();\n vec.extend_from_bounded_vec(empty);\n assert_eq(vec.len(), original_len);\n }\n }\n\n mod storage {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn storage_consistency() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n\n // test initial storage state\n assert_eq(vec.storage(), [0, 0, 0, 0, 0]);\n\n vec.push(1);\n vec.push(2);\n\n // test storage after modifications\n assert_eq(vec.storage(), [1, 2, 0, 0, 0]);\n\n // storage doesn't change length\n assert_eq(vec.len(), 2);\n assert_eq(vec.max_len(), 5);\n }\n\n #[test]\n fn storage_after_pop() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n\n let _ = vec.pop();\n // after pop, the last element should be zeroed\n assert_eq(vec.storage(), [1, 2, 0]);\n assert_eq(vec.len(), 2);\n }\n\n #[test]\n fn vector_immutable() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n let storage = vec.storage();\n\n assert_eq(storage, [1, 2, 3]);\n\n // Verify that the original vector is unchanged\n assert_eq(vec.len(), 3);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(1), 2);\n assert_eq(vec.get(2), 3);\n }\n }\n}\n",
133
+ "source": "use crate::{cmp::Eq, convert::From, runtime::is_unconstrained, static_assert};\n\n/// A `BoundedVec<T, MaxLen>` is a growable storage similar to a built-in vector except that it\n/// is bounded with a maximum possible length. `BoundedVec` is also not\n/// subject to the same restrictions vectors are (notably, nested vectors are disallowed).\n///\n/// Since a BoundedVec is backed by a normal array under the hood, growing the BoundedVec by\n/// pushing an additional element is also more efficient - the length only needs to be increased\n/// by one.\n///\n/// For these reasons `BoundedVec<T, N>` should generally be preferred over vectors when there\n/// is a reasonable maximum bound that can be placed on the vector.\n///\n/// Example:\n///\n/// ```noir\n/// let mut vector: BoundedVec<Field, 10> = BoundedVec::new();\n/// for i in 0..5 {\n/// vector.push(i);\n/// }\n/// assert(vector.len() == 5);\n/// assert(vector.max_len() == 10);\n/// ```\npub struct BoundedVec<T, let MaxLen: u32> {\n storage: [T; MaxLen],\n len: u32,\n}\n\nimpl<T, let MaxLen: u32> BoundedVec<T, MaxLen> {\n /// Creates a new, empty vector of length zero.\n ///\n /// Since this container is backed by an array internally, it still needs an initial value\n /// to give each element. To resolve this, each element is zeroed internally. This value\n /// is guaranteed to be inaccessible unless `get_unchecked` is used.\n ///\n /// Example:\n ///\n /// ```noir\n /// let empty_vector: BoundedVec<Field, 10> = BoundedVec::new();\n /// assert(empty_vector.len() == 0);\n /// ```\n ///\n /// Note that whenever calling `new` the maximum length of the vector should generally be specified\n /// via a type signature:\n ///\n /// ```noir\n /// fn good() -> BoundedVec<Field, 10> {\n /// // Ok! MaxLen is specified with a type annotation\n /// let v1: BoundedVec<Field, 3> = BoundedVec::new();\n /// let v2 = BoundedVec::new();\n ///\n /// // Ok! MaxLen is known from the type of `good`'s return value\n /// v2\n /// }\n ///\n /// fn bad() {\n /// // Error: Type annotation needed\n /// // The compiler can't infer `MaxLen` from the following code:\n /// let mut v3 = BoundedVec::new();\n /// v3.push(5);\n /// }\n /// ```\n pub fn new() -> Self {\n let zeroed = crate::mem::zeroed();\n BoundedVec { storage: [zeroed; MaxLen], len: 0 }\n }\n\n /// Retrieves an element from the vector at the given index, starting from zero.\n ///\n /// If the given index is equal to or greater than the length of the vector, this\n /// will issue a constraint failure.\n ///\n /// Example:\n ///\n /// ```noir\n /// fn foo<let N: u32>(v: BoundedVec<u32, N>) {\n /// let first = v.get(0);\n /// let last = v.get(v.len() - 1);\n /// assert(first != last);\n /// }\n /// ```\n pub fn get(&self, index: u32) -> T {\n assert(index < self.len, \"Attempted to read past end of BoundedVec\");\n self.get_unchecked(index)\n }\n\n /// Retrieves an element from the vector at the given index, starting from zero, without\n /// performing a bounds check.\n ///\n /// Since this function does not perform a bounds check on length before accessing the element,\n /// it is unsafe! Use at your own risk!\n ///\n /// Example:\n ///\n /// ```noir\n /// fn sum_of_first_three<let N: u32>(v: BoundedVec<u32, N>) -> u32 {\n /// // Always ensure the length is larger than the largest\n /// // index passed to get_unchecked\n /// assert(v.len() > 2);\n /// let first = v.get_unchecked(0);\n /// let second = v.get_unchecked(1);\n /// let third = v.get_unchecked(2);\n /// first + second + third\n /// }\n /// ```\n pub fn get_unchecked(&self, index: u32) -> T {\n self.storage[index]\n }\n\n /// Writes an element to the vector at the given index, starting from zero.\n ///\n /// If the given index is equal to or greater than the length of the vector, this will issue a constraint failure.\n ///\n /// Example:\n ///\n /// ```noir\n /// fn foo<let N: u32>(v: BoundedVec<u32, N>) {\n /// let first = v.get(0);\n /// assert(first != 42);\n /// v.set(0, 42);\n /// let new_first = v.get(0);\n /// assert(new_first == 42);\n /// }\n /// ```\n pub fn set(&mut self, index: u32, value: T) {\n assert(index < self.len, \"Attempted to write past end of BoundedVec\");\n self.set_unchecked(index, value)\n }\n\n /// Writes an element to the vector at the given index, starting from zero, without performing a bounds check.\n ///\n /// Since this function does not perform a bounds check on length before accessing the element, it is unsafe! Use at your own risk!\n ///\n /// Example:\n ///\n /// ```noir\n /// fn set_unchecked_example() {\n /// let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n /// vec.extend_from_array([1, 2]);\n ///\n /// // Here we're safely writing within the valid range of `vec`\n /// // `vec` now has the value [42, 2]\n /// vec.set_unchecked(0, 42);\n ///\n /// // We can then safely read this value back out of `vec`.\n /// // Notice that we use the checked version of `get` which would prevent reading unsafe values.\n /// assert_eq(vec.get(0), 42);\n ///\n /// // We've now written past the end of `vec`.\n /// // As this index is still within the maximum potential length of `v`,\n /// // it won't cause a constraint failure.\n /// vec.set_unchecked(2, 42);\n /// println(vec);\n ///\n /// // This will write past the end of the maximum potential length of `vec`,\n /// // it will then trigger a constraint failure.\n /// vec.set_unchecked(5, 42);\n /// println(vec);\n /// }\n /// ```\n pub fn set_unchecked(&mut self, index: u32, value: T) {\n self.storage[index] = value;\n }\n\n /// Pushes an element to the end of the vector. This increases the length\n /// of the vector by one.\n ///\n /// Panics if the new length of the vector will be greater than the max length.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 2> = BoundedVec::new();\n ///\n /// v.push(1);\n /// v.push(2);\n ///\n /// // Panics with failed assertion \"push out of bounds\"\n /// v.push(3);\n /// ```\n pub fn push(&mut self, elem: T) {\n assert(self.len < MaxLen, \"push out of bounds\");\n\n self.storage[self.len] = elem;\n self.len += 1;\n }\n\n /// Returns the current length of this vector\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 4> = BoundedVec::new();\n /// assert(v.len() == 0);\n ///\n /// v.push(100);\n /// assert(v.len() == 1);\n ///\n /// v.push(200);\n /// v.push(300);\n /// v.push(400);\n /// assert(v.len() == 4);\n ///\n /// let _ = v.pop();\n /// let _ = v.pop();\n /// assert(v.len() == 2);\n /// ```\n pub fn len(&self) -> u32 {\n self.len\n }\n\n /// Returns the maximum length of this vector. This is always\n /// equal to the `MaxLen` parameter this vector was initialized with.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 5> = BoundedVec::new();\n ///\n /// assert(v.max_len() == 5);\n /// v.push(10);\n /// assert(v.max_len() == 5);\n /// ```\n pub fn max_len(_self: &BoundedVec<T, MaxLen>) -> u32 {\n MaxLen\n }\n\n /// Returns the internal array within this vector.\n ///\n /// Since arrays in Noir are immutable, mutating the returned storage array will not mutate\n /// the storage held internally by this vector.\n ///\n /// Note that uninitialized elements may be zeroed out!\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 5> = BoundedVec::new();\n ///\n /// assert(v.storage() == [0, 0, 0, 0, 0]);\n ///\n /// v.push(57);\n /// assert(v.storage() == [57, 0, 0, 0, 0]);\n /// ```\n pub fn storage(self) -> [T; MaxLen] {\n self.storage\n }\n\n /// Pushes each element from the given array to this vector.\n ///\n /// Panics if pushing each element would cause the length of this vector\n /// to exceed the maximum length.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut vec: BoundedVec<Field, 3> = BoundedVec::new();\n /// vec.extend_from_array([2, 4]);\n ///\n /// assert(vec.len == 2);\n /// assert(vec.get(0) == 2);\n /// assert(vec.get(1) == 4);\n /// ```\n pub fn extend_from_array<let Len: u32>(&mut self, array: [T; Len]) {\n let new_len = self.len + array.len();\n assert(new_len <= MaxLen, \"extend_from_array out of bounds\");\n for i in 0..array.len() {\n self.storage[self.len + i] = array[i];\n }\n self.len = new_len;\n }\n\n /// Pushes each element from the given vector to this vector.\n ///\n /// Panics if pushing each element would cause the length of this vector\n /// to exceed the maximum length.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut vec: BoundedVec<Field, 3> = BoundedVec::new();\n /// vec.extend_from_vector([2, 4].as_vector());\n ///\n /// assert(vec.len == 2);\n /// assert(vec.get(0) == 2);\n /// assert(vec.get(1) == 4);\n /// ```\n pub fn extend_from_vector(&mut self, vector: [T]) {\n let new_len = self.len + vector.len();\n assert(new_len <= MaxLen, \"extend_from_vector out of bounds\");\n for i in 0..vector.len() {\n self.storage[self.len + i] = vector[i];\n }\n self.len = new_len;\n }\n\n /// Pushes each element from the other vector to this vector. The length of\n /// the other vector is left unchanged.\n ///\n /// Panics if pushing each element would cause the length of this vector\n /// to exceed the maximum length.\n ///\n /// ```noir\n /// let mut v1: BoundedVec<Field, 5> = BoundedVec::new();\n /// let mut v2: BoundedVec<Field, 7> = BoundedVec::new();\n ///\n /// v2.extend_from_array([1, 2, 3]);\n /// v1.extend_from_bounded_vec(v2);\n ///\n /// assert(v1.storage() == [1, 2, 3, 0, 0]);\n /// assert(v2.storage() == [1, 2, 3, 0, 0, 0, 0]);\n /// ```\n pub fn extend_from_bounded_vec<let Len: u32>(&mut self, vec: BoundedVec<T, Len>) {\n let append_len = vec.len();\n let new_len = self.len + append_len;\n assert(new_len <= MaxLen, \"extend_from_bounded_vec out of bounds\");\n\n if is_unconstrained() {\n for i in 0..append_len {\n self.storage[self.len + i] = vec.get_unchecked(i);\n }\n } else {\n // The source vector can be longer than the destination, or vice versa;\n // regardless we will only ever be able to read or write whichever is\n // the shorter max length of the two. We asserted that the actual content fits,\n // but the capacity of the source vector could be higher.\n let max = crate::cmp::min(Len, MaxLen);\n\n // Save the last item in case we have to do a fixup on an already full array.\n let last = if MaxLen > 0 {\n self.storage[MaxLen - 1]\n } else {\n crate::mem::zeroed()\n };\n\n for src in 0..max {\n // Since we are iterating to the static capacity of the arrays,\n // the destination could be out of bounds. If that's the case,\n // overwrite the last item, which we'll fixup in the end.\n // NB using cmp::min resulted in more opcodes here.\n let mut dst = self.len + src;\n if dst >= MaxLen { dst = MaxLen - 1; };\n // Assigning the source or zeroed to avoid having to merge arrays in SSA.\n self.storage[dst] = if src < append_len {\n vec.get_unchecked(src)\n } else {\n last\n }\n }\n\n // Fixup the last item if we have to.\n if MaxLen > 0 {\n self.storage[MaxLen - 1] = if (self.len + append_len == MaxLen) & (append_len > 0) {\n vec.get_unchecked(append_len - 1)\n } else {\n last\n }\n }\n }\n self.len = new_len;\n }\n\n /// Creates a new vector, populating it with values derived from an array input.\n /// The maximum length of the vector is determined based on the type signature.\n ///\n /// Example:\n ///\n /// ```noir\n /// let bounded_vec: BoundedVec<Field, 10> = BoundedVec::from_array([1, 2, 3])\n /// ```\n pub fn from_array<let Len: u32>(array: [T; Len]) -> Self {\n static_assert(Len <= MaxLen, \"from array out of bounds\");\n let mut vec: BoundedVec<T, MaxLen> = BoundedVec::new();\n vec.extend_from_array(array);\n vec\n }\n\n /// Pops the element at the end of the vector. This will decrease the length\n /// of the vector by one.\n ///\n /// Panics if the vector is empty.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 2> = BoundedVec::new();\n /// v.push(1);\n /// v.push(2);\n ///\n /// let two = v.pop();\n /// let one = v.pop();\n ///\n /// assert(two == 2);\n /// assert(one == 1);\n ///\n /// // error: cannot pop from an empty vector\n /// let _ = v.pop();\n /// ```\n pub fn pop(&mut self) -> T {\n assert(self.len > 0, \"cannot pop from an empty vector\");\n self.len -= 1;\n self.storage[self.len]\n }\n\n /// Returns true if the given predicate returns true for any element\n /// in this vector.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<u32, 3> = BoundedVec::new();\n /// v.extend_from_array([2, 4, 6]);\n ///\n /// let all_even = !v.any(|elem: u32| elem % 2 != 0);\n /// assert(all_even);\n /// ```\n pub fn any<Env>(self, predicate: fn[Env](T) -> bool) -> bool {\n let mut ret = false;\n if is_unconstrained() {\n for i in 0..self.len {\n ret |= predicate(self.storage[i]);\n }\n } else {\n let mut exceeded_len = false;\n for i in 0..MaxLen {\n exceeded_len |= i == self.len;\n if !exceeded_len {\n ret |= predicate(self.storage[i]);\n }\n }\n }\n ret\n }\n\n /// Creates a new vector of equal size by calling a closure on each element in this vector.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n /// let result = vec.map(|value| value * 2);\n ///\n /// let expected = BoundedVec::from_array([2, 4, 6, 8]);\n /// assert_eq(result, expected);\n /// ```\n pub fn map<U, Env>(&self, f: fn[Env](T) -> U) -> BoundedVec<U, MaxLen> {\n let mut ret = BoundedVec::new();\n ret.len = self.len();\n\n if is_unconstrained() {\n for i in 0..self.len() {\n ret.storage[i] = f(self.get_unchecked(i));\n }\n } else {\n for i in 0..MaxLen {\n ret.storage[i] = if i < self.len() {\n f(self.get_unchecked(i))\n } else {\n crate::mem::zeroed()\n }\n }\n }\n\n ret\n }\n\n /// Creates a new vector of equal size by calling a closure on each element\n /// in this vector, along with its index.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n /// let result = vec.mapi(|i, value| i + value * 2);\n ///\n /// let expected = BoundedVec::from_array([2, 5, 8, 11]);\n /// assert_eq(result, expected);\n /// ```\n pub fn mapi<U, Env>(&self, f: fn[Env](u32, T) -> U) -> BoundedVec<U, MaxLen> {\n let mut ret = BoundedVec::new();\n ret.len = self.len();\n\n if is_unconstrained() {\n for i in 0..self.len() {\n ret.storage[i] = f(i, self.get_unchecked(i));\n }\n } else {\n for i in 0..MaxLen {\n ret.storage[i] = if i < self.len() {\n f(i, self.get_unchecked(i))\n } else {\n crate::mem::zeroed()\n }\n }\n }\n\n ret\n }\n\n /// Calls a closure on each element in this vector.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n /// let mut result = BoundedVec::<u32, 4>::new();\n /// vec.for_each(|value| result.push(value * 2));\n ///\n /// let expected = BoundedVec::from_array([2, 4, 6, 8]);\n /// assert_eq(result, expected);\n /// ```\n pub fn for_each<Env>(&self, f: fn[Env](T) -> ()) {\n if is_unconstrained() {\n for i in 0..self.len() {\n f(self.get_unchecked(i));\n }\n } else {\n for i in 0..MaxLen {\n if i < self.len() {\n f(self.get_unchecked(i));\n }\n }\n }\n }\n\n /// Calls a closure on each element in this vector, along with its index.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n /// let mut result = BoundedVec::<u32, 4>::new();\n /// vec.for_eachi(|i, value| result.push(i + value * 2));\n ///\n /// let expected = BoundedVec::from_array([2, 5, 8, 11]);\n /// assert_eq(result, expected);\n /// ```\n pub fn for_eachi<Env>(&self, f: fn[Env](u32, T) -> ()) {\n if is_unconstrained() {\n for i in 0..self.len() {\n f(i, self.get_unchecked(i));\n }\n } else {\n for i in 0..MaxLen {\n if i < self.len() {\n f(i, self.get_unchecked(i));\n }\n }\n }\n }\n\n /// Creates a new BoundedVec from the given array and length.\n /// The given length must be less than or equal to the length of the array.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_parts([1, 2, 3, 0], 3);\n /// assert_eq(vec.len(), 3);\n /// ```\n pub fn from_parts(mut array: [T; MaxLen], len: u32) -> Self {\n assert(len <= MaxLen);\n BoundedVec { storage: array, len }\n }\n\n /// Creates a new BoundedVec from the given array and length.\n /// The given length must be less than or equal to the length of the array.\n ///\n /// This function is unsafe because it expects all elements past the `len` index\n /// of `array` to be zeroed, but does not check for this internally. Use `from_parts`\n /// for a safe version of this function which does zero out any indices past the\n /// given length. Invalidating this assumption can notably cause `BoundedVec::eq`\n /// to give incorrect results since it will check even elements past `len`.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 0], 3);\n /// assert_eq(vec.len(), 3);\n ///\n /// // invalid use!\n /// let vec1: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 1], 3);\n /// let vec2: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 2], 3);\n ///\n /// // both vecs have length 3 so we'd expect them to be equal, but this\n /// // fails because elements past the length are still checked in eq\n /// assert_eq(vec1, vec2); // fails\n /// ```\n #[deprecated(\"`BoundedVec::from_parts` no longer requires an extra loop, `BoundedVec::from_parts_unchecked` is no longer required\")]\n pub fn from_parts_unchecked(array: [T; MaxLen], len: u32) -> Self {\n assert(len <= MaxLen);\n BoundedVec { storage: array, len }\n }\n}\n\nimpl<T, let MaxLen: u32> Eq for BoundedVec<T, MaxLen>\nwhere\n T: Eq,\n{\n fn eq(self, other: BoundedVec<T, MaxLen>) -> bool {\n if self.len == other.len {\n if is_unconstrained() {\n // safety: we are already in an unconstrained context\n unsafe {\n unconstrained_eq(self, other)\n }\n } else {\n let mut eq = true;\n for i in 0..MaxLen {\n if i < self.len {\n eq &= self.storage[i] == other.storage[i];\n }\n }\n eq\n }\n } else {\n false\n }\n }\n}\n\n/// Returns true if both BoundedVecs are equal.\n/// Note: This assumes the lengths of both Vecs are already equal!\n/// This function is broken out of `impl Eq for BoundedVec` to make use of `break` in unconstrained code.\nunconstrained fn unconstrained_eq<T, let MaxLen: u32>(\n a: BoundedVec<T, MaxLen>,\n b: BoundedVec<T, MaxLen>,\n) -> bool\nwhere\n T: Eq,\n{\n let mut eq = true;\n for i in 0..a.len {\n if a.storage[i] != b.storage[i] {\n eq = false;\n break;\n }\n }\n eq\n}\n\nimpl<T, let MaxLen: u32, let Len: u32> From<[T; Len]> for BoundedVec<T, MaxLen> {\n fn from(array: [T; Len]) -> BoundedVec<T, MaxLen> {\n BoundedVec::from_array(array)\n }\n}\n\nmod bounded_vec_tests {\n\n mod get {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test(should_fail_with = \"Attempted to read past end of BoundedVec\")]\n fn panics_when_reading_elements_past_end_of_vec() {\n let vec: BoundedVec<Field, 5> = BoundedVec::new();\n\n let _ = vec.get(0);\n }\n\n #[test(should_fail_with = \"Attempted to read past end of BoundedVec\")]\n fn panics_when_reading_beyond_length() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n let _ = vec.get(3);\n }\n\n #[test]\n fn get_works_within_bounds() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(2), 3);\n assert_eq(vec.get(4), 5);\n }\n\n #[test]\n fn get_unchecked_works() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n assert_eq(vec.get_unchecked(0), 1);\n assert_eq(vec.get_unchecked(2), 3);\n }\n\n #[test]\n fn get_unchecked_works_past_len() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n assert_eq(vec.get_unchecked(4), 0);\n }\n }\n\n mod set {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn set_updates_values_properly() {\n let mut vec = BoundedVec::from_array([0, 0, 0, 0, 0]);\n\n vec.set(0, 42);\n assert_eq(vec.storage, [42, 0, 0, 0, 0]);\n\n vec.set(1, 43);\n assert_eq(vec.storage, [42, 43, 0, 0, 0]);\n\n vec.set(2, 44);\n assert_eq(vec.storage, [42, 43, 44, 0, 0]);\n\n vec.set(1, 10);\n assert_eq(vec.storage, [42, 10, 44, 0, 0]);\n\n vec.set(0, 0);\n assert_eq(vec.storage, [0, 10, 44, 0, 0]);\n }\n\n #[test(should_fail_with = \"Attempted to write past end of BoundedVec\")]\n fn panics_when_writing_elements_past_end_of_vec() {\n let mut vec: BoundedVec<Field, 5> = BoundedVec::new();\n vec.set(0, 42);\n }\n\n #[test(should_fail_with = \"Attempted to write past end of BoundedVec\")]\n fn panics_when_setting_beyond_length() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n vec.set(3, 4);\n }\n\n #[test]\n fn set_unchecked_operations() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.push(2);\n\n vec.set_unchecked(0, 10);\n assert_eq(vec.get(0), 10);\n }\n\n #[test(should_fail_with = \"Attempted to read past end of BoundedVec\")]\n fn set_unchecked_operations_past_len() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.push(2);\n\n vec.set_unchecked(3, 40);\n assert_eq(vec.get(3), 40);\n }\n\n #[test]\n fn set_preserves_other_elements() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n\n vec.set(2, 30);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(1), 2);\n assert_eq(vec.get(2), 30);\n assert_eq(vec.get(3), 4);\n assert_eq(vec.get(4), 5);\n }\n }\n\n mod any {\n use crate::collections::bounded_vec::BoundedVec;\n use crate::internal::test_unconstrained;\n\n #[test]\n #[test_unconstrained]\n fn returns_false_if_predicate_not_satisfied() {\n let vec: BoundedVec<bool, 4> = BoundedVec::from_array([false, false, false, false]);\n let result = vec.any(|value| value);\n\n assert(!result);\n }\n\n #[test]\n #[test_unconstrained]\n fn returns_true_if_predicate_satisfied() {\n let vec: BoundedVec<bool, 4> = BoundedVec::from_array([false, false, true, true]);\n let result = vec.any(|value| value);\n\n assert(result);\n }\n\n #[test]\n fn returns_false_on_empty_boundedvec() {\n let vec: BoundedVec<bool, 0> = BoundedVec::new();\n let result = vec.any(|value| value);\n\n assert(!result);\n }\n\n #[test]\n #[test_unconstrained]\n fn any_with_complex_predicates() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n\n assert(vec.any(|x| x > 3));\n assert(!vec.any(|x| x > 10));\n assert(vec.any(|x| x % 2 == 0)); // has a even number\n assert(vec.any(|x| x == 3)); // has a specific value\n }\n\n #[test]\n fn any_with_partial_vector() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.push(2);\n\n assert(vec.any(|x| x == 1));\n assert(vec.any(|x| x == 2));\n assert(!vec.any(|x| x == 3));\n }\n }\n\n mod map {\n use crate::collections::bounded_vec::BoundedVec;\n use crate::internal::test_unconstrained;\n\n #[test]\n #[test_unconstrained]\n fn applies_function_correctly() {\n // docs:start:bounded-vec-map-example\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.map(|value| value * 2);\n // docs:end:bounded-vec-map-example\n let expected = BoundedVec::from_array([2, 4, 6, 8]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn applies_function_that_changes_return_type() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.map(|value| (value * 2) as Field);\n let expected: BoundedVec<Field, 4> = BoundedVec::from_array([2, 4, 6, 8]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn does_not_apply_function_past_len() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([0, 1]);\n let result = vec.map(|value| if value == 0 { 5 } else { value });\n let expected = BoundedVec::from_array([5, 1]);\n\n assert_eq(result, expected);\n assert_eq(result.get_unchecked(2), 0);\n }\n\n #[test]\n fn map_with_conditional_logic() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n\n let result = vec.map(|x| if x % 2 == 0 { x * 2 } else { x });\n let expected = BoundedVec::from_array([1, 4, 3, 8]);\n assert_eq(result, expected);\n }\n\n #[test]\n fn map_preserves_length() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.map(|x| x * 2);\n\n assert_eq(result.len(), vec.len());\n assert_eq(result.max_len(), vec.max_len());\n }\n\n #[test]\n fn map_on_empty_vector() {\n let vec: BoundedVec<u32, 5> = BoundedVec::new();\n let result = vec.map(|x| x * 2);\n assert_eq(result, vec);\n assert_eq(result.len(), 0);\n assert_eq(result.max_len(), 5);\n }\n }\n\n mod mapi {\n use crate::collections::bounded_vec::BoundedVec;\n use crate::internal::test_unconstrained;\n\n #[test]\n #[test_unconstrained]\n fn applies_function_correctly() {\n // docs:start:bounded-vec-mapi-example\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.mapi(|i, value| i + value * 2);\n // docs:end:bounded-vec-mapi-example\n let expected = BoundedVec::from_array([2, 5, 8, 11]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn applies_function_that_changes_return_type() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.mapi(|i, value| (i + value * 2) as Field);\n let expected: BoundedVec<Field, 4> = BoundedVec::from_array([2, 5, 8, 11]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn does_not_apply_function_past_len() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([0, 1]);\n let result = vec.mapi(|_, value| if value == 0 { 5 } else { value });\n let expected = BoundedVec::from_array([5, 1]);\n\n assert_eq(result, expected);\n assert_eq(result.get_unchecked(2), 0);\n }\n\n #[test]\n fn mapi_with_index_branching_logic() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n\n let result = vec.mapi(|i, x| if i % 2 == 0 { x * 2 } else { x });\n let expected = BoundedVec::from_array([2, 2, 6, 4]);\n assert_eq(result, expected);\n }\n }\n\n mod for_each {\n use crate::collections::bounded_vec::BoundedVec;\n use crate::internal::test_unconstrained;\n\n // map in terms of for_each\n fn for_each_map<T, U, Env, let MaxLen: u32>(\n input: BoundedVec<T, MaxLen>,\n f: fn[Env](T) -> U,\n ) -> BoundedVec<U, MaxLen> {\n let mut output = BoundedVec::<U, MaxLen>::new();\n let output_ref = &mut output;\n input.for_each(|x| output_ref.push(f(x)));\n output\n }\n\n #[test]\n #[test_unconstrained]\n fn smoke_test() {\n let mut acc = 0;\n let acc_ref = &mut acc;\n // docs:start:bounded-vec-for-each-example\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n vec.for_each(|value| { *acc_ref += value; });\n // docs:end:bounded-vec-for-each-example\n assert_eq(acc, 6);\n }\n\n #[test]\n fn applies_function_correctly() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = for_each_map(vec, |value| value * 2);\n let expected = BoundedVec::from_array([2, 4, 6, 8]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn applies_function_that_changes_return_type() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = for_each_map(vec, |value| (value * 2) as Field);\n let expected: BoundedVec<Field, 4> = BoundedVec::from_array([2, 4, 6, 8]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn does_not_apply_function_past_len() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([0, 1]);\n let result = for_each_map(vec, |value| if value == 0 { 5 } else { value });\n let expected = BoundedVec::from_array([5, 1]);\n\n assert_eq(result, expected);\n assert_eq(result.get_unchecked(2), 0);\n }\n\n #[test]\n fn for_each_on_empty_vector() {\n let vec: BoundedVec<u32, 5> = BoundedVec::new();\n let mut count = 0;\n let count_ref = &mut count;\n vec.for_each(|_| { *count_ref += 1; });\n assert_eq(count, 0);\n }\n\n #[test]\n fn for_each_with_side_effects() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n let mut seen = BoundedVec::<u32, 3>::new();\n let seen_ref = &mut seen;\n vec.for_each(|x| seen_ref.push(x));\n assert_eq(seen, vec);\n }\n }\n\n mod for_eachi {\n use crate::collections::bounded_vec::BoundedVec;\n use crate::internal::test_unconstrained;\n\n // mapi in terms of for_eachi\n fn for_eachi_mapi<T, U, Env, let MaxLen: u32>(\n input: BoundedVec<T, MaxLen>,\n f: fn[Env](u32, T) -> U,\n ) -> BoundedVec<U, MaxLen> {\n let mut output = BoundedVec::<U, MaxLen>::new();\n let output_ref = &mut output;\n input.for_eachi(|i, x| output_ref.push(f(i, x)));\n output\n }\n\n #[test]\n #[test_unconstrained]\n fn smoke_test() {\n let mut acc = 0;\n let acc_ref = &mut acc;\n // docs:start:bounded-vec-for-eachi-example\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n vec.for_eachi(|i, value| { *acc_ref += i * value; });\n // docs:end:bounded-vec-for-eachi-example\n\n // 0 * 1 + 1 * 2 + 2 * 3\n assert_eq(acc, 8);\n }\n\n #[test]\n fn applies_function_correctly() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = for_eachi_mapi(vec, |i, value| i + value * 2);\n let expected = BoundedVec::from_array([2, 5, 8, 11]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn applies_function_that_changes_return_type() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = for_eachi_mapi(vec, |i, value| (i + value * 2) as Field);\n let expected: BoundedVec<Field, 4> = BoundedVec::from_array([2, 5, 8, 11]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn does_not_apply_function_past_len() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([0, 1]);\n let result = for_eachi_mapi(vec, |_, value| if value == 0 { 5 } else { value });\n let expected = BoundedVec::from_array([5, 1]);\n\n assert_eq(result, expected);\n assert_eq(result.get_unchecked(2), 0);\n }\n\n #[test]\n fn for_eachi_on_empty_vector() {\n let vec: BoundedVec<u32, 5> = BoundedVec::new();\n let mut count = 0;\n let count_ref = &mut count;\n vec.for_eachi(|_, _| { *count_ref += 1; });\n assert_eq(count, 0);\n }\n\n #[test]\n fn for_eachi_with_index_tracking() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([10, 20, 30]);\n let mut indices = BoundedVec::<u32, 3>::new();\n let indices_ref = &mut indices;\n vec.for_eachi(|i, _| indices_ref.push(i));\n\n let expected = BoundedVec::from_array([0, 1, 2]);\n assert_eq(indices, expected);\n }\n\n }\n\n mod from_array {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn empty() {\n let empty_array: [Field; 0] = [];\n let bounded_vec = BoundedVec::from_array([]);\n\n assert_eq(bounded_vec.max_len(), 0);\n assert_eq(bounded_vec.len(), 0);\n assert_eq(bounded_vec.storage(), empty_array);\n }\n\n #[test]\n fn equal_len() {\n let array = [1, 2, 3];\n let bounded_vec = BoundedVec::from_array(array);\n\n assert_eq(bounded_vec.max_len(), 3);\n assert_eq(bounded_vec.len(), 3);\n assert_eq(bounded_vec.storage(), array);\n }\n\n #[test]\n fn max_len_greater_then_array_len() {\n let array = [1, 2, 3];\n let bounded_vec: BoundedVec<Field, 10> = BoundedVec::from_array(array);\n\n assert_eq(bounded_vec.max_len(), 10);\n assert_eq(bounded_vec.len(), 3);\n assert_eq(bounded_vec.get(0), 1);\n assert_eq(bounded_vec.get(1), 2);\n assert_eq(bounded_vec.get(2), 3);\n }\n\n #[test(should_fail_with = \"from array out of bounds\")]\n fn max_len_lower_then_array_len() {\n let _: BoundedVec<Field, 2> = BoundedVec::from_array([0; 3]);\n }\n\n #[test]\n fn from_array_preserves_order() {\n let array = [5, 3, 1, 4, 2];\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array(array);\n for i in 0..array.len() {\n assert_eq(vec.get(i), array[i]);\n }\n }\n\n #[test]\n fn from_array_with_different_types() {\n let bool_array = [true, false, true];\n let bool_vec: BoundedVec<bool, 3> = BoundedVec::from_array(bool_array);\n assert_eq(bool_vec.len(), 3);\n assert_eq(bool_vec.get(0), true);\n assert_eq(bool_vec.get(1), false);\n }\n }\n\n mod trait_from {\n use crate::collections::bounded_vec::BoundedVec;\n use crate::convert::From;\n\n #[test]\n fn simple() {\n let array = [1, 2];\n let bounded_vec: BoundedVec<Field, 10> = BoundedVec::from(array);\n\n assert_eq(bounded_vec.max_len(), 10);\n assert_eq(bounded_vec.len(), 2);\n assert_eq(bounded_vec.get(0), 1);\n assert_eq(bounded_vec.get(1), 2);\n }\n }\n\n mod trait_eq {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn empty_equality() {\n let bounded_vec1: BoundedVec<Field, 3> = BoundedVec::new();\n let bounded_vec2: BoundedVec<Field, 3> = BoundedVec::new();\n\n assert_eq(bounded_vec1, bounded_vec2);\n }\n\n #[test]\n fn equality() {\n let mut bounded_vec1: BoundedVec<Field, 3> = BoundedVec::new();\n let mut bounded_vec2: BoundedVec<Field, 3> = BoundedVec::new();\n\n bounded_vec1.push(1);\n bounded_vec2.push(1);\n assert(bounded_vec1 == bounded_vec2);\n }\n\n #[test]\n fn inequality() {\n let mut bounded_vec1: BoundedVec<Field, 3> = BoundedVec::new();\n let mut bounded_vec2: BoundedVec<Field, 3> = BoundedVec::new();\n\n bounded_vec1.push(1);\n assert(bounded_vec1 != bounded_vec2);\n\n bounded_vec2.push(2);\n assert(bounded_vec1 != bounded_vec2);\n }\n }\n\n mod from_parts {\n use crate::collections::bounded_vec::BoundedVec;\n use crate::internal::test_unconstrained;\n\n #[test]\n #[test_unconstrained]\n fn from_parts() {\n // docs:start:from-parts\n let vec: BoundedVec<u32, 4> = BoundedVec::from_parts([1, 2, 3, 0], 3);\n assert_eq(vec.len(), 3);\n\n // Any elements past the given length are ignored, so these\n // two BoundedVecs will be completely equal\n let vec1: BoundedVec<u32, 4> = BoundedVec::from_parts([1, 2, 3, 1], 3);\n let vec2: BoundedVec<u32, 4> = BoundedVec::from_parts([1, 2, 3, 2], 3);\n assert_eq(vec1, vec2);\n // docs:end:from-parts\n }\n }\n\n mod push_pop {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn push_and_pop_operations() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n\n assert_eq(vec.len(), 0);\n\n vec.push(1);\n assert_eq(vec.len(), 1);\n assert_eq(vec.get(0), 1);\n\n vec.push(2);\n assert_eq(vec.len(), 2);\n assert_eq(vec.get(1), 2);\n\n let popped = vec.pop();\n assert_eq(popped, 2);\n assert_eq(vec.len(), 1);\n\n let popped2 = vec.pop();\n assert_eq(popped2, 1);\n assert_eq(vec.len(), 0);\n }\n\n #[test(should_fail_with = \"push out of bounds\")]\n fn push_to_full_vector() {\n let mut vec: BoundedVec<u32, 2> = BoundedVec::new();\n vec.push(1);\n vec.push(2);\n vec.push(3); // should panic\n }\n\n #[test(should_fail_with = \"cannot pop from an empty vector\")]\n fn pop_from_empty_vector() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n let _ = vec.pop(); // should panic\n }\n\n #[test]\n fn push_pop_cycle() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::new();\n\n // push to full\n vec.push(1);\n vec.push(2);\n vec.push(3);\n assert_eq(vec.len(), 3);\n\n // pop all\n assert_eq(vec.pop(), 3);\n assert_eq(vec.pop(), 2);\n assert_eq(vec.pop(), 1);\n assert_eq(vec.len(), 0);\n\n // push again\n vec.push(4);\n assert_eq(vec.len(), 1);\n assert_eq(vec.get(0), 4);\n }\n }\n\n mod extend {\n use crate::collections::bounded_vec::BoundedVec;\n use crate::internal::test_unconstrained;\n\n #[test]\n fn extend_from_array() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.extend_from_array([2, 3]);\n\n assert_eq(vec.len(), 3);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(1), 2);\n assert_eq(vec.get(2), 3);\n }\n\n #[test]\n fn extend_from_vector() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.extend_from_vector([2, 3].as_vector());\n\n assert_eq(vec.len(), 3);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(1), 2);\n assert_eq(vec.get(2), 3);\n }\n\n #[test]\n #[test_unconstrained]\n fn extend_from_bounded_vec() {\n // The source deliberately has a higher capacity,\n // to make sure we are not trying to assign out-of-bounds.\n let mut vec1: BoundedVec<u32, 5> = BoundedVec::new();\n let mut vec2: BoundedVec<u32, 9> = BoundedVec::new();\n\n vec1.push(1);\n vec2.push(2);\n vec2.push(3);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 3);\n assert_eq(vec1.get(0), 1);\n assert_eq(vec1.get(1), 2);\n assert_eq(vec1.get(2), 3);\n }\n\n #[test]\n fn extend_from_bounded_vec_limit() {\n // Capacity and contents chosen so the last item must be assigned to.\n let mut vec1: BoundedVec<u32, 2> = BoundedVec::new();\n let mut vec2: BoundedVec<u32, 5> = BoundedVec::new();\n\n vec1.push(1);\n vec2.push(2);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 2);\n assert_eq(vec1.get(0), 1);\n assert_eq(vec1.get(1), 2);\n }\n\n #[test]\n fn extend_from_bounded_vec_full_and_empty() {\n // Capacity and contents chosen so the last item must be assigned to.\n let mut vec1: BoundedVec<u32, 2> = BoundedVec::new();\n let vec2: BoundedVec<u32, 5> = BoundedVec::new();\n\n vec1.push(1);\n vec1.push(2);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 2);\n assert_eq(vec1.get(0), 1);\n assert_eq(vec1.get(1), 2);\n }\n\n #[test]\n fn extend_from_bounded_vec_zero_len() {\n let mut vec1: BoundedVec<u32, 0> = BoundedVec::new();\n let vec2: BoundedVec<u32, 0> = BoundedVec::new();\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 0);\n }\n\n #[test]\n fn extend_from_bounded_vec_last_zeroed() {\n let mut vec1: BoundedVec<u32, 4> = BoundedVec::new();\n let mut vec2: BoundedVec<u32, 4> = BoundedVec::new();\n\n vec1.push(1);\n vec1.push(2);\n vec2.push(3);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 3);\n assert_eq(vec1.get_unchecked(3), 0);\n }\n\n #[test]\n fn extend_from_bounded_vec_empty_self() {\n // self.len == 0 with Len > MaxLen: the loop doesn't reach\n // the last storage slot, so the fixup must write it.\n let mut vec1: BoundedVec<u32, 3> = BoundedVec::new();\n let vec2: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 3);\n assert_eq(vec1.get(0), 1);\n assert_eq(vec1.get(1), 2);\n assert_eq(vec1.get(2), 3);\n }\n\n #[test]\n fn extend_from_bounded_vec_equal_capacity() {\n // Len == MaxLen, fills to capacity.\n let mut vec1: BoundedVec<u32, 4> = BoundedVec::new();\n vec1.push(1);\n let vec2: BoundedVec<u32, 4> = BoundedVec::from_array([2, 3, 4]);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 4);\n assert_eq(vec1.get(0), 1);\n assert_eq(vec1.get(1), 2);\n assert_eq(vec1.get(2), 3);\n assert_eq(vec1.get(3), 4);\n }\n\n #[test(should_fail_with = \"extend_from_array out of bounds\")]\n fn extend_array_beyond_max_len() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::new();\n vec.push(1);\n vec.extend_from_array([2, 3, 4]); // should panic\n }\n\n #[test(should_fail_with = \"extend_from_vector out of bounds\")]\n fn extend_vector_beyond_max_len() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::new();\n vec.push(1);\n vec.extend_from_vector([2, 3, 4].as_vector()); // S]should panic\n }\n\n #[test(should_fail_with = \"extend_from_bounded_vec out of bounds\")]\n fn extend_bounded_vec_beyond_max_len() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::new();\n let other: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n vec.extend_from_bounded_vec(other); // should panic\n }\n\n #[test]\n fn extend_with_empty_collections() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n let original_len = vec.len();\n\n vec.extend_from_array([]);\n assert_eq(vec.len(), original_len);\n\n vec.extend_from_vector([].as_vector());\n assert_eq(vec.len(), original_len);\n\n let empty: BoundedVec<u32, 3> = BoundedVec::new();\n vec.extend_from_bounded_vec(empty);\n assert_eq(vec.len(), original_len);\n }\n }\n\n mod storage {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn storage_consistency() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n\n // test initial storage state\n assert_eq(vec.storage(), [0, 0, 0, 0, 0]);\n\n vec.push(1);\n vec.push(2);\n\n // test storage after modifications\n assert_eq(vec.storage(), [1, 2, 0, 0, 0]);\n\n // storage doesn't change length\n assert_eq(vec.len(), 2);\n assert_eq(vec.max_len(), 5);\n }\n\n #[test]\n fn storage_after_pop() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n\n let _ = vec.pop();\n // after pop, the last element should be unmodified\n assert_eq(vec.storage(), [1, 2, 3]);\n assert_eq(vec.len(), 2);\n }\n\n #[test]\n fn vector_immutable() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n let storage = vec.storage();\n\n assert_eq(storage, [1, 2, 3]);\n\n // Verify that the original vector is unchanged\n assert_eq(vec.len(), 3);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(1), 2);\n assert_eq(vec.get(2), 3);\n }\n }\n}\n",
134
134
  "path": "std/collections/bounded_vec.nr",
135
135
  "function_locations": [
136
136
  {
137
- "start": 2599,
137
+ "start": 2304,
138
138
  "name": "BoundedVec<T, MaxLen>::new"
139
139
  },
140
140
  {
141
- "start": 3202,
141
+ "start": 2907,
142
142
  "name": "BoundedVec<T, MaxLen>::get"
143
143
  },
144
144
  {
145
- "start": 4110,
145
+ "start": 3815,
146
146
  "name": "BoundedVec<T, MaxLen>::get_unchecked"
147
147
  },
148
148
  {
149
- "start": 4693,
149
+ "start": 4398,
150
150
  "name": "BoundedVec<T, MaxLen>::set"
151
151
  },
152
152
  {
153
- "start": 6221,
153
+ "start": 5926,
154
154
  "name": "BoundedVec<T, MaxLen>::set_unchecked"
155
155
  },
156
156
  {
157
- "start": 6759,
157
+ "start": 6464,
158
158
  "name": "BoundedVec<T, MaxLen>::push"
159
159
  },
160
160
  {
161
- "start": 7367,
161
+ "start": 7072,
162
162
  "name": "BoundedVec<T, MaxLen>::len"
163
163
  },
164
164
  {
165
- "start": 7808,
165
+ "start": 7513,
166
166
  "name": "BoundedVec<T, MaxLen>::max_len"
167
167
  },
168
168
  {
169
- "start": 8406,
169
+ "start": 8111,
170
170
  "name": "BoundedVec<T, MaxLen>::storage"
171
171
  },
172
172
  {
173
- "start": 8962,
173
+ "start": 8667,
174
174
  "name": "BoundedVec<T, MaxLen>::extend_from_array"
175
175
  },
176
176
  {
177
- "start": 9733,
177
+ "start": 9438,
178
178
  "name": "BoundedVec<T, MaxLen>::extend_from_vector"
179
179
  },
180
180
  {
181
- "start": 10678,
181
+ "start": 10383,
182
182
  "name": "BoundedVec<T, MaxLen>::extend_from_bounded_vec"
183
183
  },
184
184
  {
185
- "start": 13073,
185
+ "start": 12778,
186
186
  "name": "BoundedVec<T, MaxLen>::from_array"
187
187
  },
188
188
  {
189
- "start": 13816,
189
+ "start": 13521,
190
190
  "name": "BoundedVec<T, MaxLen>::pop"
191
191
  },
192
192
  {
193
- "start": 14439,
193
+ "start": 14063,
194
194
  "name": "BoundedVec<T, MaxLen>::any"
195
195
  },
196
196
  {
197
- "start": 15355,
197
+ "start": 14979,
198
198
  "name": "BoundedVec<T, MaxLen>::map"
199
199
  },
200
200
  {
201
- "start": 16355,
201
+ "start": 15979,
202
202
  "name": "BoundedVec<T, MaxLen>::mapi"
203
203
  },
204
204
  {
205
- "start": 17313,
205
+ "start": 16937,
206
206
  "name": "BoundedVec<T, MaxLen>::for_each"
207
207
  },
208
208
  {
209
- "start": 18118,
209
+ "start": 17742,
210
210
  "name": "BoundedVec<T, MaxLen>::for_eachi"
211
211
  },
212
212
  {
213
- "start": 19117,
213
+ "start": 18439,
214
214
  "name": "BoundedVec<T, MaxLen>::from_parts"
215
215
  },
216
216
  {
217
- "start": 20766,
217
+ "start": 19903,
218
218
  "name": "BoundedVec<T, MaxLen>::from_parts_unchecked"
219
219
  },
220
220
  {
221
- "start": 20978,
221
+ "start": 20115,
222
222
  "name": "<impl Eq for BoundedVec<T, MaxLen>>::eq"
223
223
  },
224
224
  {
225
- "start": 21549,
225
+ "start": 21039,
226
+ "name": "unconstrained_eq"
227
+ },
228
+ {
229
+ "start": 21335,
226
230
  "name": "<impl From<[T; Len]> for BoundedVec<T, MaxLen>>::from"
227
231
  },
228
232
  {
229
- "start": 21832,
233
+ "start": 21618,
230
234
  "name": "bounded_vec_tests::get::panics_when_reading_elements_past_end_of_vec"
231
235
  },
232
236
  {
233
- "start": 22067,
237
+ "start": 21853,
234
238
  "name": "bounded_vec_tests::get::panics_when_reading_beyond_length"
235
239
  },
236
240
  {
237
- "start": 22242,
241
+ "start": 22028,
238
242
  "name": "bounded_vec_tests::get::get_works_within_bounds"
239
243
  },
240
244
  {
241
- "start": 22501,
245
+ "start": 22287,
242
246
  "name": "bounded_vec_tests::get::get_unchecked_works"
243
247
  },
244
248
  {
245
- "start": 22745,
249
+ "start": 22531,
246
250
  "name": "bounded_vec_tests::get::get_unchecked_works_past_len"
247
251
  },
248
252
  {
249
- "start": 23018,
253
+ "start": 22804,
250
254
  "name": "bounded_vec_tests::set::set_updates_values_properly"
251
255
  },
252
256
  {
253
- "start": 23656,
257
+ "start": 23442,
254
258
  "name": "bounded_vec_tests::set::panics_when_writing_elements_past_end_of_vec"
255
259
  },
256
260
  {
257
- "start": 23891,
261
+ "start": 23677,
258
262
  "name": "bounded_vec_tests::set::panics_when_setting_beyond_length"
259
263
  },
260
264
  {
261
- "start": 24066,
265
+ "start": 23852,
262
266
  "name": "bounded_vec_tests::set::set_unchecked_operations"
263
267
  },
264
268
  {
265
- "start": 24398,
269
+ "start": 24184,
266
270
  "name": "bounded_vec_tests::set::set_unchecked_operations_past_len"
267
271
  },
268
272
  {
269
- "start": 24662,
273
+ "start": 24448,
270
274
  "name": "bounded_vec_tests::set::set_preserves_other_elements"
271
275
  },
272
276
  {
273
- "start": 25130,
277
+ "start": 24995,
274
278
  "name": "bounded_vec_tests::any::returns_false_if_predicate_not_satisfied"
275
279
  },
276
280
  {
277
- "start": 25384,
281
+ "start": 25279,
278
282
  "name": "bounded_vec_tests::any::returns_true_if_predicate_satisfied"
279
283
  },
280
284
  {
281
- "start": 25633,
285
+ "start": 25528,
282
286
  "name": "bounded_vec_tests::any::returns_false_on_empty_boundedvec"
283
287
  },
284
288
  {
285
- "start": 25844,
289
+ "start": 25769,
286
290
  "name": "bounded_vec_tests::any::any_with_complex_predicates"
287
291
  },
288
292
  {
289
- "start": 26207,
293
+ "start": 26132,
290
294
  "name": "bounded_vec_tests::any::any_with_partial_vector"
291
295
  },
292
296
  {
293
- "start": 26594,
297
+ "start": 26598,
294
298
  "name": "bounded_vec_tests::map::applies_function_correctly"
295
299
  },
296
300
  {
297
- "start": 27016,
301
+ "start": 27020,
298
302
  "name": "bounded_vec_tests::map::applies_function_that_changes_return_type"
299
303
  },
300
304
  {
301
- "start": 27364,
305
+ "start": 27368,
302
306
  "name": "bounded_vec_tests::map::does_not_apply_function_past_len"
303
307
  },
304
308
  {
305
- "start": 27737,
309
+ "start": 27741,
306
310
  "name": "bounded_vec_tests::map::map_with_conditional_logic"
307
311
  },
308
312
  {
309
- "start": 28061,
313
+ "start": 28065,
310
314
  "name": "bounded_vec_tests::map::map_preserves_length"
311
315
  },
312
316
  {
313
- "start": 28353,
317
+ "start": 28357,
314
318
  "name": "bounded_vec_tests::map::map_on_empty_vector"
315
319
  },
316
320
  {
317
- "start": 28727,
321
+ "start": 28810,
318
322
  "name": "bounded_vec_tests::mapi::applies_function_correctly"
319
323
  },
320
324
  {
321
- "start": 29160,
325
+ "start": 29243,
322
326
  "name": "bounded_vec_tests::mapi::applies_function_that_changes_return_type"
323
327
  },
324
328
  {
325
- "start": 29517,
329
+ "start": 29600,
326
330
  "name": "bounded_vec_tests::mapi::does_not_apply_function_past_len"
327
331
  },
328
332
  {
329
- "start": 29899,
333
+ "start": 29982,
330
334
  "name": "bounded_vec_tests::mapi::mapi_with_index_branching_logic"
331
335
  },
332
336
  {
333
- "start": 30458,
337
+ "start": 30590,
334
338
  "name": "bounded_vec_tests::for_each::for_each_map"
335
339
  },
336
340
  {
337
- "start": 30688,
341
+ "start": 30850,
338
342
  "name": "bounded_vec_tests::for_each::smoke_test"
339
343
  },
340
344
  {
341
- "start": 31096,
345
+ "start": 31258,
342
346
  "name": "bounded_vec_tests::for_each::applies_function_correctly"
343
347
  },
344
348
  {
345
- "start": 31430,
349
+ "start": 31592,
346
350
  "name": "bounded_vec_tests::for_each::applies_function_that_changes_return_type"
347
351
  },
348
352
  {
349
- "start": 31788,
353
+ "start": 31950,
350
354
  "name": "bounded_vec_tests::for_each::does_not_apply_function_past_len"
351
355
  },
352
356
  {
353
- "start": 32169,
357
+ "start": 32331,
354
358
  "name": "bounded_vec_tests::for_each::for_each_on_empty_vector"
355
359
  },
356
360
  {
357
- "start": 32455,
361
+ "start": 32617,
358
362
  "name": "bounded_vec_tests::for_each::for_each_with_side_effects"
359
363
  },
360
364
  {
361
- "start": 33012,
365
+ "start": 33223,
362
366
  "name": "bounded_vec_tests::for_eachi::for_eachi_mapi"
363
367
  },
364
368
  {
365
- "start": 33249,
369
+ "start": 33490,
366
370
  "name": "bounded_vec_tests::for_eachi::smoke_test"
367
371
  },
368
372
  {
369
- "start": 33705,
373
+ "start": 33946,
370
374
  "name": "bounded_vec_tests::for_eachi::applies_function_correctly"
371
375
  },
372
376
  {
373
- "start": 34049,
377
+ "start": 34290,
374
378
  "name": "bounded_vec_tests::for_eachi::applies_function_that_changes_return_type"
375
379
  },
376
380
  {
377
- "start": 34417,
381
+ "start": 34658,
378
382
  "name": "bounded_vec_tests::for_eachi::does_not_apply_function_past_len"
379
383
  },
380
384
  {
381
- "start": 34804,
385
+ "start": 35045,
382
386
  "name": "bounded_vec_tests::for_eachi::for_eachi_on_empty_vector"
383
387
  },
384
388
  {
385
- "start": 35097,
389
+ "start": 35338,
386
390
  "name": "bounded_vec_tests::for_eachi::for_eachi_with_index_tracking"
387
391
  },
388
392
  {
389
- "start": 35574,
393
+ "start": 35815,
390
394
  "name": "bounded_vec_tests::from_array::empty"
391
395
  },
392
396
  {
393
- "start": 35884,
397
+ "start": 36125,
394
398
  "name": "bounded_vec_tests::from_array::equal_len"
395
399
  },
396
400
  {
397
- "start": 36201,
401
+ "start": 36442,
398
402
  "name": "bounded_vec_tests::from_array::max_len_greater_then_array_len"
399
403
  },
400
404
  {
401
- "start": 36672,
405
+ "start": 36913,
402
406
  "name": "bounded_vec_tests::from_array::max_len_lower_then_array_len"
403
407
  },
404
408
  {
405
- "start": 36815,
409
+ "start": 37056,
406
410
  "name": "bounded_vec_tests::from_array::from_array_preserves_order"
407
411
  },
408
412
  {
409
- "start": 37104,
413
+ "start": 37345,
410
414
  "name": "bounded_vec_tests::from_array::from_array_with_different_types"
411
415
  },
412
416
  {
413
- "start": 37541,
417
+ "start": 37782,
414
418
  "name": "bounded_vec_tests::trait_from::simple"
415
419
  },
416
420
  {
417
- "start": 37979,
421
+ "start": 38220,
418
422
  "name": "bounded_vec_tests::trait_eq::empty_equality"
419
423
  },
420
424
  {
421
- "start": 38228,
422
- "name": "bounded_vec_tests::trait_eq::inequality"
425
+ "start": 38467,
426
+ "name": "bounded_vec_tests::trait_eq::equality"
423
427
  },
424
428
  {
425
- "start": 38637,
426
- "name": "bounded_vec_tests::from_parts::from_parts"
429
+ "start": 38791,
430
+ "name": "bounded_vec_tests::trait_eq::inequality"
427
431
  },
428
432
  {
429
- "start": 39227,
430
- "name": "bounded_vec_tests::from_parts::from_parts_unchecked"
433
+ "start": 39330,
434
+ "name": "bounded_vec_tests::from_parts::from_parts"
431
435
  },
432
436
  {
433
- "start": 40009,
437
+ "start": 40003,
434
438
  "name": "bounded_vec_tests::push_pop::push_and_pop_operations"
435
439
  },
436
440
  {
437
- "start": 40635,
441
+ "start": 40629,
438
442
  "name": "bounded_vec_tests::push_pop::push_to_full_vector"
439
443
  },
440
444
  {
441
- "start": 40909,
445
+ "start": 40903,
442
446
  "name": "bounded_vec_tests::push_pop::pop_from_empty_vector"
443
447
  },
444
448
  {
445
- "start": 41078,
449
+ "start": 41072,
446
450
  "name": "bounded_vec_tests::push_pop::push_pop_cycle"
447
451
  },
448
452
  {
449
- "start": 41724,
453
+ "start": 41767,
450
454
  "name": "bounded_vec_tests::extend::extend_from_array"
451
455
  },
452
456
  {
453
- "start": 42070,
457
+ "start": 42113,
454
458
  "name": "bounded_vec_tests::extend::extend_from_vector"
455
459
  },
456
460
  {
457
- "start": 42434,
461
+ "start": 42507,
458
462
  "name": "bounded_vec_tests::extend::extend_from_bounded_vec"
459
463
  },
460
464
  {
461
- "start": 43055,
465
+ "start": 43128,
462
466
  "name": "bounded_vec_tests::extend::extend_from_bounded_vec_limit"
463
467
  },
464
468
  {
465
- "start": 43569,
469
+ "start": 43642,
466
470
  "name": "bounded_vec_tests::extend::extend_from_bounded_vec_full_and_empty"
467
471
  },
468
472
  {
469
- "start": 44073,
473
+ "start": 44146,
470
474
  "name": "bounded_vec_tests::extend::extend_from_bounded_vec_zero_len"
471
475
  },
472
476
  {
473
- "start": 44367,
477
+ "start": 44440,
474
478
  "name": "bounded_vec_tests::extend::extend_from_bounded_vec_last_zeroed"
475
479
  },
476
480
  {
477
- "start": 44792,
481
+ "start": 44865,
478
482
  "name": "bounded_vec_tests::extend::extend_from_bounded_vec_empty_self"
479
483
  },
480
484
  {
481
- "start": 45359,
485
+ "start": 45432,
482
486
  "name": "bounded_vec_tests::extend::extend_from_bounded_vec_equal_capacity"
483
487
  },
484
488
  {
485
- "start": 45946,
489
+ "start": 46019,
486
490
  "name": "bounded_vec_tests::extend::extend_array_beyond_max_len"
487
491
  },
488
492
  {
489
- "start": 46224,
493
+ "start": 46297,
490
494
  "name": "bounded_vec_tests::extend::extend_vector_beyond_max_len"
491
495
  },
492
496
  {
493
- "start": 46527,
497
+ "start": 46600,
494
498
  "name": "bounded_vec_tests::extend::extend_bounded_vec_beyond_max_len"
495
499
  },
496
500
  {
497
- "start": 46813,
501
+ "start": 46886,
498
502
  "name": "bounded_vec_tests::extend::extend_with_empty_collections"
499
503
  },
500
504
  {
501
- "start": 47413,
505
+ "start": 47486,
502
506
  "name": "bounded_vec_tests::storage::storage_consistency"
503
507
  },
504
508
  {
505
- "start": 47915,
509
+ "start": 47988,
506
510
  "name": "bounded_vec_tests::storage::storage_after_pop"
507
511
  },
508
512
  {
509
- "start": 48233,
513
+ "start": 48310,
510
514
  "name": "bounded_vec_tests::storage::vector_immutable"
511
515
  }
512
516
  ]
513
517
  },
514
- "20": {
515
- "source": "pub mod hash;\npub mod aes128;\npub mod array;\npub mod vector;\npub mod ecdsa_secp256k1;\npub mod ecdsa_secp256r1;\npub mod embedded_curve_ops;\npub mod field;\npub mod collections;\npub mod compat;\npub mod convert;\npub mod option;\npub mod string;\npub mod test;\npub mod cmp;\npub mod ops;\npub mod default;\npub mod prelude;\npub mod runtime;\npub mod meta;\npub mod append;\npub mod mem;\npub mod panic;\npub mod hint;\n\nmod primitive_docs;\n\n// Oracle calls are required to be wrapped in an unconstrained function\n// Thus, the only argument to the `println` oracle is expected to always be an ident\n#[oracle(print)]\nunconstrained fn print_oracle<T>(with_newline: bool, input: T) {}\n\nunconstrained fn print_unconstrained<T>(with_newline: bool, input: T) {\n print_oracle(with_newline, input);\n}\n\n/// Print the given input to stdout followed by a newline\npub fn println<T>(input: T) {\n // Safety: a print statement cannot be constrained\n unsafe {\n print_unconstrained(true, input);\n }\n}\n\n/// Print the given input to stdout\npub fn print<T>(input: T) {\n // Safety: a print statement cannot be constrained\n unsafe {\n print_unconstrained(false, input);\n }\n}\n\n/// Asserts the validity of the provided proof and public inputs against the provided verification key and hash.\n///\n/// The ACVM cannot determine whether the provided proof is valid during execution as this requires knowledge of\n/// the backend against which the program is being proven. However if an invalid proof if submitted, the program may\n/// fail to prove or the backend may generate a proof which will subsequently fail to verify.\n///\n/// # Important Note\n///\n/// If you are not developing your own backend such as [Barretenberg](https://github.com/AztecProtocol/barretenberg)\n/// you probably shouldn't need to interact with this function directly. It's easier and safer to use a verification\n/// library which is published by the developers of the backend which will document or enforce any safety requirements.\n///\n/// If you use this directly, you're liable to introduce underconstrainedness bugs and *your circuit will be insecure*.\n///\n/// # Arguments\n/// - verification_key: The verification key of the circuit to be verified.\n/// - proof: The proof to be verified.\n/// - public_inputs: The public inputs associated with `proof`\n/// - key_hash: The hash of `verification_key` of the form expected by the backend.\n/// - proof_type: An identifier for the proving scheme used to generate the proof to be verified. This allows\n/// for a single backend to support verifying multiple proving schemes.\n///\n/// # Constraining `key_hash`\n///\n/// The Noir compiler does not by itself constrain that `key_hash` is a valid hash of `verification_key`.\n/// This is because different backends may differ in how they hash their verification keys.\n/// It is then the responsibility of either the noir developer (by explicitly hashing the verification key\n/// in the correct manner) or by the proving system itself internally asserting the correctness of `key_hash`.\npub fn verify_proof_with_type<let N: u32, let M: u32, let K: u32>(\n verification_key: [Field; N],\n proof: [Field; M],\n public_inputs: [Field; K],\n key_hash: Field,\n proof_type: u32,\n) {\n if !crate::runtime::is_unconstrained() {\n crate::assert_constant(proof_type);\n }\n verify_proof_internal(verification_key, proof, public_inputs, key_hash, proof_type);\n}\n\n#[foreign(recursive_aggregation)]\nfn verify_proof_internal<let N: u32, let M: u32, let K: u32>(\n verification_key: [Field; N],\n proof: [Field; M],\n public_inputs: [Field; K],\n key_hash: Field,\n proof_type: u32,\n) {}\n\n/// Asserts that the given value is known at compile-time.\n/// Useful for debugging for-loop bounds.\n#[builtin(assert_constant)]\npub fn assert_constant<T>(x: T) {}\n\n/// Asserts that the given value is both true and known at compile-time.\n/// The message can be a string, a format string, or any value, as long as it is known at compile-time\n#[builtin(static_assert)]\npub fn static_assert<T>(predicate: bool, message: T) {}\n\n/// Force a field value to be a witness instead of a constant in the compiled output.\n/// This is often only useful for debugging compiler optimizations.\n///\n/// This has no effect in unconstrained or comptime code.\n#[builtin(as_witness)]\npub fn as_witness(x: Field) {}\n",
518
+ "21": {
519
+ "source": "pub mod hash;\npub mod aes128;\npub mod array;\npub mod vector;\npub mod ecdsa_secp256k1;\npub mod ecdsa_secp256r1;\npub mod embedded_curve_ops;\npub mod field;\npub mod collections;\npub mod compat;\npub mod convert;\npub mod option;\npub mod string;\npub mod test;\npub mod cmp;\npub mod ops;\npub mod default;\npub mod prelude;\npub mod runtime;\npub mod meta;\npub mod append;\npub mod mem;\npub mod panic;\npub mod hint;\n\nmod primitive_docs;\nmod internal;\n\n// Oracle calls are required to be wrapped in an unconstrained function\n// Thus, the only argument to the `println` oracle is expected to always be an ident\n#[oracle(print)]\nunconstrained fn print_oracle<T>(with_newline: bool, input: T) {}\n\nunconstrained fn print_unconstrained<T>(with_newline: bool, input: T) {\n print_oracle(with_newline, input);\n}\n\n/// Print the given input to stdout followed by a newline\npub fn println<T>(input: T) {\n // Safety: a print statement cannot be constrained\n unsafe {\n print_unconstrained(true, input);\n }\n}\n\n/// Print the given input to stdout\npub fn print<T>(input: T) {\n // Safety: a print statement cannot be constrained\n unsafe {\n print_unconstrained(false, input);\n }\n}\n\n/// Asserts the validity of the provided proof and public inputs against the provided verification key and hash.\n///\n/// The ACVM cannot determine whether the provided proof is valid during execution as this requires knowledge of\n/// the backend against which the program is being proven. However if an invalid proof if submitted, the program may\n/// fail to prove or the backend may generate a proof which will subsequently fail to verify.\n///\n/// # Important Note\n///\n/// If you are not developing your own backend such as [Barretenberg](https://github.com/AztecProtocol/barretenberg)\n/// you probably shouldn't need to interact with this function directly. It's easier and safer to use a verification\n/// library which is published by the developers of the backend which will document or enforce any safety requirements.\n///\n/// If you use this directly, you're liable to introduce underconstrainedness bugs and *your circuit will be insecure*.\n///\n/// # Arguments\n/// - verification_key: The verification key of the circuit to be verified.\n/// - proof: The proof to be verified.\n/// - public_inputs: The public inputs associated with `proof`\n/// - key_hash: The hash of `verification_key` of the form expected by the backend.\n/// - proof_type: An identifier for the proving scheme used to generate the proof to be verified. This allows\n/// for a single backend to support verifying multiple proving schemes.\n///\n/// # Constraining `key_hash`\n///\n/// The Noir compiler does not by itself constrain that `key_hash` is a valid hash of `verification_key`.\n/// This is because different backends may differ in how they hash their verification keys.\n/// It is then the responsibility of either the noir developer (by explicitly hashing the verification key\n/// in the correct manner) or by the proving system itself internally asserting the correctness of `key_hash`.\npub fn verify_proof_with_type<let N: u32, let M: u32, let K: u32>(\n verification_key: [Field; N],\n proof: [Field; M],\n public_inputs: [Field; K],\n key_hash: Field,\n proof_type: u32,\n) {\n if !crate::runtime::is_unconstrained() {\n crate::assert_constant(proof_type);\n }\n verify_proof_internal(verification_key, proof, public_inputs, key_hash, proof_type);\n}\n\n#[foreign(recursive_aggregation)]\nfn verify_proof_internal<let N: u32, let M: u32, let K: u32>(\n verification_key: [Field; N],\n proof: [Field; M],\n public_inputs: [Field; K],\n key_hash: Field,\n proof_type: u32,\n) {}\n\n/// Asserts that the given value is known at compile-time.\n/// Useful for debugging for-loop bounds.\n#[builtin(assert_constant)]\npub fn assert_constant<T>(x: T) {}\n\n/// Asserts that the given value is both true and known at compile-time.\n/// The message can be a string, a format string, or any value, as long as it is known at compile-time\n#[builtin(static_assert)]\npub fn static_assert<T>(predicate: bool, message: T) {}\n\n/// Force a field value to be a witness instead of a constant in the compiled output.\n/// This is often only useful for debugging compiler optimizations.\n///\n/// This has no effect in unconstrained or comptime code.\n#[builtin(as_witness)]\npub fn as_witness(x: Field) {}\n",
516
520
  "path": "std/lib.nr",
517
521
  "function_locations": [
518
522
  {
519
- "start": 662,
523
+ "start": 676,
520
524
  "name": "print_oracle"
521
525
  },
522
526
  {
523
- "start": 736,
527
+ "start": 750,
524
528
  "name": "print_unconstrained"
525
529
  },
526
530
  {
527
- "start": 866,
531
+ "start": 880,
528
532
  "name": "println"
529
533
  },
530
534
  {
531
- "start": 1049,
535
+ "start": 1063,
532
536
  "name": "print"
533
537
  },
534
538
  {
535
- "start": 3250,
539
+ "start": 3264,
536
540
  "name": "verify_proof_with_type"
537
541
  },
538
542
  {
539
- "start": 3667,
543
+ "start": 3681,
540
544
  "name": "verify_proof_internal"
541
545
  },
542
546
  {
543
- "start": 3832,
547
+ "start": 3846,
544
548
  "name": "assert_constant"
545
549
  },
546
550
  {
547
- "start": 4091,
551
+ "start": 4105,
548
552
  "name": "static_assert"
549
553
  },
550
554
  {
551
- "start": 4362,
555
+ "start": 4376,
552
556
  "name": "as_witness"
553
557
  }
554
558
  ]
555
559
  },
556
- "49": {
560
+ "51": {
557
561
  "source": "use mock_types::{\n AppPublicInputs, MEGA_VK_LENGTH_IN_FIELDS, PrivateKernelPublicInputs,\n PrivateKernelPublicInputsBuilder, PROOF_TYPE_OINK, TxRequest, VerificationKey,\n};\n\nfn main(\n tx: TxRequest,\n app_inputs: call_data(1) AppPublicInputs,\n app_vk: VerificationKey<MEGA_VK_LENGTH_IN_FIELDS>,\n) -> return_data PrivateKernelPublicInputs {\n std::verify_proof_with_type(app_vk.key, [], [], app_vk.hash, PROOF_TYPE_OINK);\n\n let mut private_kernel_inputs = PrivateKernelPublicInputsBuilder::from_tx(tx);\n private_kernel_inputs.ingest_app_inputs(app_inputs);\n private_kernel_inputs.finish()\n}\n",
558
- "path": "/home/mitch/aztec-clones/alpha/noir-projects/mock-protocol-circuits/crates/mock-private-kernel-init/src/main.nr",
562
+ "path": "/home/aztec-dev/aztec-packages-private/noir-projects/mock-protocol-circuits/crates/mock-private-kernel-init/src/main.nr",
559
563
  "function_locations": [
560
564
  {
561
565
  "start": 351,
@@ -563,177 +567,107 @@
563
567
  }
564
568
  ]
565
569
  },
566
- "50": {
567
- "source": "pub global MAX_COMMITMENTS_PER_CALL: u32 = 2;\npub global MAX_COMMITMENTS_PER_TX: u32 = 4;\npub global MAX_COMMITMENT_READ_REQUESTS_PER_CALL: u32 = 2;\npub global MAX_COMMITMENT_READ_REQUESTS_PER_TX: u32 = 4;\n\npub use protocol_types::{\n abis::avm_circuit_public_inputs::AvmCircuitPublicInputs,\n constants::{\n AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED, AVM_V2_VERIFICATION_KEY_LENGTH_IN_FIELDS_PADDED,\n CHONK_PROOF_LENGTH, CHONK_VK_LENGTH_IN_FIELDS, MEGA_VK_LENGTH_IN_FIELDS,\n NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, PROOF_TYPE_AVM, PROOF_TYPE_CHONK, PROOF_TYPE_HN,\n PROOF_TYPE_HN_FINAL, PROOF_TYPE_HN_TAIL, PROOF_TYPE_OINK, PROOF_TYPE_ROLLUP_HONK,\n PROOF_TYPE_ROOT_ROLLUP_HONK,\n },\n proof::{\n traits::SerializeToColumns,\n verification_key::{RollupHonkVerificationKey, VerificationKey},\n },\n traits::Serialize,\n};\n\npub struct TxRequest {\n pub number_of_calls: u32,\n}\n\npub struct AppPublicInputs {\n pub commitments: [Field; MAX_COMMITMENTS_PER_CALL],\n pub read_requests: [Field; MAX_COMMITMENT_READ_REQUESTS_PER_CALL],\n}\n\nimpl Default for AppPublicInputs {\n fn default() -> Self {\n Self {\n commitments: [0; MAX_COMMITMENTS_PER_CALL],\n read_requests: [0; MAX_COMMITMENT_READ_REQUESTS_PER_CALL],\n }\n }\n}\n\npub struct PrivateKernelPublicInputs {\n pub remaining_calls: u32,\n pub commitments: [Field; MAX_COMMITMENTS_PER_TX],\n pub read_requests: [Field; MAX_COMMITMENT_READ_REQUESTS_PER_TX],\n}\n\nimpl Default for PrivateKernelPublicInputs {\n fn default() -> Self {\n Self {\n remaining_calls: 0,\n commitments: [0; MAX_COMMITMENTS_PER_TX],\n read_requests: [0; MAX_COMMITMENT_READ_REQUESTS_PER_TX],\n }\n }\n}\n\npub struct PrivateKernelPublicInputsBuilder {\n pub remaining_calls: u32,\n pub commitments: BoundedVec<Field, MAX_COMMITMENTS_PER_TX>,\n pub read_requests: BoundedVec<Field, MAX_COMMITMENT_READ_REQUESTS_PER_TX>,\n}\n\nimpl PrivateKernelPublicInputsBuilder {\n pub fn from_tx(tx: TxRequest) -> Self {\n Self {\n remaining_calls: tx.number_of_calls,\n commitments: BoundedVec::new(),\n read_requests: BoundedVec::new(),\n }\n }\n\n pub fn from_previous_kernel(prev_kernel_public_inputs: PrivateKernelPublicInputs) -> Self {\n let mut builder = PrivateKernelPublicInputsBuilder {\n remaining_calls: prev_kernel_public_inputs.remaining_calls,\n commitments: BoundedVec::new(),\n read_requests: BoundedVec::new(),\n };\n for i in 0..MAX_COMMITMENTS_PER_TX {\n if prev_kernel_public_inputs.commitments[i] != 0 {\n builder.commitments.push(prev_kernel_public_inputs.commitments[i]);\n }\n }\n for i in 0..MAX_COMMITMENT_READ_REQUESTS_PER_TX {\n if prev_kernel_public_inputs.read_requests[i] != 0 {\n builder.read_requests.push(prev_kernel_public_inputs.read_requests[i]);\n }\n }\n builder\n }\n\n pub fn ingest_app_inputs(&mut self, app_inputs: AppPublicInputs) {\n for i in 0..MAX_COMMITMENTS_PER_CALL {\n if app_inputs.commitments[i] != 0 {\n self.commitments.push(app_inputs.commitments[i]);\n }\n }\n\n for i in 0..MAX_COMMITMENT_READ_REQUESTS_PER_CALL {\n if app_inputs.read_requests[i] != 0 {\n self.read_requests.push(app_inputs.read_requests[i]);\n }\n }\n\n self.remaining_calls -= 1;\n }\n\n pub fn finish(self) -> PrivateKernelPublicInputs {\n PrivateKernelPublicInputs {\n remaining_calls: self.remaining_calls,\n commitments: self.commitments.storage(),\n read_requests: self.read_requests.storage(),\n }\n }\n}\n\n#[derive(Serialize)]\npub struct KernelPublicInputs {\n pub commitments: [Field; MAX_COMMITMENTS_PER_TX],\n}\n\nimpl Default for KernelPublicInputs {\n fn default() -> Self {\n Self { commitments: [0; MAX_COMMITMENTS_PER_TX] }\n }\n}\n\n#[derive(Serialize)]\npub struct RollupPublicInputs {\n accumulated: u32,\n}\n\nimpl RollupPublicInputs {\n pub fn new(accumulated: u32) -> Self {\n Self { accumulated }\n }\n\n pub fn merge(self, other: Self) -> Self {\n Self { accumulated: self.accumulated + other.accumulated }\n }\n}\n\npub struct PreviousRollupData {\n base_or_merge_public_inputs: RollupPublicInputs,\n proof: [Field; NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH],\n vk: RollupHonkVerificationKey,\n}\n\nimpl PreviousRollupData {\n pub fn verify(self, is_root: bool) {\n let inputs = self.base_or_merge_public_inputs.serialize();\n\n std::verify_proof_with_type(\n self.vk.key,\n self.proof,\n inputs,\n self.vk.hash,\n if is_root {\n PROOF_TYPE_ROOT_ROLLUP_HONK\n } else {\n PROOF_TYPE_ROLLUP_HONK\n },\n );\n }\n\n pub fn public_inputs(self) -> RollupPublicInputs {\n self.base_or_merge_public_inputs\n }\n}\n\n// CHONK: \"Client Honk\" - An UltraHonk variant with incremental folding and delayed non-native arithmetic.\npub struct ChonkProofData {\n pub public_inputs: KernelPublicInputs,\n pub proof: [Field; CHONK_PROOF_LENGTH],\n pub vk_data: VerificationKey<CHONK_VK_LENGTH_IN_FIELDS>,\n}\n\nimpl ChonkProofData {\n pub fn verify(self) {\n let inputs = KernelPublicInputs::serialize(self.public_inputs);\n std::verify_proof_with_type(\n self.vk_data.key,\n self.proof,\n inputs,\n self.vk_data.hash,\n PROOF_TYPE_CHONK,\n );\n }\n}\n",
568
- "path": "/home/mitch/aztec-clones/alpha/noir-projects/mock-protocol-circuits/crates/mock-types/src/lib.nr",
570
+ "52": {
571
+ "source": "pub global MAX_COMMITMENTS_PER_CALL: u32 = 2;\npub global MAX_COMMITMENTS_PER_TX: u32 = 4;\npub global MAX_COMMITMENT_READ_REQUESTS_PER_CALL: u32 = 2;\npub global MAX_COMMITMENT_READ_REQUESTS_PER_TX: u32 = 4;\n\npub use protocol_types::{\n abis::avm_circuit_public_inputs::AvmCircuitPublicInputs,\n constants::{\n AVM_V2_PROOF_LENGTH_IN_FIELDS, CHONK_PROOF_LENGTH, CHONK_VK_LENGTH_IN_FIELDS,\n MEGA_VK_LENGTH_IN_FIELDS, NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, PROOF_TYPE_AVM,\n PROOF_TYPE_CHONK, PROOF_TYPE_HN, PROOF_TYPE_HN_FINAL, PROOF_TYPE_HN_TAIL, PROOF_TYPE_OINK,\n PROOF_TYPE_ROLLUP_HONK, PROOF_TYPE_ROOT_ROLLUP_HONK,\n },\n proof::{\n traits::SerializeToColumns,\n verification_key::{RollupHonkVerificationKey, VerificationKey},\n },\n traits::Serialize,\n};\n\npub struct TxRequest {\n pub number_of_calls: u32,\n}\n\npub struct AppPublicInputs {\n pub commitments: [Field; MAX_COMMITMENTS_PER_CALL],\n pub read_requests: [Field; MAX_COMMITMENT_READ_REQUESTS_PER_CALL],\n}\n\nimpl Default for AppPublicInputs {\n fn default() -> Self {\n Self {\n commitments: [0; MAX_COMMITMENTS_PER_CALL],\n read_requests: [0; MAX_COMMITMENT_READ_REQUESTS_PER_CALL],\n }\n }\n}\n\npub struct PrivateKernelPublicInputs {\n pub remaining_calls: u32,\n pub commitments: [Field; MAX_COMMITMENTS_PER_TX],\n pub read_requests: [Field; MAX_COMMITMENT_READ_REQUESTS_PER_TX],\n}\n\nimpl Default for PrivateKernelPublicInputs {\n fn default() -> Self {\n Self {\n remaining_calls: 0,\n commitments: [0; MAX_COMMITMENTS_PER_TX],\n read_requests: [0; MAX_COMMITMENT_READ_REQUESTS_PER_TX],\n }\n }\n}\n\npub struct PrivateKernelPublicInputsBuilder {\n pub remaining_calls: u32,\n pub commitments: BoundedVec<Field, MAX_COMMITMENTS_PER_TX>,\n pub read_requests: BoundedVec<Field, MAX_COMMITMENT_READ_REQUESTS_PER_TX>,\n}\n\nimpl PrivateKernelPublicInputsBuilder {\n pub fn from_tx(tx: TxRequest) -> Self {\n Self {\n remaining_calls: tx.number_of_calls,\n commitments: BoundedVec::new(),\n read_requests: BoundedVec::new(),\n }\n }\n\n pub fn from_previous_kernel(prev_kernel_public_inputs: PrivateKernelPublicInputs) -> Self {\n let mut builder = PrivateKernelPublicInputsBuilder {\n remaining_calls: prev_kernel_public_inputs.remaining_calls,\n commitments: BoundedVec::new(),\n read_requests: BoundedVec::new(),\n };\n for i in 0..MAX_COMMITMENTS_PER_TX {\n if prev_kernel_public_inputs.commitments[i] != 0 {\n builder.commitments.push(prev_kernel_public_inputs.commitments[i]);\n }\n }\n for i in 0..MAX_COMMITMENT_READ_REQUESTS_PER_TX {\n if prev_kernel_public_inputs.read_requests[i] != 0 {\n builder.read_requests.push(prev_kernel_public_inputs.read_requests[i]);\n }\n }\n builder\n }\n\n pub fn ingest_app_inputs(&mut self, app_inputs: AppPublicInputs) {\n for i in 0..MAX_COMMITMENTS_PER_CALL {\n if app_inputs.commitments[i] != 0 {\n self.commitments.push(app_inputs.commitments[i]);\n }\n }\n\n for i in 0..MAX_COMMITMENT_READ_REQUESTS_PER_CALL {\n if app_inputs.read_requests[i] != 0 {\n self.read_requests.push(app_inputs.read_requests[i]);\n }\n }\n\n self.remaining_calls -= 1;\n }\n\n pub fn finish(self) -> PrivateKernelPublicInputs {\n PrivateKernelPublicInputs {\n remaining_calls: self.remaining_calls,\n commitments: self.commitments.storage(),\n read_requests: self.read_requests.storage(),\n }\n }\n}\n\n#[derive(Serialize)]\npub struct KernelPublicInputs {\n pub commitments: [Field; MAX_COMMITMENTS_PER_TX],\n}\n\nimpl Default for KernelPublicInputs {\n fn default() -> Self {\n Self { commitments: [0; MAX_COMMITMENTS_PER_TX] }\n }\n}\n\n#[derive(Serialize)]\npub struct RollupPublicInputs {\n accumulated: u32,\n}\n\nimpl RollupPublicInputs {\n pub fn new(accumulated: u32) -> Self {\n Self { accumulated }\n }\n\n pub fn merge(self, other: Self) -> Self {\n Self { accumulated: self.accumulated + other.accumulated }\n }\n}\n\npub struct PreviousRollupData {\n base_or_merge_public_inputs: RollupPublicInputs,\n proof: [Field; NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH],\n vk: RollupHonkVerificationKey,\n}\n\nimpl PreviousRollupData {\n pub fn verify(self, is_root: bool) {\n let inputs = self.base_or_merge_public_inputs.serialize();\n\n std::verify_proof_with_type(\n self.vk.key,\n self.proof,\n inputs,\n self.vk.hash,\n if is_root {\n PROOF_TYPE_ROOT_ROLLUP_HONK\n } else {\n PROOF_TYPE_ROLLUP_HONK\n },\n );\n }\n\n pub fn public_inputs(self) -> RollupPublicInputs {\n self.base_or_merge_public_inputs\n }\n}\n\n// CHONK: \"Client Honk\" - An UltraHonk variant with incremental folding and delayed non-native arithmetic.\npub struct ChonkProofData {\n pub public_inputs: KernelPublicInputs,\n pub proof: [Field; CHONK_PROOF_LENGTH],\n pub vk_data: VerificationKey<CHONK_VK_LENGTH_IN_FIELDS>,\n}\n\nimpl ChonkProofData {\n pub fn verify(self) {\n let inputs = KernelPublicInputs::serialize(self.public_inputs);\n std::verify_proof_with_type(\n self.vk_data.key,\n self.proof,\n inputs,\n self.vk_data.hash,\n PROOF_TYPE_CHONK,\n );\n }\n}\n",
572
+ "path": "/home/aztec-dev/aztec-packages-private/noir-projects/mock-protocol-circuits/crates/mock-types/src/lib.nr",
569
573
  "function_locations": [
570
574
  {
571
- "start": 1151,
575
+ "start": 1087,
572
576
  "name": "<impl Default for AppPublicInputs>::default"
573
577
  },
574
578
  {
575
- "start": 1579,
579
+ "start": 1515,
576
580
  "name": "<impl Default for PrivateKernelPublicInputs>::default"
577
581
  },
578
582
  {
579
- "start": 2074,
583
+ "start": 2010,
580
584
  "name": "PrivateKernelPublicInputsBuilder::from_tx"
581
585
  },
582
586
  {
583
- "start": 2341,
587
+ "start": 2277,
584
588
  "name": "PrivateKernelPublicInputsBuilder::from_previous_kernel"
585
589
  },
586
590
  {
587
- "start": 3120,
591
+ "start": 3056,
588
592
  "name": "PrivateKernelPublicInputsBuilder::ingest_app_inputs"
589
593
  },
590
594
  {
591
- "start": 3608,
595
+ "start": 3544,
592
596
  "name": "PrivateKernelPublicInputsBuilder::finish"
593
597
  },
594
598
  {
595
- "start": 3999,
599
+ "start": 3935,
596
600
  "name": "<impl Default for KernelPublicInputs>::default"
597
601
  },
598
602
  {
599
- "start": 4213,
603
+ "start": 4149,
600
604
  "name": "RollupPublicInputs::new"
601
605
  },
602
606
  {
603
- "start": 4295,
607
+ "start": 4231,
604
608
  "name": "RollupPublicInputs::merge"
605
609
  },
606
610
  {
607
- "start": 4624,
611
+ "start": 4560,
608
612
  "name": "PreviousRollupData::verify"
609
613
  },
610
614
  {
611
- "start": 5041,
615
+ "start": 4977,
612
616
  "name": "PreviousRollupData::public_inputs"
613
617
  },
614
618
  {
615
- "start": 5425,
619
+ "start": 5361,
616
620
  "name": "ChonkProofData::verify"
617
621
  }
618
622
  ]
619
623
  }
620
624
  },
621
625
  "verificationKey": {
622
- "bytes": "000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000096000000000000000000000000000000e6689f9b831c9156f2f117d9a8b402d6a90000000000000000000000000000000000098078ee4dad857c097bb8eb910c4b000000000000000000000000000000a9f09768d13b783db58c99c0f7b789da5100000000000000000000000000000000002f6ff74407359a737244272cf7d1660000000000000000000000000000001efa43f70d256b6ae32fc4c8f5c370d4010000000000000000000000000000000000147829f372fadc0c22f989f3586da8000000000000000000000000000000dd3121f7136cd903eefcc454a23356e00400000000000000000000000000000000002162ac50e478c11df7bb803ff24fad000000000000000000000000000000f0a4254fa4833daf95dab210d62c57a5ec0000000000000000000000000000000000127a4ed7e885bb5ad64180fee7c821000000000000000000000000000000d0254a6c3f6b173a871df2f6b4bdf623670000000000000000000000000000000000044a1d84967c43bc8f9be2732391cf000000000000000000000000000000604dadb67120987c555d183333294d61a0000000000000000000000000000000000006aa990387d2ce3c06a8f24476ac1a0000000000000000000000000000001fbfa8eb6432f49ed636dce8152d5a3e77000000000000000000000000000000000012795325bfa1d7892b64d7631b0adb000000000000000000000000000000fd7ef3d0cfa6cf43654adad3af8525d60f00000000000000000000000000000000000566f13f3eda972085b8a5398bdd620000000000000000000000000000006478207b1cb116e79250b37154bfaa5615000000000000000000000000000000000000dc76bd4cf35a407152c878eda8de000000000000000000000000000000f5f9d5ba19237a350fcfd1de2114a5680600000000000000000000000000000000002b685907848b4d2b1ed96f56118326000000000000000000000000000000e3c4e8394c71297d193db45efa5bbeb45300000000000000000000000000000000002225e477ebc0c0292dea2a54de8dcf00000000000000000000000000000005ba4b633c5a7056157db3a8d3a1281dca00000000000000000000000000000000000de3ef44fb0d77e3bcf799da19df38000000000000000000000000000000d6db3b57e0d9eb40f9df35254ead759546000000000000000000000000000000000017c8cac1a8cb23de522059f4251e4400000000000000000000000000000027660cadefcf3612abeb7fc3c9dd61804a00000000000000000000000000000000000bda3acde67164d1be7e805b4300a10000000000000000000000000000002fdcc506776a453fe446268efefceb89bc00000000000000000000000000000000000dc116342bb8327c1b9253a4128331000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000017930ee03365fe6eba1e7509e80d87bcef00000000000000000000000000000000001a949ee429a46d140116aebf1e87190000000000000000000000000000003d04c92dd547666f2559430547a6fdf3d800000000000000000000000000000000002dfa8ae1316de0110526f2bb061f190000000000000000000000000000003da73cf48767b4bf48224cab1a3bcc679200000000000000000000000000000000001c51aa31883703931d70c4a4261eb8000000000000000000000000000000ddd11b7064afd0ccf118dd6797568581d4000000000000000000000000000000000025b6a7cbad3e2841af6d696658fe2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006e216ef21843276454d72d5a871acf066d000000000000000000000000000000000006b4ecbf33d238061ee4737f7d49560000000000000000000000000000001d4062450cf90cf63532d16dd792fea08600000000000000000000000000000000000f54921ef4e2775f6943afb7869eab000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000023de33ce84e10229255af81cadb0bb833400000000000000000000000000000000000a35269ce366644e1c2aa9abeb0ae90000000000000000000000000000003215ec8b689cc56a757e88a573cb95dd66000000000000000000000000000000000005f3c516bec262c3ee9a58f79a4f6b00000000000000000000000000000036e8061d620871f7c672808c5fb1532e8800000000000000000000000000000000002035d6077a5c274aca9e5a6f7aab1400000000000000000000000000000078910fc51f9b3ee47c49d762865d269e870000000000000000000000000000000000224a05ef65de6dc8435cdd6d3444430000000000000000000000000000004994f6a75217d665696312d1a9cda5c6f00000000000000000000000000000000000147533d5a0bef4be02dfe9b67936210000000000000000000000000000005c9d61d7b56dac8ca7448d0ea8ccf8ab6400000000000000000000000000000000002ba4d9782a3be3fdff029b0252666e0000000000000000000000000000008c06e3ec64ec494dd35c56d2eeff6c2e7a000000000000000000000000000000000017d1ccce4c81f7020d3d4b8ba8a5150000000000000000000000000000000a3a6172c7290baf320a8f49caccb59b5800000000000000000000000000000000001fcf2045fba6763a1dca9581f7875e00000000000000000000000000000050f6fabc4998b4e297292769dc75b4042f00000000000000000000000000000000000e63ec72ef3c5178848cfc0431b0650000000000000000000000000000009a9ef2a4ca92b3328439223fbdba6f171b00000000000000000000000000000000000868b83b9dee7110cb6305c3c403f600000000000000000000000000000096e9409554a7c29f07d39ba696fb11a3f6000000000000000000000000000000000001bceaab8c804f7537fc03ed1f3dcc000000000000000000000000000000dbce08ce9ade87daf2b2692349eaaf996a00000000000000000000000000000000002cf121a2258b93082ea56bec7a3f2c000000000000000000000000000000777faaff3752270c52cb82734317345f9700000000000000000000000000000000000bc5773102e2fc8ef797b5f16cf60b000000000000000000000000000000d0187271a44b12fd79f746dff50649dd4800000000000000000000000000000000001343b83dd1cda07b5a24a9737b054c0000000000000000000000000000009cc1af85c93cb1679644a30a99c735289e0000000000000000000000000000000000218becb682e37b52b1580687c3278e0000000000000000000000000000007b37c604a7a124e789325ee1974df02a9f000000000000000000000000000000000000589aeddbef3b4071aa248b67baa4000000000000000000000000000000c900b5139a4183e2a8d39ac88453c25a62000000000000000000000000000000000012ffaec63cc3152fd85eaa2d095d51000000000000000000000000000000b33c3dcc5b3659842fc2745e449173c552000000000000000000000000000000000008e16054d6f4329c54415b7959df83000000000000000000000000000000dae0b626e705974a80970c62af67516573000000000000000000000000000000000012b3af69cfd80cbbf3b1cb32333c6a0000000000000000000000000000008e4b9e3dd3173cf10aa77abdc70b42e96300000000000000000000000000000000002d89e613d36edf44c1aeca8e81eab10000000000000000000000000000001aa6c83d42974bf1ddfe0f1558e408617d00000000000000000000000000000000002af524005e715a72c168d37099038d0000000000000000000000000000001c1360b4657b243f00f9f1a62fd5ebcb1c0000000000000000000000000000000000017c7f782282c8bb6434ad1976539a000000000000000000000000000000e6c24fe429c1a699a1d7b6b4958e507dcc000000000000000000000000000000000021feaf380cf9d8fd50e16b5d2339090000000000000000000000000000006efb2608f914712933b03063eb6a36ac3100000000000000000000000000000000000c27d78bb30970bae3730854d2b5110000000000000000000000000000009246a82ebf99efdf3ed442743c2493f3f000000000000000000000000000000000000edbf3e51fa60534755bacb9c3c1bd000000000000000000000000000000ef56d2b88cca76a94790340ead9f58808f00000000000000000000000000000000000696dcae149b9bd19c918bc77bdaa400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000efc5b6c8b084b6f3de1fc4fe09b97348dd0000000000000000000000000000000000062db1fe98501bf475b05b481c2059000000000000000000000000000000326d220a1dcb49ece31d3b8ecc82f89e7000000000000000000000000000000000001480a28a6c7660f674beb65a7f87f900000000000000000000000000000009835f11bc7b963372a60d92370980b18300000000000000000000000000000000000d898f5e8487e3ed90a10fc50db186000000000000000000000000000000b66ee3d15932d652c3b54801748e89da9f000000000000000000000000000000000024899f4b6ba56af0e1128c4a431ba700000000000000000000000000000014f0863f2eef8c90fa2ecd91e1e10b572c000000000000000000000000000000000017bd913cb2426b7f89ca0e2dd4e73d000000000000000000000000000000bc2c6d52ed3523bb441f7674e48465fa98000000000000000000000000000000000017bd63ba535af74d8a9188e022f432",
626
+ "bytes": "000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000000000000000000000000000000000000000000970000000000000000000000000000001475628cc53971daa005a3b4e00d285c0000000000000000000000000000000000000c97654f7b55e496d41a6eac94e74a000000000000000000000000000000bf1c23f659759fca80e11013edcc95851d00000000000000000000000000000000001d686bf0d405a5500a8288bd7b94c8000000000000000000000000000000d9ede2010ba47df4ce968c68e4d6b87490000000000000000000000000000000000006457ed07d22769e41e9112d2b4bac000000000000000000000000000000d80906525358082df77c3b689fd807a190000000000000000000000000000000000029ed850df18ac76ef151f8aae8d2880000000000000000000000000000005dacfa96a2eb2effd8a273762b3ca6e92300000000000000000000000000000000001dbf49534ac399adeeed1f17c35e2c000000000000000000000000000000fdd27842d68e8a2d310c620efce58b87fa00000000000000000000000000000000001481771bd90422664494ce49dd039d000000000000000000000000000000c78fb3bf0d1c8ec6739a3e502959a9650600000000000000000000000000000000000eb5469ae3f053b7db36abf27f28aa000000000000000000000000000000aad530fea6fa18006cf9e553ffa44687c700000000000000000000000000000000002f133fa3ddb9ad501f6d767aa178ae0000000000000000000000000000006ebbf42451e4fc7abd14864879644d6dbc00000000000000000000000000000000002106c3ccdc32f8c5909fe4bfaf559a000000000000000000000000000000aed642946707c169bb92ddc41b1abc915100000000000000000000000000000000001139e57bea6a314b59245ed61037120000000000000000000000000000007787391c29e9b67277d53f893338a93cd700000000000000000000000000000000001340654cc03732d2de4d808a550cf1000000000000000000000000000000e23f2ac261930241dc9db57d050935ab1700000000000000000000000000000000000c74a97a2efe9c81b9a4764c7c307c000000000000000000000000000000f319f736d1d10eaae1a178012da257dca000000000000000000000000000000000002f126cb2643d84f4fd7e5024ce5117000000000000000000000000000000ca56b17a4d1808328769b86349241bedf400000000000000000000000000000000001b9c0df3413e4c3bc06952b34eadfa00000000000000000000000000000097507e86d59da45d8fb2f1eddb835f4bd500000000000000000000000000000000001feb21c6f9bc926b181f9342d107590000000000000000000000000000001e64e70dd2d5c8b67d0b94abd97007d0a400000000000000000000000000000000000a65b01d74e4e9583899ff56cb2cc9000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080b4cfb731f297e8cd9a81928998930bd200000000000000000000000000000000001311203083ecdff483a615c0b190170000000000000000000000000000000fd6d0c60a842975dc1ef982c965bdf59300000000000000000000000000000000001a0ab3bb758deaa73232c4bdf8c6fc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000eddeee6457e4d9ffd2a07e1a8ab5d38a3000000000000000000000000000000000002840541b2d550d96c4177d52f938eb0000000000000000000000000000001b963638477614a1346326e4637c42bbc800000000000000000000000000000000001f4a9c36e1245f9458f9e65bad20e8000000000000000000000000000000b7d6426fd0a6ed34afbee8b222240f9a6500000000000000000000000000000000002ed5f79871d05c2d55311933d82d590000000000000000000000000000001589c85e8e584177f62f08632789b0910f0000000000000000000000000000000000262e6c72e1a6864e204461a53177f00000000000000000000000000000006b4c616d61ba8e9bfc4bc4f111693da1ac00000000000000000000000000000000002091a9bd13e08638733ece97cb9845000000000000000000000000000000c59a93dee9078221aeb1b7482e5e5ab24900000000000000000000000000000000001d2f0ca76dbd79a04e3c7443690b960000000000000000000000000000004e96f600e764d3d212779f9f974b906b2400000000000000000000000000000000002e139109355a210c3f287d48b5b19f000000000000000000000000000000e0bc305d54c0aff6a82a9fac13e9f316fd000000000000000000000000000000000016b3432b8d63aaadc42a034ec32a0f000000000000000000000000000000124e29104e53832cb19cf9c956eccace020000000000000000000000000000000000057160f6ce46ec833aa1192f08e2640000000000000000000000000000000986dd43bea861f164dbab4defaed92c790000000000000000000000000000000000213f666e6389b0d7d578d7e676b33e00000000000000000000000000000079c7ea30db341c4097cd352057e8ec2a9a000000000000000000000000000000000004988fe325849926ea0f5e69e09a0e0000000000000000000000000000001a4890a422cf2d1e68c259a618b4d9b3bc00000000000000000000000000000000002dd933691507a9812ef6065b853a43000000000000000000000000000000971a567d3fa3931b17cc3bf9376a372e76000000000000000000000000000000000008b46310cb8e1a41318f3e6218cde50000000000000000000000000000001861d708e53b9c110e6da5b81fca26d9c7000000000000000000000000000000000012a0451c014de0dc4d3184d7dbb621000000000000000000000000000000481faee7d5381051a1cb48cfd0ee7cf43400000000000000000000000000000000001bbee69bf705048f255d356342b1d3000000000000000000000000000000d397ada52564dafbfee465e04007f83ac80000000000000000000000000000000000012f5a8c454c69f1d277d67627af75000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000055b4f82743896ee045c63609e5f3e778f500000000000000000000000000000000002e0ba31613ddcbfcc282e494f4d7d3000000000000000000000000000000acedbb603c8869ef2308dd2ac4f1b4f2a200000000000000000000000000000000002f53c4f2ea19809613548cf5cff6410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c621b7bb99e0ec66007ad2062a0f3c42e0000000000000000000000000000000000002bb6dfa07cd3029565f9eba7c182a00000000000000000000000000000094f457a63f08287ac3e642b2bd69422d680000000000000000000000000000000000165059367f4442d6c3ff6015cbfa980000000000000000000000000000004f5529c936d03735108fab35c5cedc1ea100000000000000000000000000000000000a10af55b7099f2bf1b54eec6c3986000000000000000000000000000000bc090f3d5ba5819fa0c385ac7ae9f16788000000000000000000000000000000000006be8564753e3b2cd4f8870cd240af000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014f0863f2eef8c90fa2ecd91e1e10b572c000000000000000000000000000000000017bd913cb2426b7f89ca0e2dd4e73d000000000000000000000000000000bc2c6d52ed3523bb441f7674e48465fa98000000000000000000000000000000000017bd63ba535af74d8a9188e022f43200000000000000000000000000000028edd1a7e46c840d9c943fdf45521c64ce0000000000000000000000000000000000043d063b130adfb37342af45d0155a0000000000000000000000000000009330952ae74c573d1686d9cb4a007338540000000000000000000000000000000000261522c4089330646aff96736194940000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000077aaf83a294a391c272a998b993b3fb72600000000000000000000000000000000001ef5fc7f99c80e746c5ebc02d079f50000000000000000000000000000006547e28fb2db0b99ed0531152efecc343100000000000000000000000000000000001068f5dcffbed813c829fe71235c2600000000000000000000000000000008049343ed892ea80e92357b6d81ef2539000000000000000000000000000000000015297396654b3c799fbcc77c3d8745000000000000000000000000000000247c6f30680b093dc0fc566ce600decd6e000000000000000000000000000000000008e9b6b1f29451324ec44a4a2fb6870000000000000000000000000000006f32db281a825fb33bcaab615ed443d761000000000000000000000000000000000005c1f82a0b5cb90a18e01b803ba2c5000000000000000000000000000000059753bb7be48c9b29de202cb1646aba3e00000000000000000000000000000000001269623d09e8feb9be180b6f6d63910000000000000000000000000000003ab631c0285046f123d6a2c20da34b23b700000000000000000000000000000000000a019a4e3472140cf31c6feae864e90000000000000000000000000000009350bf87175679fa4ac690279ec84b109c000000000000000000000000000000000029022d4f5a938e67dc114b5764033000000000000000000000000000000092bb3ce5725d0f35af81c6723e0fa7a5db000000000000000000000000000000000022efdc140f66dae8434a61fa3b139100000000000000000000000000000019905d29f6e812cf24f889bf11aae43c4e000000000000000000000000000000000016c12479eea35c8586abc7283746950000000000000000000000000000004897bf319a2fa7b1f27421d3a2b9adc33b00000000000000000000000000000000001b900d65f3181fa8088466e306595c00000000000000000000000000000024a68d5d45dbce4a7badf20dbd3279e39700000000000000000000000000000000001cdd3f277cf3e5639b3d7df72569e80000000000000000000000000000000f34ded679067836893927923ccb6029150000000000000000000000000000000000216f7635de2992eb23b8284cc89e15000000000000000000000000000000dfb9354145a9174fa685e368e4de32726600000000000000000000000000000000001c6938bfae5af177dff50db10cd96a",
623
627
  "fields": [
624
628
  "0x000000000000000000000000000000000000000000000000000000000000000e",
625
629
  "0x000000000000000000000000000000000000000000000000000000000000001a",
626
- "0x0000000000000000000000000000000000000000000000000000000000000096",
627
- "0x000000000000000000000000000000e6689f9b831c9156f2f117d9a8b402d6a9",
628
- "0x0000000000000000000000000000000000098078ee4dad857c097bb8eb910c4b",
629
- "0x000000000000000000000000000000a9f09768d13b783db58c99c0f7b789da51",
630
- "0x00000000000000000000000000000000002f6ff74407359a737244272cf7d166",
631
- "0x0000000000000000000000000000001efa43f70d256b6ae32fc4c8f5c370d401",
632
- "0x0000000000000000000000000000000000147829f372fadc0c22f989f3586da8",
633
- "0x000000000000000000000000000000dd3121f7136cd903eefcc454a23356e004",
634
- "0x00000000000000000000000000000000002162ac50e478c11df7bb803ff24fad",
635
- "0x000000000000000000000000000000f0a4254fa4833daf95dab210d62c57a5ec",
636
- "0x0000000000000000000000000000000000127a4ed7e885bb5ad64180fee7c821",
637
- "0x000000000000000000000000000000d0254a6c3f6b173a871df2f6b4bdf62367",
638
- "0x0000000000000000000000000000000000044a1d84967c43bc8f9be2732391cf",
639
- "0x000000000000000000000000000000604dadb67120987c555d183333294d61a0",
640
- "0x000000000000000000000000000000000006aa990387d2ce3c06a8f24476ac1a",
641
- "0x0000000000000000000000000000001fbfa8eb6432f49ed636dce8152d5a3e77",
642
- "0x000000000000000000000000000000000012795325bfa1d7892b64d7631b0adb",
643
- "0x000000000000000000000000000000fd7ef3d0cfa6cf43654adad3af8525d60f",
644
- "0x00000000000000000000000000000000000566f13f3eda972085b8a5398bdd62",
645
- "0x0000000000000000000000000000006478207b1cb116e79250b37154bfaa5615",
646
- "0x000000000000000000000000000000000000dc76bd4cf35a407152c878eda8de",
647
- "0x000000000000000000000000000000f5f9d5ba19237a350fcfd1de2114a56806",
648
- "0x00000000000000000000000000000000002b685907848b4d2b1ed96f56118326",
649
- "0x000000000000000000000000000000e3c4e8394c71297d193db45efa5bbeb453",
650
- "0x00000000000000000000000000000000002225e477ebc0c0292dea2a54de8dcf",
651
- "0x00000000000000000000000000000005ba4b633c5a7056157db3a8d3a1281dca",
652
- "0x00000000000000000000000000000000000de3ef44fb0d77e3bcf799da19df38",
653
- "0x000000000000000000000000000000d6db3b57e0d9eb40f9df35254ead759546",
654
- "0x000000000000000000000000000000000017c8cac1a8cb23de522059f4251e44",
655
- "0x00000000000000000000000000000027660cadefcf3612abeb7fc3c9dd61804a",
656
- "0x00000000000000000000000000000000000bda3acde67164d1be7e805b4300a1",
657
- "0x0000000000000000000000000000002fdcc506776a453fe446268efefceb89bc",
658
- "0x00000000000000000000000000000000000dc116342bb8327c1b9253a4128331",
659
- "0x0000000000000000000000000000000000000000000000000000000000000000",
660
- "0x0000000000000000000000000000000000000000000000000000000000000000",
661
- "0x0000000000000000000000000000000000000000000000000000000000000000",
662
- "0x0000000000000000000000000000000000000000000000000000000000000000",
663
- "0x00000000000000000000000000000017930ee03365fe6eba1e7509e80d87bcef",
664
- "0x00000000000000000000000000000000001a949ee429a46d140116aebf1e8719",
665
- "0x0000000000000000000000000000003d04c92dd547666f2559430547a6fdf3d8",
666
- "0x00000000000000000000000000000000002dfa8ae1316de0110526f2bb061f19",
667
- "0x0000000000000000000000000000003da73cf48767b4bf48224cab1a3bcc6792",
668
- "0x00000000000000000000000000000000001c51aa31883703931d70c4a4261eb8",
669
- "0x000000000000000000000000000000ddd11b7064afd0ccf118dd6797568581d4",
670
- "0x000000000000000000000000000000000025b6a7cbad3e2841af6d696658fe20",
671
- "0x0000000000000000000000000000000000000000000000000000000000000000",
672
- "0x0000000000000000000000000000000000000000000000000000000000000000",
673
- "0x0000000000000000000000000000000000000000000000000000000000000000",
674
- "0x0000000000000000000000000000000000000000000000000000000000000000",
675
- "0x0000000000000000000000000000006e216ef21843276454d72d5a871acf066d",
676
- "0x000000000000000000000000000000000006b4ecbf33d238061ee4737f7d4956",
677
- "0x0000000000000000000000000000001d4062450cf90cf63532d16dd792fea086",
678
- "0x00000000000000000000000000000000000f54921ef4e2775f6943afb7869eab",
679
- "0x0000000000000000000000000000000000000000000000000000000000000000",
680
- "0x0000000000000000000000000000000000000000000000000000000000000000",
681
- "0x0000000000000000000000000000000000000000000000000000000000000000",
682
- "0x0000000000000000000000000000000000000000000000000000000000000000",
683
- "0x00000000000000000000000000000023de33ce84e10229255af81cadb0bb8334",
684
- "0x00000000000000000000000000000000000a35269ce366644e1c2aa9abeb0ae9",
685
- "0x0000000000000000000000000000003215ec8b689cc56a757e88a573cb95dd66",
686
- "0x000000000000000000000000000000000005f3c516bec262c3ee9a58f79a4f6b",
687
- "0x00000000000000000000000000000036e8061d620871f7c672808c5fb1532e88",
688
- "0x00000000000000000000000000000000002035d6077a5c274aca9e5a6f7aab14",
689
- "0x00000000000000000000000000000078910fc51f9b3ee47c49d762865d269e87",
690
- "0x0000000000000000000000000000000000224a05ef65de6dc8435cdd6d344443",
691
- "0x0000000000000000000000000000004994f6a75217d665696312d1a9cda5c6f0",
692
- "0x0000000000000000000000000000000000147533d5a0bef4be02dfe9b6793621",
693
- "0x0000000000000000000000000000005c9d61d7b56dac8ca7448d0ea8ccf8ab64",
694
- "0x00000000000000000000000000000000002ba4d9782a3be3fdff029b0252666e",
695
- "0x0000000000000000000000000000008c06e3ec64ec494dd35c56d2eeff6c2e7a",
696
- "0x000000000000000000000000000000000017d1ccce4c81f7020d3d4b8ba8a515",
697
- "0x0000000000000000000000000000000a3a6172c7290baf320a8f49caccb59b58",
698
- "0x00000000000000000000000000000000001fcf2045fba6763a1dca9581f7875e",
699
- "0x00000000000000000000000000000050f6fabc4998b4e297292769dc75b4042f",
700
- "0x00000000000000000000000000000000000e63ec72ef3c5178848cfc0431b065",
701
- "0x0000000000000000000000000000009a9ef2a4ca92b3328439223fbdba6f171b",
702
- "0x00000000000000000000000000000000000868b83b9dee7110cb6305c3c403f6",
703
- "0x00000000000000000000000000000096e9409554a7c29f07d39ba696fb11a3f6",
704
- "0x000000000000000000000000000000000001bceaab8c804f7537fc03ed1f3dcc",
705
- "0x000000000000000000000000000000dbce08ce9ade87daf2b2692349eaaf996a",
706
- "0x00000000000000000000000000000000002cf121a2258b93082ea56bec7a3f2c",
707
- "0x000000000000000000000000000000777faaff3752270c52cb82734317345f97",
708
- "0x00000000000000000000000000000000000bc5773102e2fc8ef797b5f16cf60b",
709
- "0x000000000000000000000000000000d0187271a44b12fd79f746dff50649dd48",
710
- "0x00000000000000000000000000000000001343b83dd1cda07b5a24a9737b054c",
711
- "0x0000000000000000000000000000009cc1af85c93cb1679644a30a99c735289e",
712
- "0x0000000000000000000000000000000000218becb682e37b52b1580687c3278e",
713
- "0x0000000000000000000000000000007b37c604a7a124e789325ee1974df02a9f",
714
- "0x000000000000000000000000000000000000589aeddbef3b4071aa248b67baa4",
715
- "0x000000000000000000000000000000c900b5139a4183e2a8d39ac88453c25a62",
716
- "0x000000000000000000000000000000000012ffaec63cc3152fd85eaa2d095d51",
717
- "0x000000000000000000000000000000b33c3dcc5b3659842fc2745e449173c552",
718
- "0x000000000000000000000000000000000008e16054d6f4329c54415b7959df83",
719
- "0x000000000000000000000000000000dae0b626e705974a80970c62af67516573",
720
- "0x000000000000000000000000000000000012b3af69cfd80cbbf3b1cb32333c6a",
721
- "0x0000000000000000000000000000008e4b9e3dd3173cf10aa77abdc70b42e963",
722
- "0x00000000000000000000000000000000002d89e613d36edf44c1aeca8e81eab1",
723
- "0x0000000000000000000000000000001aa6c83d42974bf1ddfe0f1558e408617d",
724
- "0x00000000000000000000000000000000002af524005e715a72c168d37099038d",
725
- "0x0000000000000000000000000000001c1360b4657b243f00f9f1a62fd5ebcb1c",
726
- "0x0000000000000000000000000000000000017c7f782282c8bb6434ad1976539a",
727
- "0x000000000000000000000000000000e6c24fe429c1a699a1d7b6b4958e507dcc",
728
- "0x000000000000000000000000000000000021feaf380cf9d8fd50e16b5d233909",
729
- "0x0000000000000000000000000000006efb2608f914712933b03063eb6a36ac31",
730
- "0x00000000000000000000000000000000000c27d78bb30970bae3730854d2b511",
731
- "0x0000000000000000000000000000009246a82ebf99efdf3ed442743c2493f3f0",
732
- "0x00000000000000000000000000000000000edbf3e51fa60534755bacb9c3c1bd",
733
- "0x000000000000000000000000000000ef56d2b88cca76a94790340ead9f58808f",
734
- "0x00000000000000000000000000000000000696dcae149b9bd19c918bc77bdaa4",
630
+ "0x0000000000000000000000000000000000000000000000000000000000000097",
631
+ "0x0000000000000000000000000000001475628cc53971daa005a3b4e00d285c00",
632
+ "0x00000000000000000000000000000000000c97654f7b55e496d41a6eac94e74a",
633
+ "0x000000000000000000000000000000bf1c23f659759fca80e11013edcc95851d",
634
+ "0x00000000000000000000000000000000001d686bf0d405a5500a8288bd7b94c8",
635
+ "0x000000000000000000000000000000d9ede2010ba47df4ce968c68e4d6b87490",
636
+ "0x000000000000000000000000000000000006457ed07d22769e41e9112d2b4bac",
637
+ "0x000000000000000000000000000000d80906525358082df77c3b689fd807a190",
638
+ "0x000000000000000000000000000000000029ed850df18ac76ef151f8aae8d288",
639
+ "0x0000000000000000000000000000005dacfa96a2eb2effd8a273762b3ca6e923",
640
+ "0x00000000000000000000000000000000001dbf49534ac399adeeed1f17c35e2c",
641
+ "0x000000000000000000000000000000fdd27842d68e8a2d310c620efce58b87fa",
642
+ "0x00000000000000000000000000000000001481771bd90422664494ce49dd039d",
643
+ "0x000000000000000000000000000000c78fb3bf0d1c8ec6739a3e502959a96506",
644
+ "0x00000000000000000000000000000000000eb5469ae3f053b7db36abf27f28aa",
645
+ "0x000000000000000000000000000000aad530fea6fa18006cf9e553ffa44687c7",
646
+ "0x00000000000000000000000000000000002f133fa3ddb9ad501f6d767aa178ae",
647
+ "0x0000000000000000000000000000006ebbf42451e4fc7abd14864879644d6dbc",
648
+ "0x00000000000000000000000000000000002106c3ccdc32f8c5909fe4bfaf559a",
649
+ "0x000000000000000000000000000000aed642946707c169bb92ddc41b1abc9151",
650
+ "0x00000000000000000000000000000000001139e57bea6a314b59245ed6103712",
651
+ "0x0000000000000000000000000000007787391c29e9b67277d53f893338a93cd7",
652
+ "0x00000000000000000000000000000000001340654cc03732d2de4d808a550cf1",
653
+ "0x000000000000000000000000000000e23f2ac261930241dc9db57d050935ab17",
654
+ "0x00000000000000000000000000000000000c74a97a2efe9c81b9a4764c7c307c",
655
+ "0x000000000000000000000000000000f319f736d1d10eaae1a178012da257dca0",
656
+ "0x00000000000000000000000000000000002f126cb2643d84f4fd7e5024ce5117",
657
+ "0x000000000000000000000000000000ca56b17a4d1808328769b86349241bedf4",
658
+ "0x00000000000000000000000000000000001b9c0df3413e4c3bc06952b34eadfa",
659
+ "0x00000000000000000000000000000097507e86d59da45d8fb2f1eddb835f4bd5",
660
+ "0x00000000000000000000000000000000001feb21c6f9bc926b181f9342d10759",
661
+ "0x0000000000000000000000000000001e64e70dd2d5c8b67d0b94abd97007d0a4",
662
+ "0x00000000000000000000000000000000000a65b01d74e4e9583899ff56cb2cc9",
663
+ "0x0000000000000000000000000000000000000000000000000000000000000001",
735
664
  "0x0000000000000000000000000000000000000000000000000000000000000000",
665
+ "0x0000000000000000000000000000000000000000000000000000000000000002",
736
666
  "0x0000000000000000000000000000000000000000000000000000000000000000",
667
+ "0x00000000000000000000000000000080b4cfb731f297e8cd9a81928998930bd2",
668
+ "0x00000000000000000000000000000000001311203083ecdff483a615c0b19017",
669
+ "0x0000000000000000000000000000000fd6d0c60a842975dc1ef982c965bdf593",
670
+ "0x00000000000000000000000000000000001a0ab3bb758deaa73232c4bdf8c6fc",
737
671
  "0x0000000000000000000000000000000000000000000000000000000000000000",
738
672
  "0x0000000000000000000000000000000000000000000000000000000000000000",
739
673
  "0x0000000000000000000000000000000000000000000000000000000000000000",
@@ -748,24 +682,114 @@
748
682
  "0x0000000000000000000000000000000000000000000000000000000000000000",
749
683
  "0x0000000000000000000000000000000000000000000000000000000000000000",
750
684
  "0x0000000000000000000000000000000000000000000000000000000000000000",
751
- "0x0000000000000000000000000000000000000000000000000000000000000001",
752
685
  "0x0000000000000000000000000000000000000000000000000000000000000000",
753
- "0x0000000000000000000000000000000000000000000000000000000000000002",
754
686
  "0x0000000000000000000000000000000000000000000000000000000000000000",
755
- "0x000000000000000000000000000000efc5b6c8b084b6f3de1fc4fe09b97348dd",
756
- "0x0000000000000000000000000000000000062db1fe98501bf475b05b481c2059",
757
- "0x000000000000000000000000000000326d220a1dcb49ece31d3b8ecc82f89e70",
758
- "0x00000000000000000000000000000000001480a28a6c7660f674beb65a7f87f9",
759
- "0x00000000000000000000000000000009835f11bc7b963372a60d92370980b183",
760
- "0x00000000000000000000000000000000000d898f5e8487e3ed90a10fc50db186",
761
- "0x000000000000000000000000000000b66ee3d15932d652c3b54801748e89da9f",
762
- "0x000000000000000000000000000000000024899f4b6ba56af0e1128c4a431ba7",
687
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
688
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
689
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
690
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
691
+ "0x000000000000000000000000000000eddeee6457e4d9ffd2a07e1a8ab5d38a30",
692
+ "0x00000000000000000000000000000000002840541b2d550d96c4177d52f938eb",
693
+ "0x0000000000000000000000000000001b963638477614a1346326e4637c42bbc8",
694
+ "0x00000000000000000000000000000000001f4a9c36e1245f9458f9e65bad20e8",
695
+ "0x000000000000000000000000000000b7d6426fd0a6ed34afbee8b222240f9a65",
696
+ "0x00000000000000000000000000000000002ed5f79871d05c2d55311933d82d59",
697
+ "0x0000000000000000000000000000001589c85e8e584177f62f08632789b0910f",
698
+ "0x0000000000000000000000000000000000262e6c72e1a6864e204461a53177f0",
699
+ "0x0000000000000000000000000000006b4c616d61ba8e9bfc4bc4f111693da1ac",
700
+ "0x00000000000000000000000000000000002091a9bd13e08638733ece97cb9845",
701
+ "0x000000000000000000000000000000c59a93dee9078221aeb1b7482e5e5ab249",
702
+ "0x00000000000000000000000000000000001d2f0ca76dbd79a04e3c7443690b96",
703
+ "0x0000000000000000000000000000004e96f600e764d3d212779f9f974b906b24",
704
+ "0x00000000000000000000000000000000002e139109355a210c3f287d48b5b19f",
705
+ "0x000000000000000000000000000000e0bc305d54c0aff6a82a9fac13e9f316fd",
706
+ "0x000000000000000000000000000000000016b3432b8d63aaadc42a034ec32a0f",
707
+ "0x000000000000000000000000000000124e29104e53832cb19cf9c956eccace02",
708
+ "0x0000000000000000000000000000000000057160f6ce46ec833aa1192f08e264",
709
+ "0x0000000000000000000000000000000986dd43bea861f164dbab4defaed92c79",
710
+ "0x0000000000000000000000000000000000213f666e6389b0d7d578d7e676b33e",
711
+ "0x00000000000000000000000000000079c7ea30db341c4097cd352057e8ec2a9a",
712
+ "0x000000000000000000000000000000000004988fe325849926ea0f5e69e09a0e",
713
+ "0x0000000000000000000000000000001a4890a422cf2d1e68c259a618b4d9b3bc",
714
+ "0x00000000000000000000000000000000002dd933691507a9812ef6065b853a43",
715
+ "0x000000000000000000000000000000971a567d3fa3931b17cc3bf9376a372e76",
716
+ "0x000000000000000000000000000000000008b46310cb8e1a41318f3e6218cde5",
717
+ "0x0000000000000000000000000000001861d708e53b9c110e6da5b81fca26d9c7",
718
+ "0x000000000000000000000000000000000012a0451c014de0dc4d3184d7dbb621",
719
+ "0x000000000000000000000000000000481faee7d5381051a1cb48cfd0ee7cf434",
720
+ "0x00000000000000000000000000000000001bbee69bf705048f255d356342b1d3",
721
+ "0x000000000000000000000000000000d397ada52564dafbfee465e04007f83ac8",
722
+ "0x0000000000000000000000000000000000012f5a8c454c69f1d277d67627af75",
723
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
724
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
725
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
726
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
727
+ "0x00000000000000000000000000000055b4f82743896ee045c63609e5f3e778f5",
728
+ "0x00000000000000000000000000000000002e0ba31613ddcbfcc282e494f4d7d3",
729
+ "0x000000000000000000000000000000acedbb603c8869ef2308dd2ac4f1b4f2a2",
730
+ "0x00000000000000000000000000000000002f53c4f2ea19809613548cf5cff641",
731
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
732
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
733
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
734
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
735
+ "0x000000000000000000000000000000c621b7bb99e0ec66007ad2062a0f3c42e0",
736
+ "0x000000000000000000000000000000000002bb6dfa07cd3029565f9eba7c182a",
737
+ "0x00000000000000000000000000000094f457a63f08287ac3e642b2bd69422d68",
738
+ "0x0000000000000000000000000000000000165059367f4442d6c3ff6015cbfa98",
739
+ "0x0000000000000000000000000000004f5529c936d03735108fab35c5cedc1ea1",
740
+ "0x00000000000000000000000000000000000a10af55b7099f2bf1b54eec6c3986",
741
+ "0x000000000000000000000000000000bc090f3d5ba5819fa0c385ac7ae9f16788",
742
+ "0x000000000000000000000000000000000006be8564753e3b2cd4f8870cd240af",
743
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
744
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
745
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
746
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
763
747
  "0x00000000000000000000000000000014f0863f2eef8c90fa2ecd91e1e10b572c",
764
748
  "0x000000000000000000000000000000000017bd913cb2426b7f89ca0e2dd4e73d",
765
749
  "0x000000000000000000000000000000bc2c6d52ed3523bb441f7674e48465fa98",
766
- "0x000000000000000000000000000000000017bd63ba535af74d8a9188e022f432"
750
+ "0x000000000000000000000000000000000017bd63ba535af74d8a9188e022f432",
751
+ "0x00000000000000000000000000000028edd1a7e46c840d9c943fdf45521c64ce",
752
+ "0x0000000000000000000000000000000000043d063b130adfb37342af45d0155a",
753
+ "0x0000000000000000000000000000009330952ae74c573d1686d9cb4a00733854",
754
+ "0x0000000000000000000000000000000000261522c4089330646aff9673619494",
755
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
756
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
757
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
758
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
759
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
760
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
761
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
762
+ "0x0000000000000000000000000000000000000000000000000000000000000000",
763
+ "0x00000000000000000000000000000077aaf83a294a391c272a998b993b3fb726",
764
+ "0x00000000000000000000000000000000001ef5fc7f99c80e746c5ebc02d079f5",
765
+ "0x0000000000000000000000000000006547e28fb2db0b99ed0531152efecc3431",
766
+ "0x00000000000000000000000000000000001068f5dcffbed813c829fe71235c26",
767
+ "0x00000000000000000000000000000008049343ed892ea80e92357b6d81ef2539",
768
+ "0x000000000000000000000000000000000015297396654b3c799fbcc77c3d8745",
769
+ "0x000000000000000000000000000000247c6f30680b093dc0fc566ce600decd6e",
770
+ "0x000000000000000000000000000000000008e9b6b1f29451324ec44a4a2fb687",
771
+ "0x0000000000000000000000000000006f32db281a825fb33bcaab615ed443d761",
772
+ "0x000000000000000000000000000000000005c1f82a0b5cb90a18e01b803ba2c5",
773
+ "0x000000000000000000000000000000059753bb7be48c9b29de202cb1646aba3e",
774
+ "0x00000000000000000000000000000000001269623d09e8feb9be180b6f6d6391",
775
+ "0x0000000000000000000000000000003ab631c0285046f123d6a2c20da34b23b7",
776
+ "0x00000000000000000000000000000000000a019a4e3472140cf31c6feae864e9",
777
+ "0x0000000000000000000000000000009350bf87175679fa4ac690279ec84b109c",
778
+ "0x000000000000000000000000000000000029022d4f5a938e67dc114b57640330",
779
+ "0x00000000000000000000000000000092bb3ce5725d0f35af81c6723e0fa7a5db",
780
+ "0x000000000000000000000000000000000022efdc140f66dae8434a61fa3b1391",
781
+ "0x00000000000000000000000000000019905d29f6e812cf24f889bf11aae43c4e",
782
+ "0x000000000000000000000000000000000016c12479eea35c8586abc728374695",
783
+ "0x0000000000000000000000000000004897bf319a2fa7b1f27421d3a2b9adc33b",
784
+ "0x00000000000000000000000000000000001b900d65f3181fa8088466e306595c",
785
+ "0x00000000000000000000000000000024a68d5d45dbce4a7badf20dbd3279e397",
786
+ "0x00000000000000000000000000000000001cdd3f277cf3e5639b3d7df72569e8",
787
+ "0x0000000000000000000000000000000f34ded679067836893927923ccb602915",
788
+ "0x0000000000000000000000000000000000216f7635de2992eb23b8284cc89e15",
789
+ "0x000000000000000000000000000000dfb9354145a9174fa685e368e4de327266",
790
+ "0x00000000000000000000000000000000001c6938bfae5af177dff50db10cd96a"
767
791
  ],
768
792
  "hash": ""
769
793
  },
770
- "aztec_version": "5.0.0-rc.2"
794
+ "aztec_version": "5.0.0"
771
795
  }