Skip to content

Commit

Permalink
add support for priority fee (#1418)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dev Kalra authored Apr 4, 2024
1 parent ecf3479 commit 80b4dd9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 5 additions & 2 deletions contract_manager/src/governance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
deriveWormholeBridgeDataKey,
} from "@certusone/wormhole-sdk/lib/cjs/solana/wormhole";
import { KeyValueConfig, Storable } from "./base";
import { PriorityFeeConfig } from "@pythnetwork/solana-utils";

class InvalidTransactionError extends Error {
constructor(message: string) {
Expand Down Expand Up @@ -343,7 +344,8 @@ export class Vault extends Storable {
*/
public async proposeWormholeMessage(
payloads: Buffer[],
proposalAddress?: PublicKey
proposalAddress?: PublicKey,
priorityFeeConfig: PriorityFeeConfig = {}
): Promise<WormholeMultisigProposal> {
const squad = this.getSquadOrThrow();
const multisigVault = new MultisigVault(
Expand All @@ -356,7 +358,8 @@ export class Vault extends Storable {
await multisigVault.proposeWormholeMultipleMessagesWithPayer(
payloads,
squad.wallet.publicKey,
proposalAddress
proposalAddress,
priorityFeeConfig
);
return new WormholeMultisigProposal(txAccount, squad, this.cluster);
}
Expand Down
5 changes: 3 additions & 2 deletions governance/xc_admin/packages/xc_admin_common/src/propose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ export class MultisigVault {
public async proposeWormholeMultipleMessagesWithPayer(
payloads: Buffer[],
messagePayer: PublicKey,
proposalAddress?: PublicKey
proposalAddress?: PublicKey,
priorityFeeConfig: PriorityFeeConfig = {}
): Promise<PublicKey> {
const msAccount = await this.getMultisigAccount();

Expand Down Expand Up @@ -267,7 +268,7 @@ export class MultisigVault {

const txToSend = TransactionBuilder.batchIntoLegacyTransactions(
ixToSend,
{}
priorityFeeConfig
);
await this.sendAllTransactions(txToSend);
return proposalAddress;
Expand Down

0 comments on commit 80b4dd9

Please sign in to comment.