Adapt to workspace crate

This commit is contained in:
Michael Vines 2020-08-07 10:09:06 -07:00
parent c6042f68f7
commit 20c7bd1611
2 changed files with 3 additions and 3 deletions

2
do.sh
View File

@ -28,7 +28,7 @@ profile=bpfel-unknown-unknown/release
perform_action() {
set -e
projectDir="$PWD"/$2
targetDir="$projectDir"/target
targetDir="$PWD"/target
features=
if [[ -f "$projectDir"/Xargo.toml ]]; then
features="--features=program"

View File

@ -11,7 +11,7 @@ use num_traits::FromPrimitive;
#[cfg(not(target_arch = "bpf"))]
use solana_sdk::instruction::Instruction;
#[cfg(target_arch = "bpf")]
use solana_sdk::program::invoke_signed;
use solana_sdk::program::{create_program_address, invoke_signed};
use solana_sdk::{
account_info::next_account_info, account_info::AccountInfo, decode_error::DecodeError,
entrypoint::ProgramResult, info, program_error::PrintProgramError, program_error::ProgramError,
@ -80,7 +80,7 @@ impl State {
/// Calculates the authority id by generating a program address.
pub fn authority_id(program_id: &Pubkey, my_info: &Pubkey) -> Result<Pubkey, Error> {
Pubkey::create_program_address(&[&my_info.to_bytes()[..32]], program_id)
create_program_address(&[&my_info.to_bytes()[..32]], program_id)
.or(Err(Error::InvalidProgramAddress))
}
/// Issue a spl_token `Burn` instruction.