Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solana: add priority fee to redeem transactions #1795

Merged
merged 8 commits into from
Mar 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
log errors
artursapek committed Mar 18, 2024

Verified

This commit was signed with the committer’s verified signature.
artursapek Artur Sapek
commit 74c390ad953796808089fccff3ba974b733a77b7
6 changes: 6 additions & 0 deletions sdk/src/contexts/solana/utils/computeBudget/index.ts
Original file line number Diff line number Diff line change
@@ -34,6 +34,12 @@ export async function determineComputeBudget(
try {
const simulateResponse = await connection.simulateTransaction(transaction);

if (simulateResponse.value.err) {
console.error(
`Error simulating Solana transaction: ${simulateResponse.value.err}`,
);
}

if (simulateResponse?.value?.unitsConsumed) {
// Set compute budget to 120% of the units used in the simulated transaction
computeBudget = Math.round(simulateResponse.value.unitsConsumed * 1.2);

Unchanged files with check annotations Beta

this.state = { hasError: false };
}
static getDerivedStateFromError(error: any) {

Check warning on line 13 in wormhole-connect/src/components/ErrorBoundary.tsx

GitHub Actions / lint

'error' is defined but never used
return { hasError: true };
}
right?: JSX.Element;
};
const useStyles = makeStyles()((theme) => ({

Check warning on line 11 in wormhole-connect/src/components/Input.tsx

GitHub Actions / lint

'theme' is defined but never used
inputContent: {
display: 'flex',
flexDirection: 'row',
import { NestedRow } from 'routes/types';
import Price from './Price';
const useStyles = makeStyles()((theme) => ({

Check warning on line 9 in wormhole-connect/src/components/RenderRows.tsx

GitHub Actions / lint

'theme' is defined but never used
row: {
display: 'flex',
justifyContent: 'space-between',
import Box from '@mui/material/Box';
import { useTheme } from '@mui/material/styles';
const useStyles = makeStyles()((theme) => ({

Check warning on line 8 in wormhole-connect/src/components/Tabs.tsx

GitHub Actions / lint

'theme' is defined but never used
tabs: {
display: 'flex',
flexDirection: 'row',
token?: TokenConfig,
destToken?: TokenConfig,
sourceChain?: ChainName | ChainId,
destChain?: ChainName | ChainId,

Check warning on line 34 in wormhole-connect/src/routes/bridge/baseRoute.ts

GitHub Actions / lint

'destChain' is defined but never used
): Promise<boolean> {
if (!token) return false;
// if (destToken) {
}
async isRouteAvailable(
sourceToken: string,

Check warning on line 102 in wormhole-connect/src/routes/bridge/baseRoute.ts

GitHub Actions / lint

'sourceToken' is defined but never used
destToken: string,

Check warning on line 103 in wormhole-connect/src/routes/bridge/baseRoute.ts

GitHub Actions / lint

'destToken' is defined but never used
amount: string,

Check warning on line 104 in wormhole-connect/src/routes/bridge/baseRoute.ts

GitHub Actions / lint

'amount' is defined but never used
sourceChain: ChainName | ChainId,

Check warning on line 105 in wormhole-connect/src/routes/bridge/baseRoute.ts

GitHub Actions / lint

'sourceChain' is defined but never used
destChain: ChainName | ChainId,

Check warning on line 106 in wormhole-connect/src/routes/bridge/baseRoute.ts

GitHub Actions / lint

'destChain' is defined but never used
): Promise<boolean> {
return true;
}