Skip to content

Commit

Permalink
small polish
Browse files Browse the repository at this point in the history
  • Loading branch information
shunjizhan committed Oct 18, 2022
1 parent 30bd10c commit 6821333
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/api/src/submittable/createClass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export function createClass <ApiType extends ApiTypes> ({ api, apiType, blockHas

// dry run an extrinsic
public dryRun (account: AddressOrPair, optionsOrHash?: Partial<SignerOptions> | Uint8Array | string): SubmittableDryRunResult<ApiType> {
if (!api.rpc.system || !api.rpc.system.dryRun) {
if (!api.rpc.system?.dryRun) {
throw new Error('The system.dryRun RPC call is not available in your environment');
}

Expand All @@ -124,7 +124,7 @@ export function createClass <ApiType extends ApiTypes> ({ api, apiType, blockHas

// calculate the payment info for this transaction (if signed and submitted)
public paymentInfo (account: AddressOrPair, optionsOrHash?: Partial<SignerOptions> | Uint8Array | string): SubmittablePaymentResult<ApiType> {
if (!api.call.transactionPaymentApi || !api.call.transactionPaymentApi.queryInfo) {
if (!api.call.transactionPaymentApi?.queryInfo) {
throw new Error('The transactionPaymentApi.queryInfo runtime call is not available in your environment');
}

Expand Down

0 comments on commit 6821333

Please sign in to comment.