diff --git a/web3.js/examples/bpf-rust-noop/Cargo.toml b/web3.js/examples/bpf-rust-noop/Cargo.toml index a2a197c158..0072181963 100644 --- a/web3.js/examples/bpf-rust-noop/Cargo.toml +++ b/web3.js/examples/bpf-rust-noop/Cargo.toml @@ -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 "] 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"] diff --git a/web3.js/examples/bpf-rust-noop/src/lib.rs b/web3.js/examples/bpf-rust-noop/src/lib.rs index eac48afbc5..960ad4c8a7 100644 --- a/web3.js/examples/bpf-rust-noop/src/lib.rs +++ b/web3.js/examples/bpf-rust-noop/src/lib.rs @@ -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 diff --git a/web3.js/package.json b/web3.js/package.json index 64a2932bb3..aa952c5ab1 100644 --- a/web3.js/package.json +++ b/web3.js/package.json @@ -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",