Add rand dependency test (#12566)

* Add rand dependency test

* nudge
This commit is contained in:
Jack May
2020-09-29 17:25:51 -07:00
committed by GitHub
parent d158d45051
commit 777342a1ef
7 changed files with 60 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
# Note: This crate must be built using do.sh
[package]
name = "solana-bpf-rust-rand"
version = "1.4.0"
description = "Solana BPF test program written in Rust"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
edition = "2018"
[dependencies]
getrandom = { version = "0.1.14", features = ["dummy"] }
rand = "0.7"
solana-sdk = { path = "../../../../sdk/", version = "1.4.0", default-features = false }
[features]
program = ["solana-sdk/program"]
default = ["program", "solana-sdk/default"]
[lib]
name = "solana_bpf_rust_rand"
crate-type = ["cdylib"]
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

View File

@@ -0,0 +1,2 @@
[target.bpfel-unknown-unknown.dependencies.std]
features = []

View File

@@ -0,0 +1,18 @@
//! @brief Example Rust-based BPF program that tests rand behavior
#![allow(unreachable_code)]
extern crate solana_sdk;
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!("rand");
Ok(())
}