fix: document return value's type, not its name
This commit is contained in:
parent
98d06d6d25
commit
880cd6e440
@ -291,11 +291,11 @@ function _genMethodReturnTypeDoc(
|
|||||||
methodReturnTypeDoc.typeDocType = TypeDocTypes.Tuple;
|
methodReturnTypeDoc.typeDocType = TypeDocTypes.Tuple;
|
||||||
methodReturnTypeDoc.tupleElements = [];
|
methodReturnTypeDoc.tupleElements = [];
|
||||||
for (const output of outputs) {
|
for (const output of outputs) {
|
||||||
methodReturnTypeDoc.tupleElements.push({ name: output.name, typeDocType: TypeDocTypes.Intrinsic });
|
methodReturnTypeDoc.tupleElements.push({ name: output.type, typeDocType: TypeDocTypes.Intrinsic });
|
||||||
}
|
}
|
||||||
} else if (outputs.length === 1) {
|
} else if (outputs.length === 1) {
|
||||||
methodReturnTypeDoc.typeDocType = TypeDocTypes.Intrinsic;
|
methodReturnTypeDoc.typeDocType = TypeDocTypes.Intrinsic;
|
||||||
methodReturnTypeDoc.name = outputs[0].name;
|
methodReturnTypeDoc.name = outputs[0].type;
|
||||||
}
|
}
|
||||||
return methodReturnTypeDoc;
|
return methodReturnTypeDoc;
|
||||||
}
|
}
|
||||||
|
@ -86,8 +86,8 @@ describe('#SolidityDocGenerator', () => {
|
|||||||
it('parameter comment', () => {
|
it('parameter comment', () => {
|
||||||
expect(methodDoc.parameters[0].comment).to.equal('publicMethod @param');
|
expect(methodDoc.parameters[0].comment).to.equal('publicMethod @param');
|
||||||
});
|
});
|
||||||
it('return type name', () => {
|
it('return type', () => {
|
||||||
expect(methodDoc.returnType.name).to.equal('r');
|
expect(methodDoc.returnType.name).to.equal('int256');
|
||||||
});
|
});
|
||||||
it('return comment', () => {
|
it('return comment', () => {
|
||||||
expect(methodDoc.returnComment).to.equal('publicMethod @return');
|
expect(methodDoc.returnComment).to.equal('publicMethod @return');
|
||||||
@ -116,8 +116,8 @@ describe('#SolidityDocGenerator', () => {
|
|||||||
it('parameter comment', () => {
|
it('parameter comment', () => {
|
||||||
expect(methodDoc.parameters[0].comment).to.equal('externalMethod @param');
|
expect(methodDoc.parameters[0].comment).to.equal('externalMethod @param');
|
||||||
});
|
});
|
||||||
it('return type name', () => {
|
it('return type', () => {
|
||||||
expect(methodDoc.returnType.name).to.equal('r');
|
expect(methodDoc.returnType.name).to.equal('int256');
|
||||||
});
|
});
|
||||||
it('return comment', () => {
|
it('return comment', () => {
|
||||||
expect(methodDoc.returnComment).to.equal('externalMethod @return');
|
expect(methodDoc.returnComment).to.equal('externalMethod @return');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user