UCLA-IRL / ndn-python-repo

An NDN Repo implementation in Python
Apache License 2.0
16 stars 13 forks source link

WriteCommandHandle.is_valid_param differs from protocol #49

Closed yoursunny closed 4 years ago

yoursunny commented 4 years ago

Insert page says:

If neither start_block_id nor end_block_id is given, ... If end_block_id is not given, ... Otherwise, ... If start_block_id is not given, it is set to 0. ...

This means, it is allowed for an insert command to have end_block_id but not start_block_id. The repo should execute the steps in "otherwise", and the default value of start_block_id would be 0.

However, WriteCommandHandle.is_valid_param function would reject such a command: https://github.com/JonnyKong/ndn-python-repo/blob/5eff16355daee5fba0ba54a9c73ea011cfb90235/ndn_python_repo/handle/write_command_handle.py#L142-L144

JonnyKong commented 4 years ago

Thanks, fixed with https://github.com/JonnyKong/ndn-python-repo/commit/0045f4ec442bd8f04756a1567093243e6a55cfb4.