Skip to content

Commit

Permalink
duplicated error removal
Browse files Browse the repository at this point in the history
  • Loading branch information
alistair-singh committed Dec 19, 2024
1 parent 89b9e09 commit 8899527
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions contracts/src/Assets.sol
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ library Assets {
error TokenAlreadyRegistered();
error TokenMintFailed();
error TokenTransferFailed();
error TokenAmountTooLow();

function isTokenRegistered(address token) external view returns (bool) {
return AssetsStorage.layout().tokenRegistry[token].isRegistered;
Expand Down Expand Up @@ -156,7 +155,7 @@ library Assets {
} else {
// Native ETH
if (msg.value < amount) {
revert TokenAmountTooLow();
revert InvalidAmount();
}
payable($.assetHubAgent).safeNativeTransfer(amount);
ticket.value = amount;
Expand Down
1 change: 0 additions & 1 deletion contracts/src/Gateway.sol
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ contract Gateway is IGateway, IInitializable, IUpgradable {
error InvalidAgentExecutionPayload();
error InvalidConstructorParams();
error TokenNotRegistered();
error TokenAmountTooLow();

// Message handlers can only be dispatched by the gateway itself
modifier onlySelf() {
Expand Down
2 changes: 1 addition & 1 deletion contracts/test/Gateway.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ contract GatewayTest is Test {

uint128 fee = uint128(IGateway(address(gateway)).quoteSendTokenFee(address(0), paraID, amount));

vm.expectRevert(Gateway.TokenAmountTooLow.selector);
vm.expectRevert(Assets.InvalidAmount.selector);
hoax(user, amount + fee);
IGateway(address(gateway)).sendToken{value: amount - 1}(address(0), paraID, recipientAddress32, 1, amount);
}
Expand Down

0 comments on commit 8899527

Please sign in to comment.