Open
Conversation
apoelstra
reviewed
Jan 13, 2021
| (x, y) => { | ||
| let red = "\x1b[0;31m"; | ||
| let nc = "\x1b[0m"; | ||
| let green = "\x1b[0;32m"; |
Member
There was a problem hiding this comment.
I think we need to come up with a different encoding scheme. It doesn't have to be pretty, we could provide a shellscript or something that converted it into a colorized version.
But using shell escape sequences means that we won't work on windows and are likely to confuse other command line tools.
sanket1729
added a commit
to sanket1729/rust-miniscript
that referenced
this pull request
Oct 1, 2021
e829434 Implemented Policy Diff (sanket1729) 4d23b79 Pretty print a policy (sanket1729) Pull request description: Adds methods to pretty print policies similar to directory tree printing in Linux. Prints diff in colors which highlights the differences between the two policies. Our representation of Semantic policies in only in Thresh, so we combine `or(pk,or(pk,pk))` into `thresh(1,pk,pk,pk)`. And so we use the latter in comparing two policies that complicate some of the implementation but is still fairly small. Top commit has no ACKs. Tree-SHA512: 8efd11b2c2582a4e26455ccb718d1ad2016ead3507746bd98a16240c7c72cf411df7fa01d817aee3a42c138b8ff7b887e7104d29d15f7a57a61620eee20a9d2b
apoelstra
reviewed
Nov 24, 2021
| } | ||
|
|
||
| /// Pretty Print a tree | ||
| pub fn pprint_tree(&self) { |
Member
There was a problem hiding this comment.
In 4d23b79:
Can we make this pub(crate)? I think we can come up with a much better API here and I'd rather not expose this one.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds methods to pretty print policies similar to directory tree printing in Linux. Prints diff in colors which highlights the differences between the two policies.
Our representation of Semantic policies in only in Thresh, so we combine
or(pk,or(pk,pk))intothresh(1,pk,pk,pk). And so we use the latter in comparing two policies that complicate some of the implementation but is still fairly small.