@@ -5,6 +5,7 @@ import isEmpty from 'lodash.isempty';
5
5
import App from '../application/App' ;
6
6
import Package from '../application/Package' ;
7
7
import ProxyAdmin from '../proxy/ProxyAdmin' ;
8
+ import ProxyAdminProjectMixin from './mixin/ProxyAdminProjectMixin' ;
8
9
import ImplementationDirectory from '../application/ImplementationDirectory' ;
9
10
import BasePackageProject from './BasePackageProject' ;
10
11
import SimpleProject from './SimpleProject' ;
@@ -37,7 +38,7 @@ interface ExistingAddresses {
37
38
proxyFactoryAddress ?: string ;
38
39
}
39
40
40
- export default class AppProject extends BasePackageProject {
41
+ class BaseAppProject extends BasePackageProject {
41
42
private name : string ;
42
43
private app : App ;
43
44
public proxyAdmin : ProxyAdmin ;
@@ -68,7 +69,7 @@ export default class AppProject extends BasePackageProject {
68
69
if ( ! await app . hasPackage ( name , version ) ) await app . setPackage ( name , thepackage . address , version ) ;
69
70
const proxyAdmin : ProxyAdmin | null = proxyAdminAddress ? await ProxyAdmin . fetch ( proxyAdminAddress , txParams ) : null ;
70
71
const proxyFactory = ProxyFactory . tryFetch ( proxyFactoryAddress , txParams ) ;
71
- const project : AppProject = new this ( app , name , version , proxyAdmin , proxyFactory , txParams ) ;
72
+ const project : AppProject = new AppProject ( app , name , version , proxyAdmin , proxyFactory , txParams ) ;
72
73
project . directory = directory ;
73
74
project . package = thepackage ;
74
75
return project ;
@@ -130,11 +131,6 @@ export default class AppProject extends BasePackageProject {
130
131
public getAdminAddress ( ) : Promise < string > {
131
132
return new Promise ( ( resolve ) => resolve ( this . proxyAdmin ? this . proxyAdmin . address : null ) ) ;
132
133
}
133
-
134
- public async transferAdminOwnership ( newAdminOwner : string ) : Promise < void > {
135
- await this . proxyAdmin . transferOwnership ( newAdminOwner ) ;
136
- }
137
-
138
134
public getApp ( ) : App {
139
135
return this . app ;
140
136
}
@@ -237,10 +233,6 @@ export default class AppProject extends BasePackageProject {
237
233
return this . proxyAdmin . upgradeProxy ( proxyAddress , implementationAddress , contract , initMethod , initArgs ) ;
238
234
}
239
235
240
- public async changeProxyAdmin ( proxyAddress : string , newAdmin : string ) : Promise < void > {
241
- return this . proxyAdmin . changeProxyAdmin ( proxyAddress , newAdmin ) ;
242
- }
243
-
244
236
public async getDependencyPackage ( name : string ) : Promise < Package > {
245
237
const packageInfo = await this . app . getPackage ( name ) ;
246
238
return packageInfo . package ;
@@ -275,3 +267,6 @@ export default class AppProject extends BasePackageProject {
275
267
}
276
268
}
277
269
}
270
+ // Mixings produce value but not type
271
+ // We have to export full class with type & callable
272
+ export default class AppProject extends ProxyAdminProjectMixin ( BaseAppProject ) { } ;
0 commit comments