difftreelog
feat catch dispatchError in playgrounds
in: master
2 files changed
tests/src/util/playgrounds/types.tsdiffbeforeafterboth--- a/tests/src/util/playgrounds/types.ts
+++ b/tests/src/util/playgrounds/types.ts
@@ -14,6 +14,7 @@
export interface ITransactionResult {
status: 'Fail' | 'Success';
result: {
+ dispatchError: any,
events: {
phase: any, // {ApplyExtrinsic: number} | 'Initialization',
event: IEvent;
@@ -47,6 +48,7 @@
call: string;
params: any[];
moduleError?: string;
+ dispatchError?: any;
events?: any;
}
tests/src/util/playgrounds/unique.tsdiffbeforeafterboth514 params,514 params,515 } as IUniqueHelperLog;515 } as IUniqueHelperLog;516516517 if(result.status !== this.transactionStatus.SUCCESS && result.moduleError) log.moduleError = result.moduleError;517 if(result.status !== this.transactionStatus.SUCCESS) {518 if (result.moduleError) log.moduleError = result.moduleError;519 else if (result.result.dispatchError) log.dispatchError = result.result.dispatchError;520 }518 if(events.length > 0) log.events = events;521 if(events.length > 0) log.events = events;519522520 this.chainLog.push(log);523 this.chainLog.push(log);521524522 if(expectSuccess && result.status !== this.transactionStatus.SUCCESS) throw Error(`${result.moduleError}`);525 if(expectSuccess && result.status !== this.transactionStatus.SUCCESS) {526 if (result.moduleError) throw Error(`${result.moduleError}`);527 else if (result.result.dispatchError) throw Error(JSON.stringify(result.result.dispatchError));528 }523 return result;529 return result;524 }530 }525531