Skip to content

Commit

Permalink
fix(iota): fix Option<address> serialization in client_ptb (#5143)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thoralf-M authored Feb 4, 2025
1 parent 6332a46 commit da1ba42
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions crates/iota/src/client_ptb/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,21 @@ impl Argument {
{
MoveValue::Vector(s.bytes().map(MoveValue::U8).collect::<Vec<_>>())
}
(Argument::Option(sp!(loc, o)), TypeTag::Vector(ty)) => {
if let Some(v) = o {
let v = v
.as_ref()
.checked_to_pure_move_value(*loc, ty)
.map_err(|e| {
e.with_help(
"Literal option values cannot contain object values.".to_string(),
)
})?;
MoveValue::Vector(vec![v])
} else {
MoveValue::Vector(vec![])
}
}
(Argument::Option(sp!(loc, o)), TypeTag::Struct(stag))
if (
&stag.address,
Expand Down

0 comments on commit da1ba42

Please sign in to comment.