Fix clippy and lint issues in BPF test program (#5607)

* Revert "Add test program for BPF memory corruption bug (#5603)"

This reverts commit 63d62c33c6.

* Revert "Revert "Add test program for BPF memory corruption bug (#5603)""

This reverts commit 9502082cdaf2be6b28b365be645c52e0f9c7da4d.

* Fix clippy and fmt issues
This commit is contained in:
Justin Starry 2019-08-22 15:38:46 -04:00 committed by GitHub
parent 51cf559ce1
commit 19d16e75c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 9 deletions

View File

@ -9,14 +9,13 @@ extern crate alloc;
extern crate solana_sdk_bpf_no_std;
extern crate solana_sdk_bpf_utils;
use alloc::vec::Vec;
use solana_sdk_bpf_utils::info;
use solana_sdk_bpf_utils::entrypoint;
use solana_sdk_bpf_utils::entrypoint::{SolKeyedAccount, SolClusterInfo};
use solana_bpf_rust_stack_bug_dep::{InitPollData, PollData};
use solana_sdk_bpf_utils::entrypoint;
use solana_sdk_bpf_utils::entrypoint::{SolClusterInfo, SolKeyedAccount};
use solana_sdk_bpf_utils::info;
entrypoint!(process_instruction);
fn process_instruction(ka: &mut [SolKeyedAccount], _info: &SolClusterInfo, _data: &[u8]) -> bool {
fn process_instruction(_ka: &mut [SolKeyedAccount], _info: &SolClusterInfo, _data: &[u8]) -> bool {
let header = vec![1u8; 6];
let option_a = vec![1u8; 1];
let option_b = vec![1u8; 1];

View File

@ -4,12 +4,10 @@
#![allow(unused_attributes)]
extern crate alloc;
#[cfg(not(test))]
extern crate solana_sdk_bpf_no_std;
extern crate solana_sdk_bpf_utils;
use alloc::vec::Vec;
use solana_sdk_bpf_utils::entrypoint::{SolPubkey};
use solana_sdk_bpf_utils::entrypoint::SolPubkey;
pub struct InitPollData<'a> {
pub timeout: u32,
@ -56,7 +54,7 @@ impl<'a> PollData<'a> {
assert_eq!(init.timeout, 10);
Self {
creator_key,
last_block: slot + init.timeout as u64,
last_block: slot + u64::from(init.timeout),
header_len: init.header_len,
header: init.header,
option_a: PollOptionData {