No method named "to_le_bytes" found for type "b256"

According to docs this should be the way to convert b256 to byte array.

let recipient_bits:b256 = recipient.bits();
let mut recipient_bytes = recipient_bits.to_le_bytes();

Errors with:

No method named "to_le_bytes" found for type "b256"

Any idea why?

Found the culprit. For anyone looking, I was missing the import for array conversions:

use std::array_conversions::{b256::*,};

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.