-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from holonauts/feat/my-assigned-evaluations
Feat/my assigned evaluations
- Loading branch information
Showing
57 changed files
with
1,732 additions
and
2,669 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
dnas/grant_pools/zomes/coordinator/grants/src/evaluator_to_applications.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
use grants_integrity::*; | ||
use hdk::prelude::*; | ||
|
||
#[derive(Serialize, Deserialize, Debug)] | ||
pub struct AddApplicationForEvaluatorInput { | ||
pub base_evaluator: AgentPubKey, | ||
pub target_application_hash: ActionHash, | ||
} | ||
#[hdk_extern] | ||
pub fn add_application_for_evaluator(input: AddApplicationForEvaluatorInput) -> ExternResult<()> { | ||
create_link( | ||
input.base_evaluator.clone(), | ||
input.target_application_hash.clone(), | ||
LinkTypes::EvaluatorToApplications, | ||
(), | ||
)?; | ||
create_link( | ||
input.target_application_hash, | ||
input.base_evaluator, | ||
LinkTypes::ApplicationToEvaluators, | ||
(), | ||
)?; | ||
|
||
Ok(()) | ||
} | ||
|
||
#[hdk_extern] | ||
pub fn get_applications_for_evaluator(evaluator: AgentPubKey) -> ExternResult<Vec<Link>> { | ||
get_links(evaluator, LinkTypes::EvaluatorToApplications, None) | ||
} | ||
|
||
#[hdk_extern] | ||
pub fn get_evaluators_for_application(application_hash: ActionHash) -> ExternResult<Vec<Link>> { | ||
get_links(application_hash, LinkTypes::ApplicationToEvaluators, None) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.