Skip to content

Commit

Permalink
Merge branch 'main' into update-verify-script
Browse files Browse the repository at this point in the history
  • Loading branch information
AStox committed Jul 12, 2024
2 parents 1564c3d + b6aa122 commit dca96e5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/unit/gateway/GasService.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ contract GasServiceTest is Test {
}

function testDeployment() public {
service = new GasService(MESSAGE_COST, PROOF_COST, GAS_PRICE, TOKEN_PRICE);
assertEq(service.wards(address(this)), 1);
assertEq(service.messageCost(), MESSAGE_COST);
assertEq(service.proofCost(), PROOF_COST);
Expand All @@ -40,6 +41,10 @@ contract GasServiceTest is Test {

vm.expectRevert(bytes("GasService/file-unrecognized-param"));
service.file(what, messageCost);

vm.prank(makeAddr("unauthorized"));
vm.expectRevert("Auth/not-authorized");
service.file("messageCost", messageCost);
}

function testUpdateGasPrice(uint128 value) public {
Expand All @@ -66,11 +71,19 @@ contract GasServiceTest is Test {
service.updateGasPrice(value, futureDate);
assertEq(service.gasPrice(), value);
assertEq(service.lastUpdatedAt(), futureDate);

vm.prank(makeAddr("unauthorized"));
vm.expectRevert("Auth/not-authorized");
service.updateGasPrice(value, futureDate);
}

function testUpdateTokenPrice(uint256 value) public {
service.updateTokenPrice(value);
assertEq(service.tokenPrice(), value);

vm.prank(makeAddr("unauthorized"));
vm.expectRevert("Auth/not-authorized");
service.updateTokenPrice(value);
}

function testEstimateFunction(bytes calldata message) public {
Expand Down
4 changes: 4 additions & 0 deletions test/unit/gateway/adapters/axelar/Adapter.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ contract AxelarAdapterTest is Test {

vm.expectRevert(bytes("AxelarAdapterfile-unrecognized-param"));
adapter.file("random", value);

vm.prank(makeAddr("unauthorized"));
vm.expectRevert("Auth/not-authorized");
adapter.file("axelarCost", value);
}

function testPayment(bytes calldata payload, uint256 value) public {
Expand Down

0 comments on commit dca96e5

Please sign in to comment.