File tree Expand file tree Collapse file tree 7 files changed +14
-12
lines changed Expand file tree Collapse file tree 7 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ export function toWrappedMethod(
95
95
const stateTransitionsHash = toStateTransitionsHash ( stateTransitions ) ;
96
96
const eventsHash = toEventsHash ( events ) ;
97
97
98
- const { name, runtime } = this ;
98
+ const { name, parent : runtime } = this ;
99
99
100
100
if ( name === undefined ) {
101
101
throw errors . runtimeNameNotSet ( ) ;
@@ -275,10 +275,10 @@ function runtimeMethodInternal(options: {
275
275
executionContext . beforeMethod ( constructorName , methodName , args ) ;
276
276
277
277
if ( executionContext . isTopLevel ) {
278
- if ( ! this . runtime ) {
278
+ if ( ! this . parent ) {
279
279
throw errors . runtimeNotProvided ( constructorName ) ;
280
280
}
281
- executionContext . setProver ( prover . bind ( this . runtime . zkProgrammable ) ) ;
281
+ executionContext . setProver ( prover . bind ( this . parent . zkProgrammable ) ) ;
282
282
}
283
283
284
284
let result : unknown ;
Original file line number Diff line number Diff line change @@ -371,7 +371,7 @@ export class Runtime<Modules extends RuntimeModulesRecord>
371
371
containedModule : InstanceType < Modules [ StringKeyOf < Modules > ] >
372
372
) {
373
373
containedModule . name = moduleName ;
374
- containedModule . runtime = this ;
374
+ containedModule . parent = this ;
375
375
376
376
super . decorateModule ( moduleName , containedModule ) ;
377
377
}
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ export class RuntimeModule<
75
75
76
76
public name ?: string ;
77
77
78
- public runtime ?: RuntimeEnvironment ;
78
+ public parent ?: RuntimeEnvironment ;
79
79
80
80
public events ?: RuntimeEvents < any > = undefined ;
81
81
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ export function state() {
38
38
throw errors . missingName ( self . constructor . name ) ;
39
39
}
40
40
41
- if ( ! self . runtime ) {
41
+ if ( ! self . parent ) {
42
42
throw errors . missingRuntime ( self . constructor . name ) ;
43
43
}
44
44
@@ -48,7 +48,7 @@ export function state() {
48
48
49
49
// TODO: why is this complaining about `any`?
50
50
51
- value . stateServiceProvider = self . runtime . stateServiceProvider ;
51
+ value . stateServiceProvider = self . parent . stateServiceProvider ;
52
52
}
53
53
return value ;
54
54
} ,
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ export class Protocol<
93
93
containedModule : InstanceType < Modules [ StringKeyOf < Modules > ] >
94
94
) {
95
95
log . debug ( `Decorated ${ moduleName } ` ) ;
96
- containedModule . protocol = this ;
96
+ containedModule . parent = this ;
97
97
98
98
if ( containedModule instanceof TransitioningProtocolModule ) {
99
99
containedModule . name = moduleName ;
Original file line number Diff line number Diff line change @@ -11,10 +11,10 @@ import { ProtocolEnvironment } from "./ProtocolEnvironment";
11
11
export abstract class ProtocolModule <
12
12
Config = NoConfig ,
13
13
> extends ConfigurableModule < Config > {
14
- public protocol ?: ProtocolEnvironment ;
14
+ public parent ?: ProtocolEnvironment ;
15
15
16
16
public get areProofsEnabled ( ) : AreProofsEnabled | undefined {
17
- return this . protocol ?. getAreProofsEnabled ( ) ;
17
+ return this . parent ?. getAreProofsEnabled ( ) ;
18
18
}
19
19
20
20
public create ( childContainerProvider : ChildContainerProvider ) : void {
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ const errors = {
16
16
) ,
17
17
} ;
18
18
19
+ // TODO Homogenize @protocolState () towards a single @state() API
20
+
19
21
/**
20
22
* Decorates a runtime module property as state, passing down some
21
23
* underlying values to improve developer experience.
@@ -40,15 +42,15 @@ export function protocolState() {
40
42
throw errors . missingName ( self . constructor . name ) ;
41
43
}
42
44
43
- if ( ! self . protocol ) {
45
+ if ( ! self . parent ) {
44
46
throw errors . missingProtocol ( self . constructor . name ) ;
45
47
}
46
48
47
49
// TODO Add Prefix?
48
50
const path = Path . fromProperty ( self . name , propertyKey ) ;
49
51
if ( value ) {
50
52
value . path = path ;
51
- value . stateServiceProvider = self . protocol . stateServiceProvider ;
53
+ value . stateServiceProvider = self . parent . stateServiceProvider ;
52
54
}
53
55
return value ;
54
56
} ,
You can’t perform that action at this time.
0 commit comments