forked from payjoin/rust-payjoin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Produce
receive::JsonError
accurately so that send
can properly h…
…andle it (payjoin#506) - [Isolate receive::JsonError from fmt::Display](payjoin@ffe6281) - [Reject bad v1 requests as original-psbt-rejected](payjoin@9a323ef) since that's the only way v1 senders can really address their issue. It's a payload error but that's the same as Original PSBT [payload] in BIP 78 parlance. This change also introduces `const` values for well known error codes for both `send` and `receive` to share to prevent slipped typos during maintenance.
- Loading branch information
Showing
8 changed files
with
162 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//! Well-known error codes as defined in BIP-78 | ||
//! See: <https://github.com/bitcoin/bips/blob/master/bip-0078.mediawiki#receivers-well-known-errors> | ||
/// The payjoin endpoint is not available for now. | ||
pub const UNAVAILABLE: &str = "unavailable"; | ||
|
||
/// The receiver added some inputs but could not bump the fee of the payjoin proposal. | ||
pub const NOT_ENOUGH_MONEY: &str = "not-enough-money"; | ||
|
||
/// This version of payjoin is not supported. | ||
pub const VERSION_UNSUPPORTED: &str = "version-unsupported"; | ||
|
||
/// The receiver rejected the original PSBT. | ||
pub const ORIGINAL_PSBT_REJECTED: &str = "original-psbt-rejected"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters