maci icon indicating copy to clipboard operation
maci copied to clipboard

Trying to solve two TS type errors in `crypto/`

Open 0xisk opened this issue 2 years ago • 1 comments

  • Argument of type 'BigIntConstructor' is not assignable to parameter of type '(value: BigInt, index: number, array: BigInt[]) => bigint'.
  • Type 'BigInt' is not assignable to type 'string | number | bigint | boolean'.

0xisk avatar Jul 21 '22 17:07 0xisk

I am not sure about the first error fixing:

const level: BigInt[] = pathElements[i].map((i: BigInt): BigInt => {
     return BigInt(i as bigint);
}) 

0xisk avatar Jul 22 '22 06:07 0xisk

I am not sure about the first error fixing:

const level: BigInt[] = pathElements[i].map((i: BigInt): BigInt => {
     return BigInt(i as bigint);
}) 

Thank you so much for opening this, and sorry it took us this long to get back to you. As discussed on discord, we'll be closing this PR the code has been updated since then, and some refactoring work tackling similar issues is about to be merged into the repo, thank you for making this problem evident.

ctrlc03 avatar Oct 31 '23 14:10 ctrlc03