22pragma solidity ^ 0.8.0 ;
33
44// Target contracts
5- import { ByocRegistry } from "contracts/ByocRegistry .sol " ;
6- import "contracts/interfaces/IByocRegistry .sol " ;
5+ import { ContractPublisher } from "contracts/ContractPublisher .sol " ;
6+ import "contracts/interfaces/IContractPublisher .sol " ;
77import "contracts/TWRegistry.sol " ;
88
99// Test helpers
@@ -18,7 +18,7 @@ contract MockCustomContract {
1818 }
1919}
2020
21- contract IByocRegistryData {
21+ contract IContractPublisherData {
2222 /// @dev Emitted when the registry is paused.
2323 event Paused (bool isPaused );
2424
@@ -29,7 +29,7 @@ contract IByocRegistryData {
2929 event ContractPublished (
3030 address indexed operator ,
3131 address indexed publisher ,
32- IByocRegistry .CustomContractInstance publishedContract
32+ IContractPublisher .CustomContractInstance publishedContract
3333 );
3434
3535 /// @dev Emitted when a contract is unpublished.
@@ -42,8 +42,8 @@ contract IByocRegistryData {
4242 event RemovedContractToPublicList (address indexed publisher , string indexed contractId );
4343}
4444
45- contract ByocRegistryTest is BaseTest , IByocRegistryData {
46- ByocRegistry internal byoc;
45+ contract ContractPublisherTest is BaseTest , IContractPublisherData {
46+ ContractPublisher internal byoc;
4747 TWRegistry internal twRegistry;
4848
4949 address internal publisher;
@@ -55,7 +55,7 @@ contract ByocRegistryTest is BaseTest, IByocRegistryData {
5555 function setUp () public override {
5656 super .setUp ();
5757
58- byoc = ByocRegistry (byocRegistry );
58+ byoc = ContractPublisher (contractPublisher );
5959 twRegistry = TWRegistry (registry);
6060
6161 publisher = getActor (0 );
@@ -74,7 +74,10 @@ contract ByocRegistryTest is BaseTest, IByocRegistryData {
7474 contractId
7575 );
7676
77- IByocRegistry.CustomContractInstance memory customContract = byoc.getPublishedContract (publisher, contractId);
77+ IContractPublisher.CustomContractInstance memory customContract = byoc.getPublishedContract (
78+ publisher,
79+ contractId
80+ );
7881
7982 assertEq (customContract.contractId, contractId);
8083 assertEq (customContract.publishMetadataUri, publishMetadataUri);
@@ -97,7 +100,10 @@ contract ByocRegistryTest is BaseTest, IByocRegistryData {
97100 contractId
98101 );
99102
100- IByocRegistry.CustomContractInstance memory customContract = byoc.getPublishedContract (publisher, contractId);
103+ IContractPublisher.CustomContractInstance memory customContract = byoc.getPublishedContract (
104+ publisher,
105+ contractId
106+ );
101107
102108 assertEq (customContract.contractId, contractId);
103109 assertEq (customContract.publishMetadataUri, publishMetadataUri);
@@ -144,13 +150,14 @@ contract ByocRegistryTest is BaseTest, IByocRegistryData {
144150 vm.prank (publisher);
145151 byoc.approveOperator (operator, true );
146152
147- IByocRegistry.CustomContractInstance memory expectedCustomContract = IByocRegistry.CustomContractInstance ({
148- contractId: contractId,
149- publishTimestamp: 100 ,
150- publishMetadataUri: publishMetadataUri,
151- bytecodeHash: keccak256 (type (MockCustomContract).creationCode),
152- implementation: address (0 )
153- });
153+ IContractPublisher.CustomContractInstance memory expectedCustomContract = IContractPublisher
154+ .CustomContractInstance ({
155+ contractId: contractId,
156+ publishTimestamp: 100 ,
157+ publishMetadataUri: publishMetadataUri,
158+ bytecodeHash: keccak256 (type (MockCustomContract).creationCode),
159+ implementation: address (0 )
160+ });
154161
155162 vm.expectEmit (true , true , true , true );
156163 emit ContractPublished (operator, publisher, expectedCustomContract);
@@ -181,7 +188,10 @@ contract ByocRegistryTest is BaseTest, IByocRegistryData {
181188 vm.prank (publisher);
182189 byoc.unpublishContract (publisher, contractId);
183190
184- IByocRegistry.CustomContractInstance memory customContract = byoc.getPublishedContract (publisher, contractId);
191+ IContractPublisher.CustomContractInstance memory customContract = byoc.getPublishedContract (
192+ publisher,
193+ contractId
194+ );
185195
186196 assertEq (customContract.contractId, "" );
187197 assertEq (customContract.publishMetadataUri, "" );
@@ -207,7 +217,10 @@ contract ByocRegistryTest is BaseTest, IByocRegistryData {
207217 vm.prank (operator);
208218 byoc.unpublishContract (publisher, contractId);
209219
210- IByocRegistry.CustomContractInstance memory customContract = byoc.getPublishedContract (publisher, contractId);
220+ IContractPublisher.CustomContractInstance memory customContract = byoc.getPublishedContract (
221+ publisher,
222+ contractId
223+ );
211224
212225 assertEq (customContract.contractId, "" );
213226 assertEq (customContract.publishMetadataUri, "" );
0 commit comments