Skip to content

Commit

Permalink
Merge branch 'develop' into fix/yoojin/reject_when_tx_failed
Browse files Browse the repository at this point in the history
  • Loading branch information
yoojinko authored Dec 21, 2023
2 parents 5b254c3 + edcd0d7 commit beda727
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/controllers/serviceController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ export default class ServiceController {
return await this.ain.getValue(creditHistoryPath) as creditHistories;
}

async request(serviceName: string, requestData: any) : Promise<any> {
async request(serviceName: string, requestData: any, requestKey?: string) : Promise<any> {
this.checkRunning(serviceName);
const result = await new Promise(async (resolve, reject) => {
const requestKey = Date.now();
requestKey = requestKey || Date.now().toString();
try {
const requesterAddress = this.ain.getAddress();
const responsePath = Path.app(serviceName).response(requesterAddress, requestKey.toString());
Expand Down
4 changes: 2 additions & 2 deletions src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ export default class Service {
* @param {string} requestData String data for request to service.
* @returns {string} Response data from service.
*/
async request(requestData: any) {
async request(requestData: any, requestKey?: string) {
this.isLoggedIn();
return await this.serviceController.request(this.serviceName, requestData);
return await this.serviceController.request(this.serviceName, requestData, requestKey);
}

/**
Expand Down

0 comments on commit beda727

Please sign in to comment.