fix: 0 is falsey for arg filling (#2258)
This commit is contained in:
parent
7a0a37e0f8
commit
91a2b7ec96
|
@ -335,7 +335,7 @@ export class AccountsResolver<IDL extends Idl, I extends AllInstructions<IDL>> {
|
|||
|
||||
private async toBufferArg(seedDesc: IdlSeed): Promise<Buffer | undefined> {
|
||||
const argValue = this.argValue(seedDesc);
|
||||
if (!argValue) {
|
||||
if (typeof argValue === "undefined") {
|
||||
return;
|
||||
}
|
||||
return this.toBufferValue(
|
||||
|
|
|
@ -173,6 +173,17 @@ export class MethodsBuilder<IDL extends Idl, I extends AllInstructions<IDL>> {
|
|||
});
|
||||
}
|
||||
|
||||
public async rpcAndKeys(options?: ConfirmOptions): Promise<{
|
||||
pubkeys: Partial<InstructionAccountAddresses<IDL, I>>;
|
||||
signature: TransactionSignature;
|
||||
}> {
|
||||
const pubkeys = await this.pubkeys();
|
||||
return {
|
||||
pubkeys,
|
||||
signature: await this.rpc(options),
|
||||
};
|
||||
}
|
||||
|
||||
public async view(options?: ConfirmOptions): Promise<any> {
|
||||
if (this._autoResolveAccounts) {
|
||||
await this._accountsResolver.resolve();
|
||||
|
|
Loading…
Reference in New Issue