mirror of https://github.com/certusone/oyster.git
Proposals: fix transaction signatures warnings (#55)
* chore: cleanup lint errors * fix: transaction signatures warnings * chore: cleanup code
This commit is contained in:
parent
ce7cb6729f
commit
92d2c151c2
|
@ -60,19 +60,31 @@ export function approve(
|
|||
delegate?: PublicKey,
|
||||
): Account {
|
||||
const tokenProgram = TOKEN_PROGRAM_ID;
|
||||
const transferAuthority = new Account();
|
||||
|
||||
instructions.push(
|
||||
Token.createApproveInstruction(
|
||||
tokenProgram,
|
||||
account,
|
||||
delegate ?? transferAuthority.publicKey,
|
||||
owner,
|
||||
[],
|
||||
amount,
|
||||
),
|
||||
const transferAuthority = new Account();
|
||||
const delegateKey = delegate ?? transferAuthority.publicKey;
|
||||
|
||||
const instruction = Token.createApproveInstruction(
|
||||
tokenProgram,
|
||||
account,
|
||||
delegateKey,
|
||||
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, []),
|
||||
|
|
|
@ -4,13 +4,7 @@ import {
|
|||
PublicKey,
|
||||
TransactionInstruction,
|
||||
} from '@solana/web3.js';
|
||||
import {
|
||||
contexts,
|
||||
utils,
|
||||
models,
|
||||
ParsedAccount,
|
||||
actions,
|
||||
} from '@oyster/common';
|
||||
import { contexts, utils, ParsedAccount, actions } from '@oyster/common';
|
||||
|
||||
import { TimelockConfig } from '../models/timelock';
|
||||
import { AccountLayout, Token } from '@solana/spl-token';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Button, Row, Spin } from 'antd';
|
||||
import { Row, Spin } from 'antd';
|
||||
import React from 'react';
|
||||
import { GUTTER } from '../../constants';
|
||||
import { contexts, hooks, ParsedAccount } from '@oyster/common';
|
||||
|
@ -6,7 +6,6 @@ import './style.less';
|
|||
import { useProposals } from '../../contexts/proposals';
|
||||
import { TimelockSet } from '../../models/timelock';
|
||||
import { Connection } from '@solana/web3.js';
|
||||
import { addCustomSingleSignerTransaction } from '../../actions/addCustomSingleSignerTransaction';
|
||||
import { WalletAdapter } from '@solana/wallet-base';
|
||||
const { useWallet } = contexts.Wallet;
|
||||
const { useConnection } = contexts.Connection;
|
||||
|
@ -36,8 +35,6 @@ export const DashboardView = () => {
|
|||
|
||||
function InnerDummyView({
|
||||
proposal,
|
||||
connection,
|
||||
wallet,
|
||||
}: {
|
||||
connection: Connection;
|
||||
wallet: WalletAdapter;
|
||||
|
|
|
@ -78,7 +78,7 @@ export const HomeView = () => {
|
|||
dataSource={listData}
|
||||
renderItem={item => (
|
||||
<List.Item
|
||||
key={item.title}
|
||||
key={item.configKey}
|
||||
className="governance-item"
|
||||
onClick={() => history.push(item.href)}
|
||||
extra={
|
||||
|
|
Loading…
Reference in New Issue