aleph-im/pyaleph

Balances use Chain object as value for chain: Remove validation

Closed this issue · 3 comments

We can have a lot of chains of type ETH that have different values in term of balance "source"...

Example BSC, SABLIER (virtual), NFT (virtual), MATIC, etc...

They are all of chain type ETH for messages, but come from different chains.

Places it should be changed:
src/aleph/db/accessors/balances.py
src/aleph/handlers/content/post.py#L42

Sources like Sablier are considered "dapps" at the moment, and that field is not validated. We store the L1 chain and validate it with the Chain enum because that's what we do everywhere else. For the examples you gave, I would imagine that they could all be considered "dapps" over the Chain.ETH chain. Would that work for the use cases you're thinking of?

We can of course rename the dapp field to something more generic.

Discussed IRL, the chain field should indeed be validated and the dapp field will be kept as a string.