pokt-network / pocket-core

Official implementation of the Pocket Network Protocol
http://www.pokt.network
MIT License
209 stars 103 forks source link

Make TestKeeper_HandleRelay more scalable #1542

Closed msmania closed 1 year ago

msmania commented 1 year ago

This will help #1536 to add new testcases with the tolerance.

reviewpad[bot] commented 1 year ago

AI-Generated Summary: This pull request improves the scalability of the TestKeeper_HandleRelay by refactoring the test setup, adding more test cases, and eliminating the impact of ClientBlockSyncAllowance. The changes allow for testing multiple session ranges and provide better control over the execution environment, setting up various block heights and mock contexts. The patch modifies the x/pocketcore/keeper/service_test.go file, adding 143 lines and removing 39 lines.

Olshansk commented 1 year ago

@msmania Should we also rename ClientSessionBlockSyncAllowance to ClientSessionSyncAllowance in this PR so we can merge the other one?

nodiesBlade commented 1 year ago

I can cherry pick these changes into my branch as well - whatever works best. @Olshansk .

Also tests look nicer here for sure, nice work @msmania !

Olshansk commented 1 year ago

I can cherry pick these changes into my branch as well - whatever works best. @Olshansk .

Also tests look nicer here for sure, nice work @msmania !

@PoktBlade Let's merge this one in and you can rebase/merge with it in your branch.

msmania commented 1 year ago

I can cherry pick these changes into my branch as well - whatever works best. @Olshansk .

That would be great. I'm fine with closing this. Thanks!