filecoin-project / filecoin-solidity

Filecoin Solidity API Library
Other
17 stars 11 forks source link

TypeConstructor.sol #25

Closed vaniiiii closed 10 months ago

vaniiiii commented 10 months ago

Description

This pull request proposes the required functionality related to issue #5

It will allow developers who integrate the filecoin-solidity library into their codebase to construct common Filecoin types. Some of the types are not intended to be created by developers, such as FailCode, BatchReturn, etc. For other common types like BigInt and FilAddress, there are already methods that allow conversion to these types.

Proposed functions

    function dealLabelFromBytes(bytes calldata data) internal pure returns (CommonTypes.DealLabel memory) {}
    function dealLabelFromString(string calldata data) internal pure returns (CommonTypes.DealLabel memory) {}

Affected issues

maciejwitowski commented 10 months ago

I think having constructors for common types is enough. I'd suggest to have cidFromString. Also, what about functions to create BigInt and UniversalReceiverParams (which also contain bytes and may be hard to figure out for devs).

maciejwitowski commented 10 months ago

@vaniiiii any update here?

vaniiiii commented 10 months ago

@vaniiiii any update here?

Hi @maciejwitowski,

maciejwitowski commented 10 months ago

@vaniiiii I agree with all your points, thanks!