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

chain: add TestMempoolAccept to chain interface #899

Merged
merged 4 commits into from
Jan 22, 2024

Conversation

yyforyongyu
Copy link
Collaborator

TestMempoolAccept is now added to chain interface so it can be accessed via chain io in lnd.

wallet/wallet.go Outdated
@@ -4131,7 +4131,7 @@ func MapBroadcastBackendError(err error) error {
//
// https://github.com/bitcoin/bitcoin/blob/9bf5768dd628b3a7c30dd42b5ed477a92c4d3540/src/node/transaction.cpp#L49
// https://github.com/bitcoin/bitcoin/blob/0.20/src/validation.cpp#L642
case match(err, "missing inputs") ||
case match(err, "missing-inputs") ||
Copy link
Member

Choose a reason for hiding this comment

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

😣

Copy link
Member

Choose a reason for hiding this comment

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

Wondering what we can do in the future to catch stuff like this...

Ofc it's the case that string error matching is fragile to being with, wish we had some concrete error codes here.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These two are my primary source when comparing RPC errors, as I'm not sure how bitcoind converts them internally, so I can only rely on the end results from its rpc responses,

Also updated the link, and added a new method to properly handle error matching. Meanwhile plan to work on something in btcd/btcjson - this way we can have a single place to track the bitcoind errors and handles the matching then turning them into defined error types.

@yyforyongyu yyforyongyu force-pushed the add-testmempool branch 2 times, most recently from 8d0af32 to 956cc29 Compare January 15, 2024 12:20
@saubyk
Copy link

saubyk commented Jan 18, 2024

cc: @ellemouton for review

Copy link
Collaborator

@ellemouton ellemouton left a comment

Choose a reason for hiding this comment

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

lgtm!

go.mod Outdated Show resolved Hide resolved
Copy link
Member

@Roasbeef Roasbeef left a comment

Choose a reason for hiding this comment

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

LGTM 🍭

@Roasbeef Roasbeef merged commit f1648e9 into btcsuite:master Jan 22, 2024
3 checks passed
@yyforyongyu yyforyongyu deleted the add-testmempool branch January 22, 2024 18:40
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.

4 participants