From 9dee5118dc217a3bf4d7a9a57ada1ca2683349cd Mon Sep 17 00:00:00 2001 From: Ferran Borreguero Date: Wed, 17 Jan 2024 10:46:35 +0000 Subject: [PATCH] Update README --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index 648f76d..98cf99e 100644 --- a/README.md +++ b/README.md @@ -98,3 +98,28 @@ contract TestForge is Test, SuaveEnabled { } } ``` + +### Confidential inputs + +Use the `setConfidentialInputs` function to set the confidential inputs during tests. + +```solidity +// SPDX-License-Identifier: Unlicense +pragma solidity ^0.8.13; + +import "forge-std/Test.sol"; +import "src/Test.sol"; +import "src/suavelib/Suave.sol"; + +contract TestForge is Test, SuaveEnabled { + function testConfidentialInputs() public { + bytes memory input = hex"abcd"; + setConfidentialInputs(input); + + bytes memory found2 = Suave.confidentialInputs(); + assertEq0(input, found2); + } +} +``` + +The value for the confidential inputs gets reset for each test.