Skip to content

Commit

Permalink
fix lowlevel_data (#924)
Browse files Browse the repository at this point in the history
Co-authored-by: shaorongqiang <[email protected]>
  • Loading branch information
shaorongqiang and shiran555 authored Apr 13, 2023
1 parent 8f7a8b5 commit e36e7a3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ledger/src/converter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ use zei::xfr::{
structs::{AssetType, XfrAmount, XfrAssetType},
};

#[inline(always)]
fn is_empty(x: &Option<Vec<u8>>) -> bool {
match x {
Some(v) => !v.is_empty(),
None => false,
}
}
/// Use this operation to transfer.
///
/// This operation only support binded xfr_address is sender address.
Expand All @@ -32,7 +39,7 @@ pub struct ConvertAccount {
pub asset_type: Option<AssetType>,

/// convert asset lowlevel data.
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(skip_serializing_if = "is_empty")]
pub lowlevel_data: Option<Vec<u8>>,
}

Expand Down

0 comments on commit e36e7a3

Please sign in to comment.