Skip to content

Commit

Permalink
fix #164
Browse files Browse the repository at this point in the history
  • Loading branch information
otselnik committed Aug 11, 2021
1 parent c99b2f4 commit a25c15e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 5 additions & 1 deletion evm_loader/program/src/payment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use solana_program::{
system_instruction,
sysvar::{rent::Rent, Sysvar},
};
use std::str::FromStr;

/// `COLLATERAL_BASE_ADDRESS`
pub const COLLATERAL_BASE_ADDRESS: &str = "53DfF883gyixYNXnM7s5xhdeyV8mVk9T4i2hGV9vG9io";
Expand All @@ -26,6 +27,9 @@ pub const PAYMENT_TO_DEPOSIT: u64 = 1000;
/// Will return:
/// `ProgramError::InvalidArgument` if `collateral_pool_sol_info` owner not `program_id`
/// or its key is not equal to generated
/// # Panics
///
/// if `COLLATERAL_BASE_ADDRESS` is invalid
pub fn check_collateral_account(
program_id: &Pubkey,
collateral_pool_sol_info: &AccountInfo,
Expand All @@ -42,7 +46,7 @@ pub fn check_collateral_account(
}

let seed = format!("{}{}", COLLATERAL_SEED_PREFIX, collateral_pool_index);
let pool_key = Pubkey::create_with_seed(COLLATERAL_BASE_ADDRESS, &seed, program_id)?;
let pool_key = Pubkey::create_with_seed(&Pubkey::from_str(COLLATERAL_BASE_ADDRESS).unwrap(), &seed, program_id)?;
if *collateral_pool_sol_info.key != pool_key {
debug_print!("Wrong seed pool key {}", pool_key);
debug_print!("Must be collateral pool key {}", *collateral_pool_sol_info.key);
Expand Down
1 change: 0 additions & 1 deletion evm_loader/program/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use solana_program::{
account_info::AccountInfo,
entrypoint::{ ProgramResult },
program_error::{ProgramError},
pubkey::Pubkey,
secp256k1_program,
};
use std::convert::{Into, TryFrom};
Expand Down

0 comments on commit a25c15e

Please sign in to comment.