Refactor docs and make Input API more explicit (#235)

This commit is contained in:
Han
2025-12-06 12:02:14 +09:00
committed by GitHub
parent 3d844b9f8b
commit 8f6cee8a32
64 changed files with 1297 additions and 456 deletions

View File

@@ -1 +0,0 @@
pub use sha2::Sha256;

View File

@@ -84,7 +84,7 @@ impl<P: Program> Deref for ProgramTestCase<P> {
impl<P: Program> TestCase for ProgramTestCase<P> {
fn input(&self) -> Input {
Input::new(P::Io::serialize_input(&self.input).unwrap())
Input::new().with_prefixed_stdin(P::Io::serialize_input(&self.input).unwrap())
}
fn assert_output(&self, public_values: &[u8]) {

View File

@@ -2,7 +2,6 @@
extern crate alloc;
pub mod guest;
pub mod program;
#[cfg(feature = "host")]

View File

@@ -1,5 +1,6 @@
use ere_io::Io;
use ere_platform_trait::Platform;
use ere_platform_trait::{OutputHashedPlatform, Platform};
use sha2::Sha256;
pub mod basic;
@@ -16,4 +17,8 @@ pub trait Program {
let output_bytes = Self::Io::serialize_output(&output).unwrap();
P::write_whole_output(&output_bytes);
}
fn run_output_sha256<P: Platform>() {
Self::run::<OutputHashedPlatform<P, Sha256>>()
}
}