stellar / rs-soroban-sdk

Rust SDK for Soroban contracts.
Apache License 2.0
118 stars 66 forks source link

Add a conversion from Hash->Bytes #1272

Closed leighmcculloch closed 4 months ago

leighmcculloch commented 4 months ago

What

Add a conversion from Hash->Bytes.

Why

In a prototype I'm working on I take a Hash value and append it to an existing Bytes, and noticed that prior to this release of the SDK I could call .into() on the value because it was prior a BytesN<32>. Now that it is a Hash I don't seem to be able to call .into() on it in the same context.

Since the type is trivially convertible to a BytesN<32> it seems reasonable to keep the trivial convertibility into a Bytes.

leighmcculloch commented 4 months ago

I'd like to slip this into the final release of the SDK.