mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Test SeraiKeyWasNone
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user