ts: Fix empty instructions array (#877)
This commit is contained in:
parent
48a72e7018
commit
39791dc4af
|
@ -16,9 +16,7 @@ export default class TransactionFactory {
|
|||
const txFn: TransactionFn<IDL, I> = (...args): Transaction => {
|
||||
const [, ctx] = splitArgsAndCtx(idlIx, [...args]);
|
||||
const tx = new Transaction();
|
||||
if (ctx.instructions !== undefined) {
|
||||
tx.add(...ctx.instructions);
|
||||
}
|
||||
ctx.instructions?.forEach((ix) => tx.add(ix));
|
||||
tx.add(ixFn(...args));
|
||||
return tx;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue