mirror of https://github.com/certusone/oyster.git
Merge pull request #71 from SebastianBor/fix/transfer-authority-signers
Governance: Fix transfer authority signers
This commit is contained in:
commit
73fd0aac7e
|
@ -65,27 +65,17 @@ export function approve(
|
|||
const transferAuthority = existingTransferAuthority || new Account();
|
||||
const delegateKey = delegate ?? transferAuthority.publicKey;
|
||||
|
||||
const instruction = Token.createApproveInstruction(
|
||||
tokenProgram,
|
||||
account,
|
||||
delegateKey,
|
||||
owner,
|
||||
[],
|
||||
amount,
|
||||
instructions.push(
|
||||
Token.createApproveInstruction(
|
||||
tokenProgram,
|
||||
account,
|
||||
delegate ?? transferAuthority.publicKey,
|
||||
owner,
|
||||
[],
|
||||
amount,
|
||||
),
|
||||
);
|
||||
|
||||
// Temp. workaround for a bug in Token.createApproveInstruction which doesn't add the delegate account to signers
|
||||
instruction.keys = instruction.keys.map(k =>
|
||||
k.pubkey.equals(delegateKey)
|
||||
? {
|
||||
...k,
|
||||
isSigner: true,
|
||||
}
|
||||
: k,
|
||||
);
|
||||
|
||||
instructions.push(instruction);
|
||||
|
||||
if (autoRevoke) {
|
||||
cleanupInstructions.push(
|
||||
Token.createRevokeInstruction(tokenProgram, account, owner, []),
|
||||
|
|
|
@ -55,7 +55,7 @@ export const depositSourceTokensInstruction = (
|
|||
{ pubkey: sourceHoldingAccount, isSigner: false, isWritable: true },
|
||||
{ pubkey: votingMint, isSigner: false, isWritable: true },
|
||||
{ pubkey: timelockSetAccount, isSigner: false, isWritable: false },
|
||||
{ pubkey: transferAuthority, isSigner: false, isWritable: false },
|
||||
{ pubkey: transferAuthority, isSigner: true, isWritable: false },
|
||||
{ pubkey: mintAuthority, isSigner: false, isWritable: false },
|
||||
{ pubkey: PROGRAM_IDS.token, isSigner: false, isWritable: false },
|
||||
];
|
||||
|
|
Loading…
Reference in New Issue