Add method name & prefix to StorageFunction (#182)
* Add methods & prefix to StorageFunction * Match method/section to exposed names * Export method/section on extrinsic & jsonrpc * PR comment prefix -> section
This commit is contained in:
@@ -55,12 +55,12 @@ export default class Api implements ApiInterface {
|
||||
*
|
||||
* Api.signature({ name: 'test_method', params: [ { name: 'dest', type: 'Address' } ], type: 'Address' }); // => test_method (dest: Address): Address
|
||||
*/
|
||||
static signature ({ name, params, type }: Method): string {
|
||||
static signature ({ method, params, type }: Method): string {
|
||||
const inputs = params.map(({ name, type }) =>
|
||||
`${name}: ${type}`
|
||||
).join(', ');
|
||||
|
||||
return `${name} (${inputs}): ${type}`;
|
||||
return `${method} (${inputs}): ${type}`;
|
||||
}
|
||||
|
||||
private createInterface ({ methods, name }: Section<any>): ApiInterface$Section {
|
||||
|
||||
@@ -12,14 +12,14 @@ describe('methodSend', () => {
|
||||
beforeEach(() => {
|
||||
methods = {
|
||||
blah: {
|
||||
name: 'blah',
|
||||
method: 'blah',
|
||||
params: [
|
||||
{ name: 'foo', type: 'Bytes' }
|
||||
],
|
||||
type: 'Bytes'
|
||||
},
|
||||
bleh: {
|
||||
name: 'bleh',
|
||||
method: 'bleh',
|
||||
params: [],
|
||||
type: 'Bytes'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user