Fix constructor for multisig transaction (#476)
This commit is contained in:
parent
d1f5e5955a
commit
5641008356
|
@ -35,7 +35,7 @@ test("Wormhole multisig instruction parse: send message without governance paylo
|
|||
AnchorProvider.defaultOptions()
|
||||
)
|
||||
);
|
||||
const parser = new MultisigParser(cluster);
|
||||
const parser = MultisigParser.fromCluster(cluster);
|
||||
|
||||
wormholeProgram.methods
|
||||
.postMessage(1, Buffer.from([0]), 1)
|
||||
|
@ -182,7 +182,7 @@ test("Wormhole multisig instruction parse: send message with governance payload"
|
|||
AnchorProvider.defaultOptions()
|
||||
)
|
||||
);
|
||||
const parser = new MultisigParser(cluster);
|
||||
const parser = MultisigParser.fromCluster(cluster);
|
||||
|
||||
const executePostedVaaArgs: ExecutePostedVaaArgs = {
|
||||
targetChainId: "pythnet" as ChainName,
|
||||
|
|
|
@ -39,9 +39,18 @@ export class MultisigParser {
|
|||
readonly pythOracleAddress: PublicKey;
|
||||
readonly wormholeBridgeAddress: PublicKey | undefined;
|
||||
|
||||
constructor(cluster: PythCluster) {
|
||||
this.pythOracleAddress = getPythProgramKeyForCluster(cluster);
|
||||
this.wormholeBridgeAddress = WORMHOLE_ADDRESS[cluster];
|
||||
constructor(
|
||||
pythOracleAddress: PublicKey,
|
||||
wormholeBridgeAddress: PublicKey | undefined
|
||||
) {
|
||||
this.pythOracleAddress = pythOracleAddress;
|
||||
this.wormholeBridgeAddress = wormholeBridgeAddress;
|
||||
}
|
||||
static fromCluster(cluster: PythCluster): MultisigParser {
|
||||
return new MultisigParser(
|
||||
getPythProgramKeyForCluster(cluster),
|
||||
WORMHOLE_ADDRESS[cluster]
|
||||
);
|
||||
}
|
||||
|
||||
parseInstruction(instruction: TransactionInstruction): MultisigInstruction {
|
||||
|
|
Loading…
Reference in New Issue