kevinheavey / anchor-bankrun

An Anchor wrapper for solana-bankrun
MIT License
36 stars 8 forks source link

Fix type error #27

Closed kevinheavey closed 3 weeks ago

kevinheavey commented 3 weeks ago

Fixes error from #25 and adds tsc to lint script so this doesn't happen again

kevinheavey commented 3 weeks ago

Looks like there's another error from some previous PR:

error TS2344: Type 'AllEvents<IDL>[number]' does not satisfy the constraint 'IdlEvent'.

No error on my machine though

Woody4618 commented 3 weeks ago

Did i break anything? Looks like you reverted the error change from two days ago. The tests on that were green. Im also getting the AllEvents[number] error locally. I can try debug it.

kevinheavey commented 3 weeks ago

Yeah somehow the tests are more permissive than tsc itself. The SendTransactionError issue is fixed in this PR, and I've also added tsc to the lint script which is what makes this Anchor type error appear in CI.

Previously this error would only have surfaced in the release CI which runs tsc

Woody4618 commented 3 weeks ago

If you revert the error change it will only work for "@solana/web3.js": "<1.92.0" for "@solana/web3.js": ">1.92.0" the parameter needs to be an object. Thats why I updated the package.json file. Maybe you need to run yarn install locally for it to work?

kevinheavey commented 3 weeks ago

Ah right yeah maybe that's it lol

Will check later

Woody4618 commented 3 weeks ago

The other IDL error seems to come from anchor directly. It goes away when i delete the discriminator from IdlEvent in the node modules. So not sure how to fix that in anchor-brankrun.

Only way i found to make the build work is ignoring it with "skipLibCheck": true

Maybe you have more luck

kevinheavey commented 3 weeks ago

I can confirm #25 did not break anything, sorry for jumping the gun lol

Woody4618 commented 3 weeks ago

Did you figure out what the other Events error comes from? I couldnt figure it out sadly.

kevinheavey commented 3 weeks ago

I decided skipLibCheck is good enough for me