Allow most recent Result.findRecord (#1559)
* combine values * findRecord newest * constructor * Add filterRecords * Update interface
This commit is contained in:
committed by
Jaco Greeff
parent
6aebeec028
commit
5671af8db7
@@ -27,6 +27,15 @@ export default class SubmittableResult implements SubmittableResultImpl {
|
||||
return this.status.isFinalized;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Filters EventRecords for the specified method & section (there could be multiple)
|
||||
*/
|
||||
public filterRecords (section: string, method: string): EventRecord[] {
|
||||
return this.events.filter(({ event }): boolean =>
|
||||
event.section === section && event.method === method
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Finds an EventRecord for the specified method & section
|
||||
*/
|
||||
|
||||
@@ -15,7 +15,8 @@ export interface SubmittableResultImpl {
|
||||
readonly isError: boolean;
|
||||
readonly isFinalized: boolean;
|
||||
|
||||
findRecord(section: string, method: string): EventRecord | undefined;
|
||||
filterRecords (section: string, method: string): EventRecord[];
|
||||
findRecord (section: string, method: string): EventRecord | undefined;
|
||||
}
|
||||
|
||||
export interface SubmittableResultValue {
|
||||
|
||||
Reference in New Issue
Block a user