dethcrypto / dethcrypto/TypeChain
generate-types doesn't recognize deployer.then as a function
- Dominant language
- TypeScript
- Stars
- 2.8k
- Forks
- 376
- PR merge metrics
- No merged PRs in 30d
Description
This code is generated after the run of `typechain --target=truffle-v5 'build/contracts/*.json'` from examples. This code generates these types for the Deployer
```
interface Deployer {
link(
library: Truffle.Contract,
destination: Truffle.Contract
): Deployer;
link(
library: Truffle.Contract,
destinations: Array>
): Deployer;
deploy(c: ContractNew, ...args: T): Deployer;
}
```
unfortunately function `then(param: () => Promise): void;` is't part of that. Therefore migration script that waits until deployer is ready and only after that doing logic would yield an error during compilation time.
Example of such script:
```
module.exports = function (deployer, network, accounts) {
const [alice, bob] = accounts;
deployer.then(async () => {
await deployer.deploy(Contract, {from: bob});
const contractInstance = await Contract.deployed();
await contractInstance.transferOwnership(alice, {from: bob});
});
}
```
Contributor guide
Assessment
This issue has not been assessed yet.