f-o-a-m / kepler

A Haskell framework that facilitates writing ABCI applications
https://kepler.dev
Apache License 2.0
34 stars 10 forks source link

Fix height parameter in /block #266

Closed alexfmpe closed 1 month ago

alexfmpe commented 1 month ago

Without this change I always get the latest block

The go parameter is indeed heightPtr but the query parameter is height. I'm not sure where and why the Ptr bit gets removed, maybe because its type is a pointer?

The tests don't detect this because there's only one check and for the latest block https://github.com/f-o-a-m/kepler/blob/bf75483fdc475eca3448eaf88489449167cdba21/hs-tendermint-client/kv-test/KVStore/Test/KVSpec.hs#L44-L47

Maybe there should be a few cases checking that the returned blockMeta -> header -> height matches the given height if below latest?

martyall commented 1 month ago

Maybe there should be a few cases checking that the returned blockMeta -> header -> height matches the given height if below latest?

If you want to add that test, go for it. I am currently not in a state to be able to build and modify the project, so I support whatever you think is required here to make sure it's working for you're needs.

alexfmpe commented 1 month ago

I would be happy to add you a maintainer if you're interested

Yeah, I am - now and then I tweak this or that and it's been piling up in a fork but I rather not diverge