Remove hardcoded instances of the bridge pubkey in the program

Change-Id: I42bc36fa9db650b9cab6c6ac4c8e7c969487a40f
This commit is contained in:
Hendrik Hofstadt 2021-08-06 12:20:04 +02:00
parent 86cd27c919
commit 3fb493cb23
2 changed files with 2 additions and 8 deletions

View File

@ -7,7 +7,6 @@ use solana_program::{
pubkey::Pubkey,
sysvar,
};
use std::str::FromStr;
use byteorder::{
BigEndian,
@ -246,8 +245,6 @@ pub fn upgrade_contract(
&solana_program::bpf_loader_upgradeable::id(),
);
let own_address = Pubkey::from_str("Bridge1p5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o").unwrap();
Instruction {
program_id,
@ -260,7 +257,7 @@ pub fn upgrade_contract(
AccountMeta::new(spill, false),
AccountMeta::new(new_contract, false),
AccountMeta::new(program_data, false),
AccountMeta::new(own_address, false),
AccountMeta::new(program_id, false),
AccountMeta::new_readonly(sysvar::rent::id(), false),
AccountMeta::new_readonly(sysvar::clock::id(), false),
AccountMeta::new_readonly(solana_program::bpf_loader_upgradeable::id(), false),

View File

@ -41,7 +41,6 @@ use std::{
Deref,
DerefMut,
},
str::FromStr,
};
#[derive(Default, BorshSerialize, BorshDeserialize, Serialize, Deserialize)]
@ -199,9 +198,7 @@ pub struct PostedMessageData {
impl Owned for PostedMessage {
fn owner(&self) -> AccountOwner {
AccountOwner::Other(
Pubkey::from_str("Bridge1p5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o").unwrap(),
)
AccountOwner::This
}
}