Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
iainnash committed Sep 27, 2023
1 parent a12a5d9 commit ae17f8a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/upgrades/UpgradeGate.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {UpgradeGateStorageV1} from "./UpgradeGateStorageV1.sol";
/// @notice Contract for managing upgrades and safe upgrade paths for 1155 contracts
contract UpgradeGate is IUpgradeGate, Ownable2StepUpgradeable, UpgradeGateStorageV1 {
/// @notice Constructor for deployment pathway
constructor(address _defaultOwner) {
constructor(address _defaultOwner) initializer {
__Ownable_init(_defaultOwner);
emit UpgradeGateSetup();
}
Expand Down
8 changes: 6 additions & 2 deletions test/factory/ZoraCreator1155Factory.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {IZoraCreator1155Errors} from "../../src/interfaces/IZoraCreator1155Error
import {IMinter1155} from "../../src/interfaces/IMinter1155.sol";
import {ICreatorRoyaltiesControl} from "../../src/interfaces/ICreatorRoyaltiesControl.sol";
import {Zora1155} from "../../src/proxies/Zora1155.sol";
import {UpgradeGate} from "../../src/upgrades/UpgradeGate.sol";
import {MockContractMetadata} from "../mock/MockContractMetadata.sol";
import {ProxyShim} from "../../src/utils/ProxyShim.sol";

Expand All @@ -21,16 +22,19 @@ contract ZoraCreator1155FactoryTest is Test {

ZoraCreator1155FactoryImpl internal factoryImpl;
ZoraCreator1155FactoryImpl internal factory;
UpgradeGate internal upgradeGate;

function setUp() external {
zora = makeAddr("zora");
mintFeeAmount = 0.000777 ether;

upgradeGate = new UpgradeGate(zora);

address factoryShimAddress = address(new ProxyShim(zora));
Zora1155Factory factoryProxy = new Zora1155Factory(factoryShimAddress, "");

ProtocolRewards protocolRewards = new ProtocolRewards();
ZoraCreator1155Impl zoraCreator1155Impl = new ZoraCreator1155Impl(mintFeeAmount, zora, address(factoryProxy), address(protocolRewards));
ZoraCreator1155Impl zoraCreator1155Impl = new ZoraCreator1155Impl(mintFeeAmount, zora, address(upgradeGate), address(protocolRewards));

factoryImpl = new ZoraCreator1155FactoryImpl(zoraCreator1155Impl, IMinter1155(address(1)), IMinter1155(address(2)), IMinter1155(address(3)));
factory = ZoraCreator1155FactoryImpl(address(factoryProxy));
Expand Down Expand Up @@ -253,7 +257,7 @@ contract ZoraCreator1155FactoryTest is Test {
baseImpls[0] = address(factory.implementation());

vm.prank(zora);
factory.registerUpgradePath(baseImpls, address(newZoraCreator));
upgradeGate.registerUpgradePath(baseImpls, address(newZoraCreator));

vm.prank(creatorProxy.owner());
creatorProxy.upgradeTo(address(newZoraCreator));
Expand Down
9 changes: 5 additions & 4 deletions test/nft/ZoraCreator1155.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,18 @@ contract ZoraCreator1155Test is Test {

admin = payable(vm.addr(0x1));
recipient = vm.addr(0x2);
adminRole = target.PERMISSION_BIT_ADMIN();
minterRole = target.PERMISSION_BIT_MINTER();
fundsManagerRole = target.PERMISSION_BIT_FUNDS_MANAGER();
metadataRole = target.PERMISSION_BIT_METADATA();

protocolRewards = new ProtocolRewards();
upgradeGate = new UpgradeGate(admin);
zoraCreator1155Impl = new ZoraCreator1155Impl(0, zora, address(upgradeGate), address(protocolRewards));
target = ZoraCreator1155Impl(address(new Zora1155(address(zoraCreator1155Impl))));
simpleMinter = new SimpleMinter();
fixedPriceMinter = new ZoraCreatorFixedPriceSaleStrategy();

adminRole = target.PERMISSION_BIT_ADMIN();
minterRole = target.PERMISSION_BIT_MINTER();
fundsManagerRole = target.PERMISSION_BIT_FUNDS_MANAGER();
metadataRole = target.PERMISSION_BIT_METADATA();
}

function _emptyInitData() internal pure returns (bytes[] memory response) {
Expand Down

0 comments on commit ae17f8a

Please sign in to comment.