snapshot-labs / snapshot-strategies

Snapshot voting strategies
https://docs.snapshot.org/strategies
MIT License
221 stars 771 forks source link

500 error code on pagination strategy using aavegotchi-agip-37-wap-ghst strategy [but works in playground] #873

Closed jarrodlilkendey closed 2 years ago

jarrodlilkendey commented 2 years ago

Expected behavior

Testing the aavegotchi-agip-37-wap-ghst strategy using the pagination strategy with the address 0x26cf02F892B04aF4Cf350539CE2C77FCF79Ec172 should return a voting power greater than 0.

Actual behavior

Instead, it returns an error as you are casting your vote with a 500 error code in the console from the score API.

500-server-code

One thing I found strange, was the paginations strategy works fine using the playground, it only fails when calculating the voting power within a snapshot instance.

working playground link

Steps to reproduce the behavior

Test with any address after adding the pagination strategy into a snapshot instance while using the strategy params JSON as attached.

wapGHST json.txt

ChaituVR commented 2 years ago

I see this error when I try with that address

Cannot read properties of undefined (reading '0')

But works fine when I pass other addresses, I think it is because of this> https://github.com/snapshot-labs/snapshot-strategies/blob/master/src/strategies/aavegotchi-agip-37-wap-ghst/index.ts#L50-L54

Can raise a PR?

jarrodlilkendey commented 2 years ago

thanks mate. i will raise a PR and fix this bug. cheers.

jarrodlilkendey commented 2 years ago

Pull request with the bug fix has been raised

https://github.com/snapshot-labs/snapshot-strategies/pull/876