Skip to content

Commit

Permalink
Merge pull request #224 from fukaoi/hotfix/ignore-dasUri
Browse files Browse the repository at this point in the history
Hotfix/ignore das uri
  • Loading branch information
fukaoi authored Mar 5, 2024
2 parents c362a03 + 38595d2 commit 55d21a0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
26 changes: 18 additions & 8 deletions packages/transaction-builder/src/priority-fee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,29 @@ export namespace TransactionBuilder {
debugLog('# estimates: ', estimates);
try {
// priority fee: medium
const lamports = estimates.isOk
? estimates.unwrap().medium
: MINIMUM_PRIORITY_FEE;
const lamports =
estimates.isOk && estimates.unwrap().medium !== 0
? estimates.unwrap().medium
: MINIMUM_PRIORITY_FEE;
debugLog('# lamports: ', lamports);
return sendTransactionWithPriorityFee(lamports, transaction, signers);
return await sendTransactionWithPriorityFee(
lamports,
transaction,
signers,
);
} catch (error) {
debugLog('# priority fee error: ', error);
// priority fee: high
const lamports = estimates.isOk
? estimates.unwrap().high
: MINIMUM_PRIORITY_FEE;
const lamports =
estimates.isOk && estimates.unwrap().high !== 0
? estimates.unwrap().high
: MINIMUM_PRIORITY_FEE;
debugLog('# lamports: ', lamports);
return sendTransactionWithPriorityFee(lamports, transaction, signers);
return await sendTransactionWithPriorityFee(
lamports,
transaction,
signers,
);
}
};

Expand Down
2 changes: 1 addition & 1 deletion packages/transaction-builder/test/priority-fee.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ test('[PartialSignStructure]Set priority fee', async (t) => {
);
});

test.only('[BatchStructure]Set priority fee', async (t) => {
test('[BatchStructure]Set priority fee', async (t) => {
const TOKEN_METADATA = {
name: 'solana-suite-token',
symbol: 'SST',
Expand Down

0 comments on commit 55d21a0

Please sign in to comment.