Skip to content

Commit 67b9eac

Browse files
committed
feat(multisig_create): add test for missing createKey signature
1 parent 0d52185 commit 67b9eac

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

tests/multisig.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,45 @@ describe("multisig", () => {
9393
/Found multiple members with the same pubkey/
9494
);
9595
});
96+
it("error: missing signature from `createKey`", async () => {
97+
const creator = await generateFundedKeypair(connection);
98+
99+
const createKey = Keypair.generate();
100+
const [multisigPda] = multisig.getMultisigPda({
101+
createKey: createKey.publicKey,
102+
});
103+
const [configAuthority] = multisig.getAuthorityPda({
104+
multisigPda,
105+
index: 0,
106+
});
107+
108+
const tx = multisig.transactions.multisigCreate({
109+
blockhash: (await connection.getLatestBlockhash()).blockhash,
110+
createKey: createKey.publicKey,
111+
creator: creator.publicKey,
112+
multisigPda,
113+
configAuthority,
114+
threshold: 1,
115+
members: [
116+
{
117+
key: members.almighty.publicKey,
118+
permissions: Permissions.all(),
119+
},
120+
{
121+
key: members.almighty.publicKey,
122+
permissions: Permissions.all(),
123+
},
124+
],
125+
});
126+
127+
// Missing signature from `createKey`.
128+
tx.sign([creator]);
129+
130+
await assert.rejects(
131+
() => connection.sendTransaction(tx, { skipPreflight: true }),
132+
/Transaction signature verification failure/
133+
);
134+
});
96135

97136
it("error: empty members", async () => {
98137
const creator = await generateFundedKeypair(connection);

0 commit comments

Comments
 (0)