Skip to content

Commit

Permalink
feat: Use unconstrained for public, view and note getter functions (#…
Browse files Browse the repository at this point in the history
…1198)

* feat: make unconstrained note getters

* feat: make public functions unconstrained

* feat: remove abi type comments

* chore: compile using noir master
  • Loading branch information
sirasistant authored Jul 26, 2023
1 parent 3b803c9 commit 63f7c1f
Show file tree
Hide file tree
Showing 24 changed files with 58 additions and 73 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ describe('Private Execution test suite', () => {
expect(newNullifiers).toEqual(consumedNotes.map(n => n.nullifier));

expect(result.preimages.newNotes).toHaveLength(2);
const [recipientNote, changeNote] = result.preimages.newNotes;
const [changeNote, recipientNote] = result.preimages.newNotes;
expect(recipientNote.storageSlot).toEqual(recipientStorageSlot);

const newCommitments = result.callStackItem.publicInputs.newCommitments.filter(field => !field.equals(Fr.ZERO));
Expand Down Expand Up @@ -338,7 +338,7 @@ describe('Private Execution test suite', () => {
expect(newNullifiers).toEqual(consumedNotes.map(n => n.nullifier));

expect(result.preimages.newNotes).toHaveLength(2);
const [recipientNote, changeNote] = result.preimages.newNotes;
const [changeNote, recipientNote] = result.preimages.newNotes;
expect(recipientNote.preimage[0]).toEqual(new Fr(amountToTransfer));
expect(changeNote.preimage[0]).toEqual(new Fr(balance - amountToTransfer));
});
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/noir-contracts/src/artifacts/child_contract.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"kind": "field"
}
],
"bytecode": "H4sIAAAAAAAA/81UwW7CMAx1u7ZbxTSN7UeSJqHJrd+wy86tCNNOkxj/LxqwhYnKAZEiLEV2k+r5+cXOJwBUcLRsXPm4Cozpu4y+K4zJX7IOvbjNZMb4Ubxked7Q18iPW5Wej+B1p8IsGdeacc5ZjeH8KbG2AbNMjBn4F3BucZ90LKb8L+NaYPy/+9v2P/7L92t+/UUEl09IBUymGk6yFmyP/qWzZ5ho5Q69uM0OGsd9OUeebKKIPHGO94RYy3RYItZ0w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1f7gv5fN181odlx73JfZTw3vpC9djrgks50SWDZFlTWQ5I7KsiCxLIsuCyDInssyILFMiy4TIMiayjIgsJZGlILLkRJaMyJISWRIiS0xk0USWiMiiHJbLji3Yp0kyT8F7uwvL5rovTBuf6tiXwDHpqM03pk3dbZtv29Yr4473x7bYgPTVtl7Zt0UTWcKeLW3xG6lXUCbXDfzdArmu4e8WKEcfePylTD6Dv+n1AeIymcOQOwyFwyBtZg5/7tjOwtEeHhv5TN28Vselx2OD/dSWQUyh5evTooksEZFFWZZDfs9OxgL8riirD/z+4Pksx6OEvk7j/2n8P8Ry7Pi/z1hv6m7Vfm3HDgPuo9Taluq49LiPsJ8a3ktfOA7HBBZNZImILK5zEZ97kjJlfXbbuJl42BZMNeSlr7Zxs2+LJrLERJawZ0vbGO4aU5X1WVP3DcZm+U64xmacy6SObc88bDv2Uwev5/U4NqcElpjIooksEZHFHv/bxn4fPkw15DOHJSKyaCJLTGRJiCy+v1uHWHxfF3ZZ2q6J22JKrjkitof3PSaZ8/C7et2O723Hfmp477om5gSWlMiSEFliIosmskREFjsWlwb9xce33ad2vI60dYy1446B5e/bEvZsabv2uP7/iLI+a86JnztiZXb8py1W5uNetC0OI321xcr6skREFvt7f4o5nWJO/2thjzm5rncYc/p1ijl1ZjnFnIYXc2pbD7bvO+V5pq7nMTjnDMCPqYa8xzXTStqVZF+zS6j3fZ2Mre23r+M419q2Dpr62Vc3OP+TtM86rzmf5Pnprw9f7m8/3b2///xwF0Ib2mpPQTsK6uz/mSfb2vHzcTds+698uf/e3d1+PHT3BcHL02afy6WnIaDCzUMjPuZjfxUPOf3t3drZMZT2pAPzrOhfOBzQx5x9AAA=",
"verificationKey": "0000000200000800000000740000000f00000003515f3109623eb3c25aa5b16a1a79fd558bac7a7ce62c4560a8c537c77ce80dd339128d1d37b6582ee9e6df9567efb64313471dfa18f520f9ce53161b50dbf7731bc5f900000003515f322bc4cce83a486a92c92fd59bd84e0f92595baa639fc2ed86b00ffa0dfded2a092a669a3bdb7a273a015eda494457cc7ed5236f26cee330c290d45a33b9daa94800000003515f332729426c008c085a81bd34d8ef12dd31e80130339ef99d50013a89e4558eee6d0fa4ffe2ee7b7b62eb92608b2251ac31396a718f9b34978888789042b790a30100000003515f342be6b6824a913eb7a57b03cb1ee7bfb4de02f2f65fe8a4e97baa7766ddb353a82a8a25c49dc63778cd9fe96173f12a2bc77f3682f4c4448f98f1df82c75234a100000003515f351f85760d6ab567465aadc2f180af9eae3800e6958fec96aef53fd8a7b195d7c000c6267a0dd5cfc22b3fe804f53e266069c0e36f51885baec1e7e67650c62e170000000c515f41524954484d455449430d9d0f8ece2aa12012fa21e6e5c859e97bd5704e5c122064a66051294bc5e04213f61f54a0ebdf6fee4d4a6ecf693478191de0c2899bcd8e86a636c8d3eff43400000003515f43224a99d02c86336737c8dd5b746c40d2be6aead8393889a76a18d664029096e90f7fe81adcc92a74350eada9622ac453f49ebac24a066a1f83b394df54dfa0130000000c515f46495845445f42415345060e8a013ed289c2f9fd7473b04f6594b138ddb4b4cf6b901622a14088f04b8d2c83ff74fce56e3d5573b99c7b26d85d5046ce0c6559506acb7a675e7713eb3a00000007515f4c4f4749430721a91cb8da4b917e054f72147e1760cfe0ef3d45090ac0f4961d84ec1996961a25e787b26bd8b50b1a99450f77a424a83513c2b33af268cd253b0587ff50c700000003515f4d05dbd8623b8652511e1eb38d38887a69eceb082f807514f09e127237c5213b401b9325b48c6c225968002318095f89d0ef9cf629b2b7f0172e03bc39aacf6ed800000007515f52414e474504b57a3805e41df328f5ca9aefa40fad5917391543b7b65c6476e60b8f72e9ad07c92f3b3e11c8feae96dedc4b14a6226ef3201244f37cfc1ee5b96781f48d2b000000075349474d415f3125001d1954a18571eaa007144c5a567bb0d2be4def08a8be918b8c05e3b27d312c59ed41e09e144eab5de77ca89a2fd783be702a47c951d3112e3de02ce6e47c000000075349474d415f3223994e6a23618e60fa01c449a7ab88378709197e186d48d604bfb6931ffb15ad11c5ec7a0700570f80088fd5198ab5d5c227f2ad2a455a6edeec024156bb7beb000000075349474d415f3300cda5845f23468a13275d18bddae27c6bb189cf9aa95b6a03a0cb6688c7e8d829639b45cf8607c525cc400b55ebf90205f2f378626dc3406cc59b2d1b474fba000000075349474d415f342d299e7928496ea2d37f10b43afd6a80c90a33b483090d18069ffa275eedb2fc2f82121e8de43dc036d99b478b6227ceef34248939987a19011f065d8b5cef5c0000000010000000000000000100000002000000030000000400000005000000060000000700000008000000090000000a0000000b0000000c0000000d0000000e0000000f"
},
{
Expand All @@ -46,7 +46,7 @@
"kind": "field"
}
],
"bytecode": "H4sIAAAAAAAA/9WUSwrDQAiGp+9NnzSFHkPHMaO7XqVDJ/c/QlNqIHRbs8gPom4+8Ee9hxB24atFH8s+1lYP/ean31o91srywzL8JzyPWARtSjXHioRPiFqEIXFpBQVZ+BWFqEqSrEUzKCaq2LFSZ7CLI+vqNyNM6d/RkXVy9K+ZiX97R9bBkXWbiX+Od4KN4/5N4d/wCz9/5g1JX70JUAUAAA==",
"bytecode": "H4sIAAAAAAAA/9WWSQ6DMBAExyxmX0JCTnmE+QH/f1XixC21HG6Yw4yEBnUZKC8HFhEx8iv7uWb5L/A9dHeuNpPuXe5Kz0yJZ67Es1DiWSrxtEo8KyWetRLPRolnq8SzU+LZK/EclHiOSjwnJZ5zQk9Dnje6f4XeUD5Rhv/XkTLwgTLwnjLwjjLwljLm6OA1ZeAVZeCWMvCSMvCCMvCcMvCMMnBDGbhE3/e1h+5OlpXkZ8r5Oa80D4nmi31ciOFcDJTd6X6JnvX1OBg7UbYejJ3J6xmN4zUH8/vM5/pbe+juXG14Hz7gF+EN9ZLE/t0NAAA=",
"verificationKey": "0000000200000800000000740000000f00000003515f3109623eb3c25aa5b16a1a79fd558bac7a7ce62c4560a8c537c77ce80dd339128d1d37b6582ee9e6df9567efb64313471dfa18f520f9ce53161b50dbf7731bc5f900000003515f322bc4cce83a486a92c92fd59bd84e0f92595baa639fc2ed86b00ffa0dfded2a092a669a3bdb7a273a015eda494457cc7ed5236f26cee330c290d45a33b9daa94800000003515f332729426c008c085a81bd34d8ef12dd31e80130339ef99d50013a89e4558eee6d0fa4ffe2ee7b7b62eb92608b2251ac31396a718f9b34978888789042b790a30100000003515f342be6b6824a913eb7a57b03cb1ee7bfb4de02f2f65fe8a4e97baa7766ddb353a82a8a25c49dc63778cd9fe96173f12a2bc77f3682f4c4448f98f1df82c75234a100000003515f351f85760d6ab567465aadc2f180af9eae3800e6958fec96aef53fd8a7b195d7c000c6267a0dd5cfc22b3fe804f53e266069c0e36f51885baec1e7e67650c62e170000000c515f41524954484d455449430d9d0f8ece2aa12012fa21e6e5c859e97bd5704e5c122064a66051294bc5e04213f61f54a0ebdf6fee4d4a6ecf693478191de0c2899bcd8e86a636c8d3eff43400000003515f43224a99d02c86336737c8dd5b746c40d2be6aead8393889a76a18d664029096e90f7fe81adcc92a74350eada9622ac453f49ebac24a066a1f83b394df54dfa0130000000c515f46495845445f42415345060e8a013ed289c2f9fd7473b04f6594b138ddb4b4cf6b901622a14088f04b8d2c83ff74fce56e3d5573b99c7b26d85d5046ce0c6559506acb7a675e7713eb3a00000007515f4c4f4749430721a91cb8da4b917e054f72147e1760cfe0ef3d45090ac0f4961d84ec1996961a25e787b26bd8b50b1a99450f77a424a83513c2b33af268cd253b0587ff50c700000003515f4d05dbd8623b8652511e1eb38d38887a69eceb082f807514f09e127237c5213b401b9325b48c6c225968002318095f89d0ef9cf629b2b7f0172e03bc39aacf6ed800000007515f52414e474504b57a3805e41df328f5ca9aefa40fad5917391543b7b65c6476e60b8f72e9ad07c92f3b3e11c8feae96dedc4b14a6226ef3201244f37cfc1ee5b96781f48d2b000000075349474d415f3125001d1954a18571eaa007144c5a567bb0d2be4def08a8be918b8c05e3b27d312c59ed41e09e144eab5de77ca89a2fd783be702a47c951d3112e3de02ce6e47c000000075349474d415f3223994e6a23618e60fa01c449a7ab88378709197e186d48d604bfb6931ffb15ad11c5ec7a0700570f80088fd5198ab5d5c227f2ad2a455a6edeec024156bb7beb000000075349474d415f3300cda5845f23468a13275d18bddae27c6bb189cf9aa95b6a03a0cb6688c7e8d829639b45cf8607c525cc400b55ebf90205f2f378626dc3406cc59b2d1b474fba000000075349474d415f342d299e7928496ea2d37f10b43afd6a80c90a33b483090d18069ffa275eedb2fc2f82121e8de43dc036d99b478b6227ceef34248939987a19011f065d8b5cef5c0000000010000000000000000100000002000000030000000400000005000000060000000700000008000000090000000a0000000b0000000c0000000d0000000e0000000f"
},
{
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading

0 comments on commit 63f7c1f

Please sign in to comment.