stratisproject / StratisBitcoinFullNode

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

Within smart contracts we need to be able to convert all allowed types to byte arrays and back. #1714

Closed codingupastorm closed 6 years ago

codingupastorm commented 6 years ago

We don't want to open direct access to System.Text or BitConverter, however we still need to convert between bytes and the below types. Useful for hashing etc.

Bool should go back and forwards with byte.

The others should be translatable to bytes:

We should have a NuGet package purely for this implementation, likely something like Stratis.SmartContracts.ByteHelper.

codingupastorm commented 6 years ago

Update on this:

codingupastorm commented 6 years ago

We ultimately decided to implement a Converter that will be injected into the SmartContract.

Acceptance Criteria: