You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to create a merkle tree outside of EVM context so I am using SimpleMerkleTree. While the consumer are free to implement the leafHash function, the nodeHash is proving to be difficult to deal with without depending on @ethersproject/bytes package because of the type BytesLike.
Also note that this is not a dependency on all of ethers.js. The bytes package is small.
What sha256 dependency are you using?
I do think that nodeHash could have a better type, because BytesLike is a union type and it would be much simpler for the user to have to handle just one type of argument. My preference is consolidating on Uint8Array like the ethereum-cryptography library.
Note that by using this library you already have a dependency on @ethersproject/bytes
yeap, but I will still need to install @ethersproject/bytes as direct dependency. I prefer not to have that direct dependency. Will be good if this library also export some of the utils function necessary to work with BytesLike type?
What sha256 dependency are you using?
I am using sha256 from bitcoinjs, which expect a Buffer type input
I am trying to create a merkle tree outside of EVM context so I am using
SimpleMerkleTree
. While the consumer are free to implement theleafHash
function, thenodeHash
is proving to be difficult to deal with without depending on@ethersproject/bytes
package because of the typeBytesLike
.for instance,
There is a typing issue because
BytesLike
cannot be converted easily to bufferis there any ways to write custom nodeHash function with
sha256
and does not have dependency on the etherjs lib?The text was updated successfully, but these errors were encountered: