Skip to content

Commit

Permalink
fix(test): adapt
Browse files Browse the repository at this point in the history
  • Loading branch information
zgorizzo69 committed Feb 18, 2022
1 parent 44da98b commit 159ccab
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 26 deletions.
36 changes: 16 additions & 20 deletions contracts/facets/DiamondLoupeFacet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,61 +16,57 @@ contract DiamondLoupeFacet is IDiamondLoupe, IERC165 {
// }

/// @notice Gets all facets and their selectors.
/// @return facets Facet
function facets() external view override returns (Facet[] memory facets) {
/// @return res Facet
function facets() external view override returns (Facet[] memory res) {
LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();
uint256 numFacets = ds.facetAddresses.length;
facets = new Facet[](numFacets);
res = new Facet[](numFacets);
for (uint256 i; i < numFacets; i++) {
address facetAddress = ds.facetAddresses[i];
facets[i].facetAddress = facetAddress;
facets[i].functionSelectors = ds
.facetFunctionSelectors[facetAddress]
address facetAddr = ds.facetAddresses[i];
res[i].facetAddress = facetAddr;
res[i].functionSelectors = ds
.facetFunctionSelectors[facetAddr]
.functionSelectors;
}
}

/// @notice Gets all the function selectors provided by a facet.
/// @param facet The facet address.
/// @return facetFunctionSelectors
/// @return funcSelectors
function facetFunctionSelectors(address facet)
external
view
override
returns (bytes4[] memory facetFunctionSelectors)
returns (bytes4[] memory funcSelectors)
{
LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();
facetFunctionSelectors = ds
.facetFunctionSelectors[facet]
.functionSelectors;
funcSelectors = ds.facetFunctionSelectors[facet].functionSelectors;
}

/// @notice Get all the facet addresses used by a diamond.
/// @return facetAddresses
/// @return facetsAdr
function facetAddresses()
external
view
override
returns (address[] memory facetAddresses)
returns (address[] memory facetsAdr)
{
LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();
facetAddresses = ds.facetAddresses;
facetsAdr = ds.facetAddresses;
}

/// @notice Gets the facet that supports the given selector.
/// @dev If facet is not found return address(0).
/// @param functionSelector The function selector.
/// @return facetAddress The facet address.
/// @return facet The facet address.
function facetAddress(bytes4 functionSelector)
external
view
override
returns (address facetAddress)
returns (address facet)
{
LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();
facetAddress = ds
.selectorToFacetAndPosition[functionSelector]
.facetAddress;
facet = ds.selectorToFacetAndPosition[functionSelector].facetAddress;
}

// This implements ERC-165.
Expand Down
1 change: 1 addition & 0 deletions contracts/facets/FoundryFacet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {LibMeToken, MeTokenInfo} from "../libs/LibMeToken.sol";
import {LibHub, HubInfo} from "../libs/LibHub.sol";
import {LibWeightedAverage} from "../libs/LibWeightedAverage.sol";
import {Modifiers} from "../libs/Details.sol";
import {LibMeta} from "../libs/LibMeta.sol";

contract FoundryFacet is IFoundry, Modifiers {
// MINT FLOW CHART
Expand Down
1 change: 1 addition & 0 deletions contracts/facets/HubFacet.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {LibMeta} from "../libs/LibMeta.sol";
import {LibDiamond} from "../libs/LibDiamond.sol";
import {LibHub, HubInfo} from "../libs/LibHub.sol";
import {Modifiers} from "../libs/Details.sol";
Expand Down
1 change: 1 addition & 0 deletions contracts/facets/MeTokenRegistryFacet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {IVault} from "../interfaces/IVault.sol";
import {ICurve} from "../interfaces/ICurve.sol";
import {IMeToken} from "../interfaces/IMeToken.sol";
import {HubInfo, MeTokenInfo, Modifiers} from "../libs/Details.sol";
import {LibMeta} from "../libs/LibMeta.sol";

/// @title meToken registry
/// @author Carl Farterson (@carlfarterson)
Expand Down
9 changes: 3 additions & 6 deletions contracts/facets/OwnershipFacet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@ contract OwnershipFacet is Modifiers {
s.diamondController = newController;
}

function setTrustedForwarder(address trustedForwarder)
function setTrustedForwarder(address forwarder)
external
onlyDiamondController
{
require(
trustedForwarder != s.trustedForwarder,
"same trustedForwarder"
);
s.trustedForwarder = trustedForwarder;
require(forwarder != s.trustedForwarder, "same trustedForwarder");
s.trustedForwarder = forwarder;
}

function setFeesController(address newController)
Expand Down

0 comments on commit 159ccab

Please sign in to comment.