This is useful for verifiers to enforce behaviour and avoid mismanaging
the witnesses that need to be input into the circuit when verifying
a proof.
Note that the prover still has to manage this by themself. There
might be some way to generalise this, but in practice, when creating
a ZK proof, the prover should always be aware of what witnesses they
should be inputting, so this can be represented procedurally in the
code without the need of an abstraction.
Another good approach as well is to consider everyting inside
rayon_pool.install() as the main() function and do things in there for
some weird simplicity. With this, one does not need to use another
channel to get a value out of the closure.
discard empty connections efficiently and only render when is_empty
== false.
for outbound connections, use iter().all() to ensure that is_empty is
only set to false when all slots are empty.
Previously, we were trying to render messages using a seperate widget
called Paragraph. This would enable us to put msgs on the right of the
screen using the enum Alignment.
However, rendering msgs as a seperate widget meant we had to keep track
of the position of other widgets in order to align properly. This quickly
became highly complex.
Instead, we have now rendered all the data in a single widget called List.
List is composed of a ListItem which is composed of Spans. Spans
indiciate a seperate line whereas Span is a grapheme on a single line.
We render addrs and msgs on the same line as follows:
lines.push(Spans::from(vec![addr, msgs])
Where lines is a Vec<Spans> that initializes ListItem.
We are currently aligning the msgs Span with empty spaces, which is the
method used by tui-rs/example/list.rs. Ideally we would use some variant
of Alignment for this so we don't have variation between screen sizes.