Skip to content
This repository has been archived by the owner on Dec 9, 2023. It is now read-only.

Commit

Permalink
return assessment from run_method
Browse files Browse the repository at this point in the history
  • Loading branch information
weswalla committed Apr 7, 2023
1 parent a2fca1f commit f3e5cf0
Showing 1 changed file with 8 additions and 44 deletions.
52 changes: 8 additions & 44 deletions src/sensemaker_dna/sensemaker/neighbourhood.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ export default () => {
method_eh: createMethodEntryHash,
};

const runMethodOutput: EntryHash = await callZomeAlice(
const runMethodOutput: Assessment = await callZomeAlice(
"sensemaker",
"run_method",
runMethodInput,
Expand All @@ -396,13 +396,6 @@ export default () => {

await pause(pauseDuration);

const readObjectiveAssessmentOutput: Record = await callZomeBob(
"sensemaker",
"get_assessment",
runMethodOutput,
true
);

const objectiveAssessment: Assessment = {
value: {
Integer:
Expand All @@ -416,9 +409,7 @@ export default () => {
};
t.deepEqual(
objectiveAssessment,
decode(
(readObjectiveAssessmentOutput.entry as any).Present.entry
) as any
runMethodOutput
);
} catch (e) {
console.log(e);
Expand Down Expand Up @@ -794,7 +785,7 @@ export default () => {
method_eh: createMethodEntryHash,
};

const runMethodOutput: EntryHash = await callZomeAlice(
const runMethodOutput: Assessment = await callZomeAlice(
"sensemaker",
"run_method",
runMethodInput,
Expand All @@ -807,7 +798,7 @@ export default () => {
method_eh: createMethodEntryHash,
};

const runMethodOutput2: EntryHash = await callZomeAlice(
const runMethodOutput2: Assessment = await callZomeAlice(
"sensemaker",
"run_method",
runMethodInput2,
Expand All @@ -820,7 +811,7 @@ export default () => {
method_eh: createMethodEntryHash,
};

const runMethodOutput3: EntryHash = await callZomeAlice(
const runMethodOutput3: Assessment = await callZomeAlice(
"sensemaker",
"run_method",
runMethodInput3,
Expand All @@ -830,13 +821,6 @@ export default () => {

await pause(pauseDuration);

const readObjectiveAssessmentOutput: Record = await callZomeBob(
"sensemaker",
"get_assessment",
runMethodOutput,
true
);

const objectiveAssessment: Assessment = {
value: {
Integer:
Expand All @@ -851,16 +835,7 @@ export default () => {
};
t.deepEqual(
objectiveAssessment,
decode(
(readObjectiveAssessmentOutput.entry as any).Present.entry
) as any
);

const readObjectiveAssessmentOutput2: Record = await callZomeBob(
"sensemaker",
"get_assessment",
runMethodOutput2,
true
runMethodOutput
);

const objectiveAssessment2: Assessment = {
Expand All @@ -877,16 +852,7 @@ export default () => {
};
t.deepEqual(
objectiveAssessment2,
decode(
(readObjectiveAssessmentOutput2.entry as any).Present.entry
) as any
);

const readObjectiveAssessmentOutput3: Record = await callZomeBob(
"sensemaker",
"get_assessment",
runMethodOutput3,
true
runMethodOutput2
);

const objectiveAssessment3: Assessment = {
Expand All @@ -903,9 +869,7 @@ export default () => {
};
t.deepEqual(
objectiveAssessment3,
decode(
(readObjectiveAssessmentOutput3.entry as any).Present.entry
) as any
runMethodOutput3
);

// create context and threshold
Expand Down

0 comments on commit f3e5cf0

Please sign in to comment.