codex-storage / nim-ethers

Port of ethers.js to Nim
Other
8 stars 4 forks source link

JSON conversions leaking from nim-ethers and causing clashes #72

Closed gmega closed 6 months ago

gmega commented 6 months ago

The post-chronos-v4 versions of nim-ethers introduce public json conversions which behave differently from the same conversions in nim-serde and will cause issues when both libraries are imported.

There are two ways to address this:

  1. block exports of json conversions from nim-ethers so as to make them package-private;
  2. remove clashing conversions from nim-ethers and let nim-serde handle those for nim-ethers as well.

As far as I can tell, the only duplicate conversion that is present in both libraries is the conversion from UInt256, which allows empty strings in nim-ethers but does not allow them in nim-serde. I am therefore going to try to attempt to make those uniform, and then drop the duplicate on the nim-ethers side.

elcritch commented 6 months ago

I feel like @emizzle might have some good input on this issue.

emizzle commented 6 months ago

and will cause issues when both libraries are imported

There is no conflict here that I can see. The conversions in ethers are not exported outside the library that I can tell. Even if they were, from pkg/ethers import Address should only import the Address symbol from ethers, not the fromJson symbol(s).

gmega commented 6 months ago

Fixed by #74