filecoin-project / filecoin-solidity

Filecoin Solidity API Library
Other
17 stars 11 forks source link

Propagates exit codes to the top-level contract #20

Closed wertikalk closed 11 months ago

wertikalk commented 1 year ago

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

Affected issues

lordshashank commented 12 months ago

wouldn't these errors be same as I did here https://github.com/filecoin-project/filecoin-solidity/pull/13 ?

lordshashank commented 12 months ago

@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