-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose stdout/stderr in Session (#2189)
This PR: - Makes explicit the notion that 0=stdin, 1=stdout, 2=stdout in the QueryCallback's "FS" - Exposes the outputs in Session - Removes printing to stdout and stderr in the callback itself. This is now the responsibility of the host if needed. - Adds the Fibonacci test with stdout to CI using the write mechanism The idea is that after this we should also expose the proof's publics and make a stream mechanism for inputs and outputs
- Loading branch information
1 parent
6897f9b
commit 60860b7
Showing
11 changed files
with
80 additions
and
23 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use powdr::Session; | ||
|
||
fn main() { | ||
env_logger::init(); | ||
|
||
let n = 11; | ||
let mut session = Session::builder() | ||
.guest_path("./examples/fibonacci/guest") | ||
.out_path("powdr-target") | ||
.build() | ||
.write(0, &n); | ||
|
||
// Fast dry run to test execution. | ||
session.run(); | ||
|
||
let r: u32 = session.stdout(); | ||
assert_eq!(r, 89); | ||
|
||
session.prove(); | ||
|
||
let r: u32 = session.stdout(); | ||
assert_eq!(r, 89); | ||
} |
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