Skip to content

Commit

Permalink
Merge pull request #2187 from benthecarman/invoice-serde-no-std
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBlueMatt authored Apr 17, 2023
2 parents e1e3819 + 36f610c commit ac004a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ci/ci-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ for DIR in lightning lightning-invoice lightning-rapid-gossip-sync; do
RUSTFLAGS="--cfg=c_bindings" cargo test --verbose --color always --no-default-features --features=no-std
popd
done
# This one only works for lightning-invoice
pushd lightning-invoice
# check that compile with no-std and serde works in lightning-invoice
cargo test --verbose --color always --no-default-features --features no-std --features serde
popd

echo -e "\n\nTesting no-std build on a downstream no-std crate"
# check no-std compatibility across dependencies
Expand Down
2 changes: 1 addition & 1 deletion lightning-invoice/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1648,7 +1648,7 @@ impl<'de> Deserialize<'de> for Invoice {
fn deserialize<D>(deserializer: D) -> Result<Invoice, D::Error> where D: Deserializer<'de> {
let bolt11 = String::deserialize(deserializer)?
.parse::<Invoice>()
.map_err(|e| D::Error::custom(format!("{:?}", e)))?;
.map_err(|e| D::Error::custom(alloc::format!("{:?}", e)))?;

Ok(bolt11)
}
Expand Down

0 comments on commit ac004a9

Please sign in to comment.