Skip to content

Commit

Permalink
fix: dont use getAgreement from executor
Browse files Browse the repository at this point in the history
  • Loading branch information
pociej committed Jun 14, 2024
1 parent 5b81ebd commit b0e3daa
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion backend/src/services/yagna/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,17 @@ export class Yagna {
//which is HARDCODED in yagna we make worker which under the hood makes activity
// which prevents agreement from closing
const worker = await this.getUserWorker(userId);
const agreement = await executor.getAgreement();

const agreement = await worker.context?.activity.agreement;

if (!agreement) {
throw new Error({
code: ErrorCode.AGREEMENT_NOT_FOUND,
payload: {
agreementId: "",
},
});
}
container.cradle.userService.setCurrentAgreementId(userId, agreement.id);
agreement.events.on("terminated", (e: any) => {
this.agreementEvents.next({
Expand Down

0 comments on commit b0e3daa

Please sign in to comment.