Skip to content

Commit

Permalink
tolerate if there was only one parameter for deploy, which was passed…
Browse files Browse the repository at this point in the history
… as-is without wrapping it inside an array
  • Loading branch information
Muhammad-Altabba committed Sep 5, 2024
1 parent de50ef1 commit c258c38
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/contract-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,13 @@ export class ContractFactory<Abi extends ContractAbi> extends Web3Context {
deploymentTransaction(): web3Types.TransactionReceipt;
}
> {
const tx = await this.getDeployTransaction(args, overrides);
let modArgs = args;
if (!Array.isArray(args)) {
// tolerate if there was only one parameter for deploy,
// which was passed as-is without wrapping it inside an array.
modArgs = [args] as any;
}
const tx = await this.getDeployTransaction(modArgs, overrides);

const receipt = await (await this.zkWallet?.sendTransaction(tx)).wait();

Expand Down

0 comments on commit c258c38

Please sign in to comment.