stratisproject / StratisBitcoinFullNode

Bitcoin full node in C#
https://stratisplatform.com
MIT License
783 stars 315 forks source link

[SmartContracts] Failure to Get/Set String 1 Char Length #4195

Closed mrtpain closed 3 years ago

mrtpain commented 3 years ago

Issue

Setting a single character length string in persistent state will return an empty string. Mocking through tests returns the character as expected but when run via FN, the result is an empty string.

I know char type exists for this purpose but I'd still expect using a string type to be able to handle this scenario.

How to reproduce

Use Case

This will come up when contracts need to store a nullable number type. The need to determine null rather than default 0 value causes developers to store this value as a string bringing up this issue if the string is 1 character in length (e.g. a valid 0 value).

cc @zeptin @fassadlr

rowandh commented 3 years ago

Hey @mrtpain, this was fixed in https://github.com/stratisproject/StratisBitcoinFullNode/pull/4182.

mrtpain commented 3 years ago

Ok thank you @rowandh I will test with a later version of the FN and close this once I do, currently working with 3.0.5.0 and Cirrus Core Hackathon edition 1.3.1 because resource constraints in 1.4.0 using 3.0.8.0 and docker.