Skip to content

Commit

Permalink
ts: Pass instructions to state rpcs
Browse files Browse the repository at this point in the history
  • Loading branch information
armaniferrante committed Feb 14, 2021
1 parent bf8d765 commit cf9c847
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ts/src/rpc.ts
Expand Up @@ -246,6 +246,9 @@ export class RpcFactory {
rpc[m.name] = async (...args: any[]): Promise<TransactionSignature> => {
const [_, ctx] = splitArgsAndCtx(m, [...args]);
const tx = new Transaction();
if (ctx.instructions !== undefined) {
tx.add(...ctx.instructions);
}
tx.add(await ix[m.name](...args));
try {
const txSig = await provider.send(tx, ctx.signers, ctx.options);
Expand Down

0 comments on commit cf9c847

Please sign in to comment.