makerdao/dai.js

cdp.wipeDai doesn't throw when tx fails

Closed this issue · 5 comments

It's pretty common that cdp.wipeDai fails b/c you lack MKR tokens. Currently, there is NO information that it happens. Promise resolves correctly even that on etherscan you can see that it failed. This is an obvious bug.

Example:

await cdp.wipeDai("10", Maker.DAI); // this doesnt throw (at least in the case when user lacks MKRs).

Thanks for the report--we're on it

@krzkaczor Checking MKR balance and providing a helpful error message about not having enough MKR definitely makes sense.

Could you provide some more info about not getting any error at all? We're not able to reproduce that - an error (VM Exception while processing transaction: revert ) is thrown when wiping fails for me.

Ahh sorry @tyler17, I thought it's trivial to reproduce. I am gonna push repro example in few minutes...

@tyler17 https://github.com/krzkaczor/dai-js-bug-repro

Also in etherscan you can see that even DAI creation failed when doing it for the first time. I am not sure why, i think it might be separate bug.

This should be fixed in the newest release, 0.9.1.