Update wallet to pass full ELFs (#1738)

This commit is contained in:
jackcmay
2018-11-08 09:03:48 -08:00
committed by GitHub
parent 6721bdde3d
commit d2dc585974
2 changed files with 14 additions and 10 deletions

View File

@ -117,6 +117,14 @@ $ solana-wallet send-timestamp <PUBKEY> <PROCESS_ID> --date 2018-12-24T23:59:00
<TX_SIGNATURE>
```
### Deploy program
```
// Command
$ solana-wallet deploy <PATH>
// Return
<PROGRAM_ID>
```
## Javascript solana-web3.js Interface

View File

@ -7,7 +7,6 @@ use chrono::prelude::*;
use clap::ArgMatches;
use cluster_info::NodeInfo;
use drone::DroneRequest;
use elf;
use fullnode::Config;
use hash::Hash;
use loader_transaction::LoaderTransaction;
@ -31,7 +30,6 @@ use std::{error, fmt, mem};
use system_transaction::SystemTransaction;
use transaction::Transaction;
const PLATFORM_SECTION_C: &str = ".text.entrypoint";
const USERDATA_CHUNK_SIZE: usize = 256;
#[derive(Debug, PartialEq)]
@ -396,16 +394,14 @@ pub fn process_command(config: &WalletConfig) -> Result<String, Box<error::Error
let last_id = get_last_id(&config)?;
let program = Keypair::new();
let program_userdata = elf::File::open_path(program_location)
let mut program_userdata = Vec::new();
File::open(program_location)
.map_err(|_| {
WalletError::DynamicProgramError("Could not parse program file".to_string())
})?.get_section(PLATFORM_SECTION_C)
.ok_or_else(|| {
WalletError::DynamicProgramError(
"Could not find entrypoint in program file".to_string(),
)
})?.data
.clone();
})?.read_to_end(&mut program_userdata)
.map_err(|_| {
WalletError::DynamicProgramError("Could not read program file".to_string())
})?;
let tx = Transaction::system_create(
&config.id,