fix: update rust example to latest solana sdk

This commit is contained in:
Jack May 2020-02-25 09:48:12 -08:00 committed by Michael Vines
parent e3516bbcfd
commit 11db9497a7
3 changed files with 12 additions and 7 deletions

View File

@ -3,7 +3,7 @@
[package]
name = "solana-bpf-rust-noop"
version = "0.19.0-pre0"
version = "0.1.0"
description = "Solana BPF noop program written in Rust"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"
@ -12,7 +12,13 @@ homepage = "https://solana.com/"
edition = "2018"
[dependencies]
num-derive = "0.2"
num-traits = "0.2"
solana-sdk = { git = "https://github.com/solana-labs/solana", default-features = false }
thiserror = "1.0"
[dev_dependencies]
solana-sdk-bpf-test = { path = "../../bpf-sdk/rust/test"}
[features]
program = ["solana-sdk/program"]

View File

@ -4,8 +4,7 @@
extern crate solana_sdk;
use solana_sdk::{
account_info::AccountInfo, entrypoint, info, log::*, program_error::ProgramError,
pubkey::Pubkey,
account_info::AccountInfo, entrypoint, entrypoint::ProgramResult, info, log::*, pubkey::Pubkey,
};
#[derive(Debug, PartialEq)]
@ -24,8 +23,8 @@ entrypoint!(process_instruction);
fn process_instruction(
program_id: &Pubkey,
accounts: &[AccountInfo],
ix_data: &[u8],
) -> Result<(), ProgramError> {
instruction_data: &[u8],
) -> ProgramResult {
info!("Program identifier:");
program_id.log();
@ -33,7 +32,7 @@ fn process_instruction(
// 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(accounts, ix_data);
sol_log_params(accounts, instruction_data);
{
// Test - use std methods, unwrap

View File

@ -37,7 +37,7 @@
"/src"
],
"scripts": {
"bpf-sdk:install": "bin/bpf-sdk-install.sh",
"bpf-sdk:install": "bin/bpf-sdk-install.sh .",
"bpf-sdk:remove-symlinks": "find bpf-sdk -type l -print -exec cp {} {}.tmp \\; -exec mv {}.tmp {} \\;",
"build": "cross-env NODE_ENV=production rollup -c",
"build:fixtures": "./test/fixtures/noop-c/build.sh; ./test/fixtures/noop-rust/build.sh",