Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

constructors for types #319

Open
snissn opened this issue Feb 27, 2023 · 2 comments
Open

constructors for types #319

snissn opened this issue Feb 27, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@snissn
Copy link
Contributor

snissn commented Feb 27, 2023

We have many custom types in this repo, and not a lot of constructors for how a user of this library constructs custom types from "plain" solidity types. Both the common types file as the higher priority and API specific types that are based on builtin solidity types + common types in the library, it would be really nice to have an interface for constructing these types. This will prevent confusion and repetition of code as any developer who integrates the filecoin-solidity library into their codebase will need to construct these custom types.

Example:

from CommonTypes.sol, how does an end user construct a bigInt from a u256? what about a cid from a string?

in MarketTypes.sol how does an end user construct a DealProposal from the composite types?

We have built constructors for the FilAddress type, and having util / constructors for the rest will be really really helpful for end users

🔗 zboto Link

@ainhoa-a ainhoa-a added the enhancement New feature or request label Mar 2, 2023
@ainhoa-a
Copy link
Member

ainhoa-a commented Mar 2, 2023

Hi @snissn for which custom types you recommend to have a constructor?

@ainhoa-a
Copy link
Member

ainhoa-a commented Mar 3, 2023

@rllola raúl suggests to focus on common types only.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants