mirror of https://github.com/certusone/oyster.git
feat: change ownership of mem
This commit is contained in:
parent
a727c11b51
commit
390dea08a7
|
@ -31,6 +31,7 @@ export function createTempMemoryAccount(
|
|||
instructions: TransactionInstruction[],
|
||||
payer: PublicKey,
|
||||
signers: Account[],
|
||||
owner: PublicKey,
|
||||
space = DEFAULT_TEMP_MEM_SPACE
|
||||
) {
|
||||
const account = new Account();
|
||||
|
@ -38,10 +39,10 @@ export function createTempMemoryAccount(
|
|||
SystemProgram.createAccount({
|
||||
fromPubkey: payer,
|
||||
newAccountPubkey: account.publicKey,
|
||||
// 0 will evict/clost account since it cannot pay rent
|
||||
// 0 will evict/close account since it cannot pay rent
|
||||
lamports: 0,
|
||||
space: space,
|
||||
programId: TOKEN_PROGRAM_ID,
|
||||
programId: owner,
|
||||
})
|
||||
);
|
||||
|
||||
|
|
|
@ -170,7 +170,7 @@ export const borrow = async (
|
|||
? dexMarket?.info.asks
|
||||
: dexMarket?.info.bids;
|
||||
|
||||
const memory = createTempMemoryAccount(instructions, wallet.publicKey, signers);
|
||||
const memory = createTempMemoryAccount(instructions, wallet.publicKey, signers, LENDING_PROGRAM_ID);
|
||||
|
||||
// Creates host fee account if it doesn't exsist
|
||||
let hostFeeReceiver = LEND_HOST_FEE_ADDRESS
|
||||
|
|
|
@ -90,7 +90,7 @@ export const liquidate = async (
|
|||
? dexMarket?.info.asks
|
||||
: dexMarket?.info.bids;
|
||||
|
||||
const memory = createTempMemoryAccount(instructions, wallet.publicKey, signers);
|
||||
const memory = createTempMemoryAccount(instructions, wallet.publicKey, signers, LENDING_PROGRAM_ID);
|
||||
|
||||
instructions.push(
|
||||
liquidateInstruction(
|
||||
|
|
Loading…
Reference in New Issue