Skip to content

Commit

Permalink
Merge #4786
Browse files Browse the repository at this point in the history
4786: Remove revert on deser in try_get_named_arg introduced in #4569 r=darthsiroftardis a=gRoussac

Remove revert in try_get_named_arg introduced in #4569

#4569 (comment)

method unused yet in contracts


Co-authored-by: gRoussac <gRoussac@users.noreply.github.com>
  • Loading branch information
casperlabs-bors-ng[bot] and gRoussac authored Jul 18, 2024
2 parents 9dec8ac + 94e8785 commit db708d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion smart_contracts/contract/src/contract_api/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ pub fn try_get_named_arg<T: FromBytes>(name: &str) -> Option<T> {
// Avoids allocation with 0 bytes and a call to get_named_arg
Vec::new()
};
bytesrepr::deserialize(arg_bytes).unwrap_or_revert_with(ApiError::InvalidArgument)
bytesrepr::deserialize(arg_bytes).ok()
}

/// Returns the caller of the current context, i.e. the [`AccountHash`] of the account which made
Expand Down

0 comments on commit db708d2

Please sign in to comment.