Cleanup program account def (#5833)

This commit is contained in:
Jack May
2019-09-06 17:32:14 -07:00
committed by GitHub
parent 81c36699c4
commit 1833db51a5
7 changed files with 86 additions and 53 deletions

View File

@ -3,10 +3,9 @@
#![allow(unreachable_code)]
extern crate solana_sdk;
use solana_sdk::entrypoint::*;
use solana_sdk::log::*;
use solana_sdk::pubkey::Pubkey;
use solana_sdk::{entrypoint, info};
use solana_sdk::{
account_info::AccountInfo, entrypoint, entrypoint::SUCCESS, info, log::*, pubkey::Pubkey,
};
#[derive(Debug, PartialEq)]
struct SStruct {
@ -21,7 +20,7 @@ fn return_sstruct() -> SStruct {
}
entrypoint!(process_instruction);
fn process_instruction(program_id: &Pubkey, ka: &mut [SolKeyedAccount], data: &[u8]) -> u32 {
fn process_instruction(program_id: &Pubkey, accounts: &mut [AccountInfo], data: &[u8]) -> u32 {
info!("Program identifier:");
program_id.log();
@ -29,7 +28,7 @@ fn process_instruction(program_id: &Pubkey, ka: &mut [SolKeyedAccount], data: &[
// the no-op program, no account keys or input data are expected but real
// programs will have specific requirements so they can do their work.
info!("Account keys and instruction input data:");
sol_log_params(ka, data);
sol_log_params(accounts, data);
{
// Test - use std methods, unwrap