Closed keienWang closed 2 years ago
The get
method is designed for incremental parsing from byte sources, which is what HasParameter
in particular is. This in particular means that it does not ensure that all of the input is consumed.
I see that there is no direct way of ensuring that all of the input has been consumed at the moment.
I suggest we add a way of ensuring that to the HasParameter
trait, and perhaps a helper method that would then combine .get
and ensure-we-are-at-the-end
.
Would this work for you as well?
This is related to #64
HasParameter now implies Seek as a result of #137 So I am closing this as resolved.
Description It can be seen that my parameter is a structure, and the parsing in the contract is an address, but I don't understand why the parsing can be successful, it feels like the first 32 bytes taken directly can be converted into an address, then the following elements are directly discarded , which is unreasonable.
Expected Result It should return an error in time or fail to execute!
Versions
concordium-std = {version = "2.0.0", default-features = false}