@@ -4,7 +4,7 @@ pragma solidity ^0.8.22;
4
4
import "forge-std/Test.sol " ;
5
5
import "../src/shutter-service/ShutterRegistry.sol " ;
6
6
7
- contract ShutterRegistryTest is Test {
7
+ contract ShutterRegistryTest is Test {
8
8
ShutterRegistry public shutterRegistry;
9
9
10
10
function setUp () public {
@@ -26,16 +26,11 @@ contract ShutterRegistryTest is Test{
26
26
);
27
27
28
28
hoax (sender);
29
- shutterRegistry.register (
30
- eon,
31
- identityPrefix,
32
- timestamp
33
- );
29
+ shutterRegistry.register (eon, identityPrefix, timestamp);
34
30
35
- bytes32 identity = keccak256 (
36
- abi.encodePacked (identityPrefix, sender)
37
- );
38
- (uint64 registeredEon , uint64 registeredTimestamp ) = shutterRegistry.registrations (identity);
31
+ bytes32 identity = keccak256 (abi.encodePacked (identityPrefix, sender));
32
+ (uint64 registeredEon , uint64 registeredTimestamp ) = shutterRegistry
33
+ .registrations (identity);
39
34
40
35
//verifying registered timestamp
41
36
assertEqUint (registeredEon, eon);
@@ -57,26 +52,18 @@ contract ShutterRegistryTest is Test{
57
52
);
58
53
59
54
hoax (sender);
60
- shutterRegistry.register (
61
- eon,
62
- identityPrefix,
63
- timestamp
64
- );
55
+ shutterRegistry.register (eon, identityPrefix, timestamp);
65
56
66
57
uint64 newTimestamp = uint64 (block .timestamp ) + 200 ;
67
58
vm.expectRevert (ShutterRegistry.AlreadyRegistered.selector );
68
59
hoax (sender);
69
- shutterRegistry.register (
70
- eon,
71
- identityPrefix,
72
- newTimestamp
73
- );
60
+ shutterRegistry.register (eon, identityPrefix, newTimestamp);
74
61
75
62
//verifying registered timestamp
76
- bytes32 identity = keccak256 (
77
- abi.encodePacked (identityPrefix, sender)
63
+ bytes32 identity = keccak256 (abi.encodePacked (identityPrefix, sender));
64
+ (, uint64 registeredTimestamp ) = shutterRegistry.registrations (
65
+ identity
78
66
);
79
- (, uint64 registeredTimestamp ) = shutterRegistry.registrations (identity);
80
67
assertEqUint (registeredTimestamp, timestamp);
81
68
}
82
69
@@ -88,11 +75,7 @@ contract ShutterRegistryTest is Test{
88
75
89
76
vm.expectRevert (ShutterRegistry.TimestampInThePast.selector );
90
77
hoax (sender);
91
- shutterRegistry.register (
92
- eon,
93
- identityPrefix,
94
- timestamp
95
- );
78
+ shutterRegistry.register (eon, identityPrefix, timestamp);
96
79
}
97
80
98
81
function testMissingIdentity () public {
@@ -104,10 +87,6 @@ contract ShutterRegistryTest is Test{
104
87
105
88
vm.expectRevert (ShutterRegistry.InvalidIdentityPrefix.selector );
106
89
hoax (sender);
107
- shutterRegistry.register (
108
- eon,
109
- identityPrefix,
110
- timestamp
111
- );
90
+ shutterRegistry.register (eon, identityPrefix, timestamp);
112
91
}
113
- }
92
+ }
0 commit comments