Skip to content

Commit d65be07

Browse files
committed
memory borrowing issues after rebasing
1 parent 5b2003b commit d65be07

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

program/rust/src/lib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ mod time_machine_types;
77
use crate::log::{post_log, pre_log};
88
use borsh::{BorshDeserialize, BorshSerialize};
99
use solana_program::entrypoint::deserialize;
10-
use solana_program::entrypoint::deserialize;
1110

1211
//Below is a high lever description of the rust/c setup.
1312

@@ -41,7 +40,7 @@ pub extern "C" fn c_entrypoint(input: *mut u8) -> u64 {
4140

4241
#[no_mangle]
4342
pub extern "C" fn entrypoint(input: *mut u8) -> u64 {
44-
let (_program_id, accounts, instruction_data) = unsafe { deserialize(input) };
43+
let (program_id, accounts, instruction_data) = unsafe { deserialize(input) };
4544

4645
match pre_log(&accounts, instruction_data) {
4746
Err(error) => return error.into(),
@@ -67,10 +66,10 @@ pub extern "C" fn entrypoint(input: *mut u8) -> u64 {
6766
c_oracle_header::command_t_e_cmd_upd_price
6867
| c_oracle_header::command_t_e_cmd_upd_price_no_fail_on_error
6968
| c_oracle_header::command_t_e_cmd_agg_price => {
70-
rust_oracle::update_price(program_id, accounts, instruction_data, input)
69+
rust_oracle::update_price(program_id, &accounts, &instruction_data, input)
7170
}
7271
c_oracle_header::command_t_e_cmd_upd_account_version => {
73-
rust_oracle::update_version(program_id, accounts, instruction_data)
72+
rust_oracle::update_version(program_id, &accounts, &instruction_data)
7473
}
7574
_ => unsafe { return c_entrypoint(input) },
7675
};

program/rust/src/rust_oracle.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use solana_program::sysvar::slot_history::AccountInfo;
66
///Calls the c oracle update_price, and updates the Time Machine if needed
77
pub fn update_price(
88
program_id: &Pubkey,
9-
accounts: Vec<AccountInfo>,
9+
accounts: &Vec<AccountInfo>,
1010
instruction_data: &[u8],
1111
input: *mut u8,
1212
) -> u64 {
@@ -25,7 +25,7 @@ pub fn update_price(
2525
/// updates the version number for all accounts, and resizes price accounts
2626
pub fn update_version(
2727
program_id: &Pubkey,
28-
accounts: Vec<AccountInfo>,
28+
accounts: &Vec<AccountInfo>,
2929
instruction_data: &[u8],
3030
) -> u64 {
3131
panic!("Need to merge fix to pythd in order to implement this");

0 commit comments

Comments
 (0)