Skip to content

Commit

Permalink
clear out last of skipped tests
Browse files Browse the repository at this point in the history
  • Loading branch information
0age committed Oct 14, 2024
1 parent d359143 commit 2ee9fc7
Showing 1 changed file with 0 additions and 116 deletions.
116 changes: 0 additions & 116 deletions test/TheCompact.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1853,120 +1853,4 @@ contract TheCompactTest is Test {
assertEq(theCompact.balanceOf(claimant, anotherId), anotherAmount);
assertEq(theCompact.balanceOf(claimant, aThirdId), aThirdAmount);
}

/* TODO: TURN THESE BACK ON ASAP
function test_delegatedWithdrawal() public {
ResetPeriod resetPeriod = ResetPeriod.TenMinutes;
Scope scope = Scope.Multichain;
uint256 amount = 1e18;
uint256 nonce = 0;
uint256 startTime = block.timestamp;
uint256 endTime = block.timestamp + 1000;
address recipient = 0x1111111111111111111111111111111111111111;
uint256 pledge = 0;
vm.prank(allocator);
uint96 allocatorId = theCompact.__register(allocator, "");
vm.prank(swapper);
uint256 id = theCompact.deposit{ value: amount }(allocator, resetPeriod, scope, swapper);
assertEq(theCompact.balanceOf(swapper, id), amount);
bytes32 digest = keccak256(
abi.encodePacked(
bytes2(0x1901),
theCompact.DOMAIN_SEPARATOR(),
keccak256(
abi.encode(
keccak256(
"DelegatedWithdrawal(address owner,uint256 startTime,uint256 endTime,uint256 nonce,uint256 id,uint256 amount,address recipient,uint256 pledge)"
),
swapper,
startTime,
endTime,
nonce,
id,
amount,
recipient,
pledge
)
)
)
);
(bytes32 r, bytes32 vs) = vm.signCompact(swapperPrivateKey, digest);
bytes memory ownerSignature = abi.encodePacked(r, vs);
(r, vs) = vm.signCompact(allocatorPrivateKey, digest);
bytes memory allocatorSignature = abi.encodePacked(r, vs);
bool status = theCompact.allocatedWithdrawalFrom(
swapper,
id,
amount,
nonce,
startTime,
endTime,
recipient,
pledge,
ownerSignature,
allocatorSignature
);
assert(status);
assertEq(address(theCompact).balance, 0);
assertEq(recipient.balance, amount);
assertEq(theCompact.balanceOf(swapper, id), 0);
assertEq(theCompact.balanceOf(recipient, id), 0);
}
function test_withdrawalViaAuthorization() public {
ResetPeriod resetPeriod = ResetPeriod.TenMinutes;
Scope scope = Scope.Multichain;
uint256 amount = 1e18;
uint256 nonce = 0;
uint256 expiration = block.timestamp + 1000;
address recipient = 0x1111111111111111111111111111111111111111;
vm.prank(allocator);
uint96 allocatorId = theCompact.__register(allocator, "");
vm.prank(swapper);
uint256 id =
theCompact.deposit(address(token), allocator, resetPeriod, scope, amount, swapper);
assertEq(theCompact.balanceOf(swapper, id), amount);
bytes32 digest = keccak256(
abi.encodePacked(
bytes2(0x1901),
theCompact.DOMAIN_SEPARATOR(),
keccak256(
abi.encode(
keccak256(
"WithdrawalAuthorization(address owner,uint256 expiration,uint256 nonce,uint256 id,uint256 amount)"
),
swapper,
expiration,
nonce,
id,
amount
)
)
)
);
(bytes32 r, bytes32 vs) = vm.signCompact(allocatorPrivateKey, digest);
bytes memory allocatorSignature = abi.encodePacked(r, vs);
vm.prank(swapper);
bool status = theCompact.allocatedWithdrawal(
id, amount, nonce, expiration, recipient, allocatorSignature
);
assert(status);
assertEq(token.balanceOf(address(theCompact)), 0);
assertEq(token.balanceOf(recipient), amount);
assertEq(theCompact.balanceOf(swapper, id), 0);
assertEq(theCompact.balanceOf(recipient, id), 0);
}
*/
}

0 comments on commit 2ee9fc7

Please sign in to comment.