|
|
|
@ -48,92 +48,89 @@ describe("Publisher tests", () => { |
|
|
|
|
expect(template).toBeDefined(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
test('getContractDoc', () => { |
|
|
|
|
const template = getContractDoc( |
|
|
|
|
'Owner', |
|
|
|
|
{ |
|
|
|
|
test("getContractDoc", () => { |
|
|
|
|
const template = getContractDoc("Owner", { |
|
|
|
|
...buildFakeArtifactWithComments(), |
|
|
|
|
abi: [ |
|
|
|
|
{ |
|
|
|
|
"inputs": [], |
|
|
|
|
"stateMutability": "nonpayable", |
|
|
|
|
"type": "constructor" |
|
|
|
|
inputs: [], |
|
|
|
|
stateMutability: "nonpayable", |
|
|
|
|
type: "constructor", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"anonymous": false, |
|
|
|
|
"inputs": [ |
|
|
|
|
anonymous: false, |
|
|
|
|
inputs: [ |
|
|
|
|
{ |
|
|
|
|
"indexed": true, |
|
|
|
|
"internalType": "address", |
|
|
|
|
"name": "oldOwner", |
|
|
|
|
"type": "address" |
|
|
|
|
indexed: true, |
|
|
|
|
internalType: "address", |
|
|
|
|
name: "oldOwner", |
|
|
|
|
type: "address", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"indexed": true, |
|
|
|
|
"internalType": "address", |
|
|
|
|
"name": "newOwner", |
|
|
|
|
"type": "address" |
|
|
|
|
} |
|
|
|
|
indexed: true, |
|
|
|
|
internalType: "address", |
|
|
|
|
name: "newOwner", |
|
|
|
|
type: "address", |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
"name": "OwnerSet", |
|
|
|
|
"type": "event" |
|
|
|
|
name: "OwnerSet", |
|
|
|
|
type: "event", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"inputs": [ |
|
|
|
|
inputs: [ |
|
|
|
|
{ |
|
|
|
|
"internalType": "address", |
|
|
|
|
"name": "newOwner", |
|
|
|
|
"type": "address" |
|
|
|
|
} |
|
|
|
|
internalType: "address", |
|
|
|
|
name: "newOwner", |
|
|
|
|
type: "address", |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
"name": "changeOwner", |
|
|
|
|
"outputs": [], |
|
|
|
|
"stateMutability": "nonpayable", |
|
|
|
|
"type": "function" |
|
|
|
|
name: "changeOwner", |
|
|
|
|
outputs: [], |
|
|
|
|
stateMutability: "nonpayable", |
|
|
|
|
type: "function", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"inputs": [], |
|
|
|
|
"name": "getOwner", |
|
|
|
|
"outputs": [ |
|
|
|
|
inputs: [], |
|
|
|
|
name: "getOwner", |
|
|
|
|
outputs: [ |
|
|
|
|
{ |
|
|
|
|
"internalType": "address", |
|
|
|
|
"name": "", |
|
|
|
|
"type": "address" |
|
|
|
|
} |
|
|
|
|
internalType: "address", |
|
|
|
|
name: "", |
|
|
|
|
type: "address", |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
"stateMutability": "view", |
|
|
|
|
"type": "function" |
|
|
|
|
} |
|
|
|
|
stateMutability: "view", |
|
|
|
|
type: "function", |
|
|
|
|
}, |
|
|
|
|
] as any, |
|
|
|
|
devdoc: { |
|
|
|
|
"details": "Set & change owner", |
|
|
|
|
"methods": { |
|
|
|
|
details: "Set & change owner", |
|
|
|
|
methods: { |
|
|
|
|
"changeOwner(address)": { |
|
|
|
|
"details": "Change owner", |
|
|
|
|
"params": { |
|
|
|
|
"newOwner": "address of new owner" |
|
|
|
|
} |
|
|
|
|
details: "Change owner", |
|
|
|
|
params: { |
|
|
|
|
newOwner: "address of new owner", |
|
|
|
|
}, |
|
|
|
|
"constructor": { |
|
|
|
|
"details": "Set contract deployer as owner" |
|
|
|
|
}, |
|
|
|
|
constructor: { |
|
|
|
|
details: "Set contract deployer as owner", |
|
|
|
|
}, |
|
|
|
|
"getOwner()": { |
|
|
|
|
"details": "Return owner address ", |
|
|
|
|
"returns": { |
|
|
|
|
"_0": "address of owner" |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
details: "Return owner address ", |
|
|
|
|
returns: { |
|
|
|
|
_0: "address of owner", |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
"title": "Owner" |
|
|
|
|
}, |
|
|
|
|
title: "Owner", |
|
|
|
|
} as any, |
|
|
|
|
userdoc: { |
|
|
|
|
"methods": {} |
|
|
|
|
} as any |
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
methods: {}, |
|
|
|
|
} as any, |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
expect(template).toBeDefined(); |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
describe("getFunctionDocumentation", () => { |
|
|
|
|