From ef3c2c7ce4584cc49ecc03a6ac24881e71ad2149 Mon Sep 17 00:00:00 2001 From: salman01zp Date: Mon, 6 May 2024 19:07:07 +0530 Subject: [PATCH] yarn format --- .../contracts/contracts/SignatureBridge.sol | 6 +++++- .../contracts/contracts/utils/Governable.sol | 18 +++--------------- packages/vbridge/src/SignatureBridgeSide.ts | 4 ++-- 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/packages/contracts/contracts/SignatureBridge.sol b/packages/contracts/contracts/SignatureBridge.sol index 2f3dad35..e29a9c56 100644 --- a/packages/contracts/contracts/SignatureBridge.sol +++ b/packages/contracts/contracts/SignatureBridge.sol @@ -48,7 +48,11 @@ contract SignatureBridge is Governable, ChainIdWithType, ProposalNonceTracker { /// @param initialGovernor Addresses that should be initially granted the relayer role. /// @param jobId JobId of the governor. /// @param votingThreshold Number of votes required to force set the governor. - constructor(address initialGovernor, uint32 jobId, uint32 votingThreshold) Governable(initialGovernor, jobId, votingThreshold) {} + constructor( + address initialGovernor, + uint32 jobId, + uint32 votingThreshold + ) Governable(initialGovernor, jobId, votingThreshold) {} /// @notice Sets a new resource for handler contracts that use the IExecutor interface, /// and maps the {handlerAddress} to {newResourceID} in {_resourceIdToHandlerAddress}. diff --git a/packages/contracts/contracts/utils/Governable.sol b/packages/contracts/contracts/utils/Governable.sol index c7dcb267..2aac3a43 100644 --- a/packages/contracts/contracts/utils/Governable.sol +++ b/packages/contracts/contracts/utils/Governable.sol @@ -44,7 +44,6 @@ contract Governable { address indexed newOwner, uint32 indexed jobId, uint256 timestamp - ); event RecoveredAddress(address indexed recovered); @@ -62,14 +61,10 @@ contract Governable { _; } - /// @notice Checks if the vote nonces are valid. modifier areValidVotes(Vote[] memory votes) { for (uint i = 0; i < votes.length; i++) { - require( - votes[i].jobId < jobId, - "Governable: JobId of vote must match jobId" - ); + require(votes[i].jobId < jobId, "Governable: JobId of vote must match jobId"); require( votes[i].proposedGovernor != address(0x0), "Governable: Proposed governor cannot be the zero address" @@ -131,12 +126,7 @@ contract Governable { bytes32 pubKeyHash = keccak256(_publicKey); address newOwner = address(uint160(uint256(pubKeyHash))); require( - isSignatureFromGovernor( - abi.encodePacked( - _publicKey - ), - _sig - ), + isSignatureFromGovernor(abi.encodePacked(_publicKey), _sig), "Governable: caller is not the governor" ); _transferOwnership(newOwner, _jobId); @@ -173,7 +163,7 @@ contract Governable { } } } - + /// @notice Process a vote /// @param vote A vote struct /// @param voter The address of the voter @@ -247,6 +237,4 @@ contract Governable { ) public pure returns (Vote memory) { return Vote(_jobId, _proposedGovernor); } - - } diff --git a/packages/vbridge/src/SignatureBridgeSide.ts b/packages/vbridge/src/SignatureBridgeSide.ts index 22f76118..8d20983e 100644 --- a/packages/vbridge/src/SignatureBridgeSide.ts +++ b/packages/vbridge/src/SignatureBridgeSide.ts @@ -43,7 +43,7 @@ export class SignatureBridgeSide implements IBridgeSide * @param admin - The deployer and governor upon creation. */ public static async createBridgeSide( - admin: ethers.Wallet, + admin: ethers.Wallet ): Promise> { const bridgeFactory = new SignatureBridge__factory(admin); const deployedBridge = await bridgeFactory.deploy(admin.address, 0, 1); @@ -60,7 +60,7 @@ export class SignatureBridgeSide implements IBridgeSide public static async create2BridgeSide( deployer: Deployer, saltHex: string, - admin: ethers.Wallet, + admin: ethers.Wallet ): Promise> { const argTypes = ['address', 'uint32']; const args = [admin.address, 0, 1];