Closed wertikalk closed 11 months ago
wouldn't these errors be same as I did here https://github.com/filecoin-project/filecoin-solidity/pull/13 ?
@maciejwitowski I think defining using error propagation is important in contracts as well. I was trying some transactions for example calling getDealActivation on calibnet with expired deals and it was reverting with no proper info, thus using error propagation for main contracts is also useful as I did here https://github.com/filecoin-project/filecoin-solidity/pull/13
Description
Instead of reverting on the bottom contract level when there's an error (in
/utils/Actor.sol
) and losing all the valuable information for the developer, it propagates the exit through the*API.sol
libraries into the top contract level -/tests/*.test.sol
from which it can handle the error in different ways.For additional context and the discussion attached, the link to the original issue - #363.
Questions
@scotthconner
This is currently in the draft status, and we would like to get your input on the overall approach, before additional changes are made.
*API.sol
files are modified since they all use/utils/Actor.sol
, but the main files to focus on are:/utils/Actor.sol
- this is where the filecoin-sol library previously revertedMarketAPI.sol
- used part of the lib to completely illustrate the approach/tests/market.test.sol
- top level contract that instantiates the libWe are taking care of the common (standard) exit codes across actors (see
/utils/Errors.sol
), but we cannot find the actor-specific exit codes. There's only information that these codes come after32
mark, yet we cannot find their values and descriptions anywhere.Affected issues