@inco/lightning 0.8.0-devnet-6 → 0.8.0-devnet-8
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 +4 -3
- package/src/IncoLightning.sol +13 -0
- package/src/Lib.alphanet.sol +21 -0
- package/src/Lib.demonet.sol +21 -0
- package/src/Lib.devnet.sol +21 -0
- package/src/Lib.sol +21 -0
- package/src/Lib.template.sol +23 -0
- package/src/Lib.testnet.sol +21 -0
- package/src/interfaces/IIncoLightning.sol +4 -0
- package/src/libs/incoLightning_alphanet_v0_297966649.sol +21 -0
- package/src/libs/incoLightning_alphanet_v1_725458969.sol +21 -0
- package/src/libs/incoLightning_alphanet_v2_976644394.sol +21 -0
- package/src/libs/incoLightning_demonet_v0_863421733.sol +21 -0
- package/src/libs/incoLightning_demonet_v2_467437523.sol +21 -0
- package/src/libs/incoLightning_devnet_v0_340846814.sol +21 -0
- package/src/libs/incoLightning_devnet_v1_904635675.sol +21 -0
- package/src/libs/incoLightning_devnet_v2_295237520.sol +21 -0
- package/src/libs/incoLightning_devnet_v3_976859633.sol +21 -0
- package/src/libs/incoLightning_devnet_v4_409204766.sol +21 -0
- package/src/libs/incoLightning_testnet_v0_183408998.sol +21 -0
- package/src/libs/incoLightning_testnet_v2_889158349.sol +21 -0
- package/src/lightning-parts/EncryptedInput.sol +60 -5
- package/src/lightning-parts/TEELifecycle.sol +36 -28
- package/src/lightning-parts/interfaces/IEncryptedInput.sol +6 -0
- package/src/lightning-parts/primitives/HandleGeneration.sol +2 -2
- package/src/lightning-parts/primitives/test/SignatureVerifier.t.sol +1 -1
- package/src/lightning-parts/test/HandleMetadata.t.sol +59 -9
- package/src/test/FakeIncoInfra/FakeIncoInfraBase.sol +3 -3
- package/src/test/FakeIncoInfra/MockRemoteAttestation.sol +2 -1
- package/src/test/TEELifecycle/TEELifecycleMockTest.t.sol +81 -56
- package/src/test/TestDeploy.t.sol +28 -0
|
@@ -5,6 +5,7 @@ import {Test} from "forge-std/Test.sol";
|
|
|
5
5
|
import {TrivialEncryption} from "../lightning-parts/TrivialEncryption.sol";
|
|
6
6
|
import {ETypes} from "../Types.sol";
|
|
7
7
|
import {UUPSUpgradeable} from "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol";
|
|
8
|
+
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
|
|
8
9
|
import {inco} from "../Lib.sol";
|
|
9
10
|
import {IncoTest} from "./IncoTest.sol";
|
|
10
11
|
|
|
@@ -26,6 +27,7 @@ contract TestDeploy is Test, IncoTest {
|
|
|
26
27
|
vm.expectEmit(false, false, true, false, address(inco));
|
|
27
28
|
emit TrivialEncryption.TrivialEncrypt(bytes32(uint256(1)), bytes32(uint256(1)), ETypes.Bool, 0);
|
|
28
29
|
inco.asEbool(true);
|
|
30
|
+
assertTrue(inco.isAcceptedVersion(2));
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
function testUpgrade() public {
|
|
@@ -35,4 +37,30 @@ contract TestDeploy is Test, IncoTest {
|
|
|
35
37
|
assertEq(ReturnTwo(address(inco)).getTwo(), 2);
|
|
36
38
|
}
|
|
37
39
|
|
|
40
|
+
function testAddAcceptedVersion() public {
|
|
41
|
+
assertFalse(inco.isAcceptedVersion(42));
|
|
42
|
+
vm.prank(owner);
|
|
43
|
+
inco.addAcceptedVersion(42);
|
|
44
|
+
assertTrue(inco.isAcceptedVersion(42));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function testAddAcceptedVersionNotOwner() public {
|
|
48
|
+
vm.expectRevert(abi.encodeWithSelector(OwnableUpgradeable.OwnableUnauthorizedAccount.selector, alice));
|
|
49
|
+
vm.prank(alice);
|
|
50
|
+
inco.addAcceptedVersion(42);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function testRemoveAcceptedVersion() public {
|
|
54
|
+
assertFalse(inco.isAcceptedVersion(42));
|
|
55
|
+
vm.prank(owner);
|
|
56
|
+
inco.removeAcceptedVersion(42); // removing a non-existent version should be no-op
|
|
57
|
+
assertFalse(inco.isAcceptedVersion(42));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function testRemoveAcceptedVersionNotOwner() public {
|
|
61
|
+
vm.expectRevert(abi.encodeWithSelector(OwnableUpgradeable.OwnableUnauthorizedAccount.selector, alice));
|
|
62
|
+
vm.prank(alice);
|
|
63
|
+
inco.removeAcceptedVersion(42);
|
|
64
|
+
}
|
|
65
|
+
|
|
38
66
|
}
|