makerdao / dss-auto-line

GNU Affero General Public License v3.0
7 stars 16 forks source link

Update exec to return a uint256 instead of reverting #4

Closed brianmcmichael closed 4 years ago

brianmcmichael commented 4 years ago

Updates the exec() function to short circuit and return a bool instead of reverting.

This will allow us to slip the auto-line into proxy actions without worrying about reverting transactions.

brianmcmichael commented 4 years ago

After some thought, it might be more useful for this function to return a uint256 of the ilk line after this. If it's short circuited, it can return the existing line, otherwise it retuns the new line value. This could be useful for contracts the need to know how much space they've got to work with in the adapter after this.

lucas-manuel commented 4 years ago

After some thought, it might be more useful for this function to return a uint256 of the ilk line after this. If it's short circuited, it can return the existing line, otherwise it retuns the new line value. This could be useful for contracts the need to know how much space they've got to work with in the adapter after this.

Good idea.

brianmcmichael commented 4 years ago

Updated this function and the tests, now instead of returning a bool here it returns the uint256 value of the current or adjusted line value. If invalid, returns 0.