status-im/nim-presto

importing presto/client reveals that presto is missing the encodeBytes proc

monyarm opened this issue · 1 comments

/home/monyarm/.nimble/pkgs/presto-0.0.4/presto/client.nim(808, 21) Error: undeclared identifier: 'encodeBytes'
candidates (edit distance, scope distance); see '--spellSuggest': 
 (4, 10): 'getBodyBytes' [proc declared in /home/monyarm/.nimble/pkgs/chronos-#asyncproc/chronos/apps/http/httpclient.nim(1145, 6)]
 (4, 10): 'getBodyBytes' [proc declared in /home/monyarm/.nimble/pkgs/chronos-#asyncproc/chronos/apps/http/httpclient.nim(1169, 6)]

presto uses the proc, but doesn't define it outside of tests/helpers

encodeBytes is an application-defined proc. You need to write it yourself for the types you use.

I do agree that this should be mentioned in the README

See for example: https://github.com/status-im/nimbus-eth2/blob/039bece9175104b5c87a8c2ff6b1eafae731b05e/beacon_chain/spec/eth2_apis/eth2_rest_serialization.nim#L1906-L1942=