Fix syscall featurization (#12714)

* Fix syscall featurization

* nudge
This commit is contained in:
Jack May
2020-10-07 18:38:38 -07:00
committed by GitHub
parent 346890ded3
commit dd7fae4afb
4 changed files with 83 additions and 34 deletions

View File

@ -6,14 +6,30 @@ use solana_sdk::{
info,
};
#[no_mangle]
pub extern "C" fn entrypoint(_input: *mut u8) -> u64 {
info!("sha256");
fn test_hasher() {
let vals = &["Gaggablaghblagh!".as_ref(), "flurbos".as_ref()];
let mut hasher = Hasher::default();
hasher.hashv(vals);
assert_eq!(hashv(vals), hasher.result());
}
#[no_mangle]
pub extern "C" fn entrypoint(_input: *mut u8) -> u64 {
info!("sha256");
test_hasher();
0
}
#[cfg(test)]
mod test {
use super::*;
// Pull in syscall stubs when building for non-BPF targets
solana_sdk::program_stubs!();
#[test]
fn test_sha256() {
test_hasher();
}
}