Skip to content

Commit

Permalink
Expose {method,section}Name on Method class (polkadot-js#975)
Browse files Browse the repository at this point in the history
* Expose {method,module}Name on Method class

* moduleName -> sectionName to align
  • Loading branch information
jacogr authored and ianhe8x committed Jun 17, 2019
1 parent 6370ac4 commit d212a8d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/types/src/primitive/Method.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,20 @@ export default class Method extends Struct implements IMethod {
return this._meta;
}

/**
* @description Returns the name of the method
*/
get methodName (): string {
return Method.findFunction(this.callIndex).method;
}

/**
* @description Returns the module containing the method
*/
get sectionName (): string {
return Method.findFunction(this.callIndex).section;
}

/**
* @description Returns the base runtime type name for this instance
*/
Expand Down

0 comments on commit d212a8d

Please sign in to comment.