Skip to content

Commit

Permalink
Run forge fmt (Snowfork#1130)
Browse files Browse the repository at this point in the history
  • Loading branch information
alistair-singh authored Jan 30, 2024
1 parent 3c4fe56 commit 82d5de6
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 27 deletions.
6 changes: 1 addition & 5 deletions contracts/src/DeployScript.sol
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,7 @@ contract DeployScript is Script {

AgentExecutor executor = new AgentExecutor();
Gateway gatewayLogic = new Gateway(
address(beefyClient),
address(executor),
bridgeHubParaID,
bridgeHubAgentID,
foreignTokenDecimals
address(beefyClient), address(executor), bridgeHubParaID, bridgeHubAgentID, foreignTokenDecimals
);

bool rejectOutboundMessages = vm.envBool("REJECT_OUTBOUND_MESSAGES");
Expand Down
2 changes: 0 additions & 2 deletions contracts/src/Gateway.sol
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ contract Gateway is IGateway, IInitializable {
/**
* Getters
*/

function operatingMode() external view returns (OperatingMode) {
return CoreStorage.layout().mode;
}
Expand Down Expand Up @@ -396,7 +395,6 @@ contract Gateway is IGateway, IInitializable {
/**
* Assets
*/

function isTokenRegistered(address token) external view returns (bool) {
return Assets.isTokenRegistered(token);
}
Expand Down
4 changes: 3 additions & 1 deletion contracts/src/Types.sol
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ enum Command {
SetPricingParameters
}

enum AgentExecuteCommand {TransferToken}
enum AgentExecuteCommand {
TransferToken
}

/// @dev Application-level costs for a message
struct Costs {
Expand Down
1 change: 0 additions & 1 deletion contracts/src/interfaces/IGateway.sol
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ interface IGateway {
/**
* Getters
*/

function operatingMode() external view returns (OperatingMode);
function channelOperatingModeOf(ChannelID channelID) external view returns (OperatingMode);
function channelNoncesOf(ChannelID channelID) external view returns (uint64, uint64);
Expand Down
1 change: 0 additions & 1 deletion contracts/src/utils/Bitfield.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ library Bitfield {
* @dev Constants used to efficiently calculate the hamming weight of a bitfield. See
* https://en.wikipedia.org/wiki/Hamming_weight#Efficient_implementation for an explanation of those constants.
*/

uint256 internal constant M1 = 0x5555555555555555555555555555555555555555555555555555555555555555;
uint256 internal constant M2 = 0x3333333333333333333333333333333333333333333333333333333333333333;
uint256 internal constant M4 = 0x0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f;
Expand Down
1 change: 1 addition & 0 deletions contracts/src/utils/Math.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ library Math {
Ceil, // Toward positive infinity
Trunc, // Toward zero
Expand // Away from zero

}

/**
Expand Down
1 change: 0 additions & 1 deletion contracts/src/utils/Uint16Array.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ pragma solidity 0.8.23;
* above table counter XX is at logical index 22. It will convert to a physical index of 1 in the array and
* then to bit-index 96 to 111 of uint256[1].
*/

using {get, set} for Uint16Array global;

error IndexOutOfBounds();
Expand Down
18 changes: 3 additions & 15 deletions contracts/test/Gateway.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,8 @@ contract GatewayTest is Test {

function setUp() public {
AgentExecutor executor = new AgentExecutor();
gatewayLogic = new GatewayMock(
address(0),
address(executor),
bridgeHubParaID,
bridgeHubAgentID,
foreignTokenDecimals
);
gatewayLogic =
new GatewayMock(address(0), address(executor), bridgeHubParaID, bridgeHubAgentID, foreignTokenDecimals);
Gateway.Config memory config = Gateway.Config({
mode: OperatingMode.Normal,
deliveryCost: outboundFee,
Expand All @@ -110,10 +105,7 @@ contract GatewayTest is Test {
assetHubReserveTransferFee: sendTokenFee,
exchangeRate: exchangeRate
});
gateway = new GatewayProxy(
address(gatewayLogic),
abi.encode(config)
);
gateway = new GatewayProxy(address(gatewayLogic), abi.encode(config));
GatewayMock(address(gateway)).setCommitmentsAreVerified(true);

SetOperatingModeParams memory params = SetOperatingModeParams({mode: OperatingMode.Normal});
Expand Down Expand Up @@ -176,7 +168,6 @@ contract GatewayTest is Test {
/**
* Message Verification
*/

function testSubmitHappyPath() public {
deal(assetHubAgent, 50 ether);

Expand Down Expand Up @@ -344,7 +335,6 @@ contract GatewayTest is Test {
/**
* Handlers
*/

function testAgentExecution() public {
token.transfer(address(assetHubAgent), 200);

Expand Down Expand Up @@ -562,7 +552,6 @@ contract GatewayTest is Test {
/**
* Assets
*/

function testRegisterToken() public {
vm.expectEmit(false, false, false, true);
emit IGateway.TokenRegistrationSent(address(token));
Expand Down Expand Up @@ -679,7 +668,6 @@ contract GatewayTest is Test {
/**
* Operating Modes
*/

function testDisableOutboundMessaging() public {
// Let gateway lock up to 1 tokens
token.approve(address(gateway), 1);
Expand Down
1 change: 0 additions & 1 deletion contracts/test/mocks/GatewayUpgradeMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ contract GatewayUpgradeMock is IGateway, IInitializable {
/**
* Getters
*/

function operatingMode() external pure returns (OperatingMode) {
return OperatingMode.Normal;
}
Expand Down

0 comments on commit 82d5de6

Please sign in to comment.