Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion zcash_primitives/src/transaction/components/issuance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ fn read_authorization<R: Read>(mut reader: R) -> io::Result<Signed> {

fn read_action<R: Read>(mut reader: R) -> io::Result<IssueAction> {
let asset_descr_bytes = Vector::read(&mut reader, |r| r.read_u8())?;
let asset_descr: String = asset_descr_bytes.iter().map(|&b| b as char).collect();
//TODO: Properly handle non-valid UTF-8 encodings.
let asset_descr: String = String::from_utf8(asset_descr_bytes)
.map_err(|_| Error::new(ErrorKind::InvalidData, "Asset Description not valid UTF-8"))?;
Comment thread
vivek-arte marked this conversation as resolved.
let notes = Vector::read(&mut reader, |r| read_note(r))?;
let finalize = reader.read_u8()? != 0;
Ok(IssueAction::from_parts(asset_descr, notes, finalize))
Expand Down
8 changes: 7 additions & 1 deletion zcash_primitives/src/transaction/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ impl Authorization for TestUnauthorized {
type TzeAuth = tze::Authorized;
}

mod data_v6;
#[test]
fn zip_0244() {
fn to_test_txdata(
Expand Down Expand Up @@ -313,7 +314,12 @@ fn zip_0244() {
(tdata, txdata.digest(TxIdDigester))
}

for tv in self::data::zip_0244::make_test_vectors() {
#[allow(unused_mut)] // mutability required for the V6 case which is flagged off by default
let mut test_vectors = self::data::zip_0244::make_test_vectors();
Comment thread
vivek-arte marked this conversation as resolved.
#[cfg(zcash_unstable = "nu6" /* TODO nu7 */ )]
test_vectors.extend(data_v6::orchard_zsa_digests::make_test_vectors());

for tv in test_vectors {
let (txdata, txid_parts) = to_test_txdata(&tv);

if let Some(index) = tv.transparent_input {
Expand Down
Loading