Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create bolt12 offer support #148

Closed
wants to merge 1 commit into from

Conversation

JasonCWang
Copy link
Contributor

@JasonCWang JasonCWang commented Jan 8, 2025

=== RUN   TestCreateOffer
2025/01/10 13:23:01 &{Offer:01945219-5c96-9881-0000-a02e6c68e737 2025-01-10 21:23:01.39838 +0000 +0000 lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqwvfdqq2qqgwsqkx5cm573fa0e4zx6pv0aer3lm3497n0n9td76x8ycnsarkr0su0qp2wter3tlckydyqfh3pnyx9vd6d6q8jms9vz7vu4ad694jzmkuf3qzqf6r84d30uz7lp2adazlxuls4ktffdat036f338nw82d63eka02r7qpn3ntp8gm0zkya2mawh4yuz7xv2kdlx3ls7spxcllyn687nvqz0vmjnscs0xel6yytle94n7a3cm7yrw97jypwd433mv89a9e5kvp2zmjzwfxsmyc2vlgsgzs265hnjam8grw529sq9j8lt2274fnj2tgc7mscg3g3n73tx53pd8kn0pffgkrh4frvq7xsyx6gezlw5vset8l2fw5dzcssy79l0dvyjrt3h7ve6dyq2dy72gch05zjxskkg76vpeq2r5dsd6ul {10000000 3 4 949 949.667616334283} <nil> Offer}
2025/01/10 13:23:01 <nil>
    local_client_test.go:35: &{Offer:01945219-5c96-9881-0000-a02e6c68e737 2025-01-10 21:23:01.39838 +0000 +0000 lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqwvfdqq2qqgwsqkx5cm573fa0e4zx6pv0aer3lm3497n0n9td76x8ycnsarkr0su0qp2wter3tlckydyqfh3pnyx9vd6d6q8jms9vz7vu4ad694jzmkuf3qzqf6r84d30uz7lp2adazlxuls4ktffdat036f338nw82d63eka02r7qpn3ntp8gm0zkya2mawh4yuz7xv2kdlx3ls7spxcllyn687nvqz0vmjnscs0xel6yytle94n7a3cm7yrw97jypwd433mv89a9e5kvp2zmjzwfxsmyc2vlgsgzs265hnjam8grw529sq9j8lt2274fnj2tgc7mscg3g3n73tx53pd8kn0pffgkrh4frvq7xsyx6gezlw5vset8l2fw5dzcssy79l0dvyjrt3h7ve6dyq2dy72gch05zjxskkg76vpeq2r5dsd6ul {10000000 3 4 949 949.667616334283} <nil> Offer}
--- PASS: TestCreateOffer (0.50s)

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

objects/offer.go Outdated Show resolved Hide resolved
objects/offer_data.go Outdated Show resolved Hide resolved
@JasonCWang JasonCWang force-pushed the 01-07-create_bolt12_offer_support branch from 8757977 to 07a6d5b Compare January 8, 2025 21:39
@JasonCWang JasonCWang marked this pull request as ready for review January 9, 2025 18:33
@JasonCWang JasonCWang marked this pull request as draft January 9, 2025 19:24
@JasonCWang JasonCWang force-pushed the 01-07-create_bolt12_offer_support branch from 07a6d5b to 07e2de8 Compare January 9, 2025 23:23
@JasonCWang JasonCWang marked this pull request as ready for review January 10, 2025 00:12
@JasonCWang JasonCWang requested a review from zhenlu January 10, 2025 21:26
Copy link
Contributor

@zhenlu zhenlu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you run the generator to generate the objects or you wrote it manually?

Copy link
Contributor Author

Oh I wrote it manually.. since I updated the graphql schema in sparkcore, I need to run introspection again?

Copy link
Contributor

zhenlu commented Jan 10, 2025

yeah, everything in the objects folder needs to be generated.

Copy link
Contributor Author

Shut right, will update that. Thanks for the reminder!

zhenlu
zhenlu previously approved these changes Jan 14, 2025
if err != nil {
return nil, errors.New("error parsing offer")
}
json.Unmarshal(offerJson, &offer)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error from json.Unmarshal should be captured and handled. Consider updating to:

if err := json.Unmarshal(offerJson, &offer); err != nil {
    return nil, err
}

This ensures that any deserialization errors are properly propagated to the caller.

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

Copy link
Contributor Author

@JasonCWang JasonCWang marked this pull request as draft January 16, 2025 18:51
@JasonCWang JasonCWang closed this Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants