@inco/lightning 0.7.6-devnet → 0.7.6-devnet-1
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.
- package/package.json +1 -1
- package/src/test/AddTwo.sol +10 -0
package/package.json
CHANGED
package/src/test/AddTwo.sol
CHANGED
|
@@ -4,6 +4,7 @@ pragma solidity ^0.8;
|
|
|
4
4
|
import {euint256, ebool} from "../Types.sol";
|
|
5
5
|
import {IncoLightning} from "../IncoLightning.sol";
|
|
6
6
|
import {Fee} from "../lightning-parts/Fee.sol";
|
|
7
|
+
import {DecryptionAttestation} from "../lightning-parts/DecryptionAttester.types.sol";
|
|
7
8
|
|
|
8
9
|
// To implement such a contract, we would normally import e form Lib.sol. For test purposes, we take inco as
|
|
9
10
|
// a constructor argument instead, so we can test it from other deployment addresses.
|
|
@@ -47,6 +48,15 @@ contract AddTwo is Fee {
|
|
|
47
48
|
inco.reveal(euint256.unwrap(resultRevealed));
|
|
48
49
|
}
|
|
49
50
|
|
|
51
|
+
// Used to verify attested compute result handle inside DecryptionAttestation generated from Go code.
|
|
52
|
+
function verifyAttestedComputeResultHandle(bytes32 resultHandle, uint256 p, DecryptionAttestation memory decryption)
|
|
53
|
+
public
|
|
54
|
+
payable
|
|
55
|
+
returns (bool)
|
|
56
|
+
{
|
|
57
|
+
return decryption.handle == ebool.unwrap(inco.eEq(resultHandle, euint256.unwrap(inco.asEuint256(p))));
|
|
58
|
+
}
|
|
59
|
+
|
|
50
60
|
function getTrue() external returns (ebool) {
|
|
51
61
|
ebool trueHandle = inco.asEbool(true);
|
|
52
62
|
inco.reveal(ebool.unwrap(trueHandle));
|