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

@@ -2,21 +2,13 @@
pub mod ristretto;
extern crate solana_sdk;
use crate::ristretto::ristretto_mul;
use curve25519_dalek::{constants::RISTRETTO_BASEPOINT_POINT, scalar::Scalar};
use solana_sdk::{
account_info::AccountInfo, entrypoint, entrypoint::ProgramResult, info, pubkey::Pubkey,
};
entrypoint!(process_instruction);
fn process_instruction(
_program_id: &Pubkey,
_accounts: &[AccountInfo],
_instruction_data: &[u8],
) -> ProgramResult {
info!("Ristretto multiply");
fn test_ristretto_mul() -> ProgramResult {
let point = RISTRETTO_BASEPOINT_POINT;
let scalar = Scalar::zero();
let result = ristretto_mul(&point, &scalar)?;
@@ -29,3 +21,28 @@ fn process_instruction(
Ok(())
}
entrypoint!(process_instruction);
fn process_instruction(
_program_id: &Pubkey,
_accounts: &[AccountInfo],
_instruction_data: &[u8],
) -> ProgramResult {
info!("Ristretto multiply");
test_ristretto_mul()?;
Ok(())
}
#[cfg(test)]
mod test {
use super::*;
// Pull in syscall stubs when building for non-BPF targets
solana_sdk::program_stubs!();
#[test]
fn test_ristretto() {
test_ristretto_mul().unwrap();
}
}