mirror of
https://github.com/Instadapp/dsa-periphery-contract.git
synced 2024-07-29 22:27:13 +00:00
update adapter unit test
This commit is contained in:
parent
9c75cdc05a
commit
cea5da6e4d
|
@ -18,6 +18,16 @@ contract MockInstadappReceiver is InstadappAdapter {
|
||||||
) external payable {
|
) external payable {
|
||||||
authCast(dsaAddress, auth, signature, castData, salt, deadline);
|
authCast(dsaAddress, auth, signature, castData, salt, deadline);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function tryVerify(
|
||||||
|
address auth,
|
||||||
|
bytes memory signature,
|
||||||
|
CastData memory castData,
|
||||||
|
bytes32 salt,
|
||||||
|
uint256 deadline
|
||||||
|
) external returns (bool) {
|
||||||
|
return verify(auth, signature, castData, salt, deadline);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
contract InstadappAdapterTest is TestHelper {
|
contract InstadappAdapterTest is TestHelper {
|
||||||
|
@ -139,7 +149,7 @@ contract InstadappAdapterTest is TestHelper {
|
||||||
|
|
||||||
address auth = originSender;
|
address auth = originSender;
|
||||||
vm.warp(timestamp);
|
vm.warp(timestamp);
|
||||||
assertEq(MockInstadappReceiver(instadappReceiver).verify(auth, signature, castData, salt, deadline), true);
|
assertEq(MockInstadappReceiver(instadappReceiver).tryVerify(auth, signature, castData, salt, deadline), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_InstadappAdapter__verify_shouldReturnFalse() public {
|
function test_InstadappAdapter__verify_shouldReturnFalse() public {
|
||||||
|
@ -162,6 +172,6 @@ contract InstadappAdapterTest is TestHelper {
|
||||||
|
|
||||||
address auth = originSender;
|
address auth = originSender;
|
||||||
bytes32 salt = bytes32(abi.encode(1));
|
bytes32 salt = bytes32(abi.encode(1));
|
||||||
assertEq(MockInstadappReceiver(instadappReceiver).verify(auth, signature, castData, salt, deadline), false);
|
assertEq(MockInstadappReceiver(instadappReceiver).tryVerify(auth, signature, castData, salt, deadline), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user