Skip to content

Commit 9d1a39c

Browse files
committed
Integrate commands for compute from policy server.
1 parent 8a510b1 commit 9d1a39c

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

src/components/policyServer/index.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,23 +109,17 @@ export class PolicyServer {
109109
return await this.askServer(command)
110110
}
111111

112-
// use checkDownload functionality for initializeCompute and startCompute,
113-
// it will do the same credentials checks
114112
async checkInitializeCompute(
115113
documentId: string,
116114
ddo: DDO,
117115
serviceId: string,
118-
fileIndex: number,
119-
transferTxId: string,
120116
consumerAddress: string,
121117
policyServer: any
122118
): Promise<PolicyServerResult> {
123-
return await this.checkDownload(
119+
return await this.checkInitialize(
124120
documentId,
125121
ddo,
126122
serviceId,
127-
fileIndex,
128-
transferTxId,
129123
consumerAddress,
130124
policyServer
131125
)
@@ -140,15 +134,17 @@ export class PolicyServer {
140134
consumerAddress: string,
141135
policyServer: any
142136
): Promise<PolicyServerResult> {
143-
return await this.checkDownload(
137+
const command = {
138+
action: 'startCompute',
144139
documentId,
145140
ddo,
146141
serviceId,
147142
fileIndex,
148143
transferTxId,
149144
consumerAddress,
150145
policyServer
151-
)
146+
}
147+
return await this.askServer(command)
152148
}
153149

154150
async passThrough(request: any): Promise<PolicyServerResult> {

0 commit comments

Comments
 (0)