rosetta-cli sends depreciated field
samuel-rufi opened this issue · 4 comments
Describe the bug
When running the rosetta-cli construction check
, at construction/combine
rosetta-cli sends the depreciated address field even if account_identifier
is populated.
Expected behavior
I expect that the depreciated field address
will not get sent by rosetta-cli if account_identifier
is populated.
Additional context
Our Rosetta API only accepts requests with known fields to mitigate user mistakes. Also it doesn't allow depreciated fields.
Hi @rufsam ,
Thanks for raising this. This field is there for backward compatibility reasons, so that even rosetta-cli can pass for implementation still using older specifications. As you can see address
and account_identifier
are marshaled and unmarshaled so that we have both the fields here.
I am wondering why we can't simply ignore the field which is not needed?
Hi @shrimalmadhur, thanks for the fast response.
Could rosetta-cli maybe first check which specification version is running and if it's < v1.4.4 then rosetta-cli will populate the address
field else it will only populate the account_identifier
?
For now I did ignore the field as you suggested.
Although it's a fair suggestion but in my opinion not the best practice to have these kind of changes based on specific version. Even though it's just one field for now, could be more in future and that would make the code messy and might introduce unnecessary bugs. I would rather have the client ignore what is not needed rather than have version based checks. I hope that makes sense. I am open to other opinions if you have more :). Thanks
Hi @shrimalmadhur, agree, if more of these checks get introduced the code will get quite complex fast. So I will just ignore this field as you suggested. Thanks for the help again! 👍