Test SeraiKeyWasNone

This commit is contained in:
Luke Parker
2025-01-24 06:58:54 -05:00
parent 164fe9a14f
commit cefc542744
3 changed files with 42 additions and 4 deletions

View File

@@ -45,6 +45,8 @@ interface IRouterWithoutCollisions {
/// @param amount The amount which escaped
event Escaped(address indexed coin, uint256 amount);
/// @notice The Serai key verifying the signature wasn't set
error SeraiKeyWasNone();
/// @notice The key for Serai was invalid
/// @dev This is incomplete and not always guaranteed to be thrown upon an invalid key
error InvalidSeraiKey();

View File

@@ -137,7 +137,7 @@ contract Router is IRouterWithoutCollisions {
The Schnorr contract should already reject this public key yet it's best to be explicit.
*/
if (key == bytes32(0)) {
revert InvalidSignature();
revert SeraiKeyWasNone();
}
message = msg.data;
@@ -266,7 +266,7 @@ contract Router is IRouterWithoutCollisions {
function inInstruction(address coin, uint256 amount, bytes memory instruction) external payable {
// Check there is an active key
if (_seraiKey == bytes32(0)) {
revert InvalidSeraiKey();
revert SeraiKeyWasNone();
}
// Don't allow further InInstructions once the escape hatch has been invoked