This repository has been archived by the owner on Feb 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 267
Debug Conductor API #1661
Merged
Merged
Debug Conductor API #1661
Changes from 8 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
527eb09
Extract state dump code into type StateDump with From<Arc<Context>>
lucksus 3cf65b4
Add conductor functions debug/running_instances and debug/state_dump
lucksus 0136d9f
Adds debug/fetch_cas
lucksus e8b19e7
Rustdoc for new conductor api functions
lucksus c7560d7
Add debug functions to admin interfaces
lucksus eae186e
rustfmt
lucksus 2c7fbb0
Add source chain to state dump
lucksus afdda71
changelog
lucksus f1c163d
Reverse source chain ordering for state dump object, not only rendering
lucksus c70700c
Fix doc comment on debug/running_instances
lucksus bb05a7b
Fix build for the reversing of the source chain on state dump
lucksus 1cc6ecc
Merge branch 'develop' into debug-conductor-api
lucksus 1b466df
trigger AV CI
lucksus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
use conductor::Conductor; | ||
use holochain_core::state_dump::StateDump; | ||
use holochain_core_types::error::HolochainError; | ||
use holochain_persistence_api::cas::content::Address; | ||
|
||
pub trait ConductorDebug { | ||
fn running_instances(&self) -> Result<Vec<String>, HolochainError>; | ||
fn state_dump_for_instance(&self, instance_id: &String) -> Result<StateDump, HolochainError>; | ||
fn get_type_and_content_from_cas( | ||
&self, | ||
address: &Address, | ||
instance_id: &String, | ||
) -> Result<(String, String), HolochainError>; | ||
} | ||
|
||
impl ConductorDebug for Conductor { | ||
fn running_instances(&self) -> Result<Vec<String>, HolochainError> { | ||
Ok(self.instances.keys().cloned().collect()) | ||
} | ||
|
||
fn state_dump_for_instance(&self, instance_id: &String) -> Result<StateDump, HolochainError> { | ||
let hc = self.instances.get(instance_id)?; | ||
Ok(hc.read().unwrap().get_state_dump()?) | ||
} | ||
|
||
fn get_type_and_content_from_cas( | ||
&self, | ||
address: &Address, | ||
instance_id: &String, | ||
) -> Result<(String, String), HolochainError> { | ||
let hc = self.instances.get(instance_id)?; | ||
Ok(hc.read().unwrap().get_type_and_content_from_cas(address)?) | ||
} | ||
} |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could use
HcResult
instead ofResult
here and several other places, but not terribly important.