Skip to content

Refactor ohttp keys - #317

Merged
DanGould merged 4 commits into
payjoin:masterfrom
DanGould:refactor-ohttp-keys
Jul 2, 2024
Merged

Refactor ohttp keys#317
DanGould merged 4 commits into
payjoin:masterfrom
DanGould:refactor-ohttp-keys

Conversation

@DanGould

@DanGould DanGould commented Jun 29, 2024

Copy link
Copy Markdown
Member

Refactor OhttpKeys so that #300 can just focus on semantics.

  • First Commit removes a clippy warning
  • 2nd reduces unnecessary base64 verbosity. base64 dependency was being used where psbt.to_string was fine, and the custom configs were being built where confs could do
  • 3rd removes a vestigial PartialEq implementation
  • 4th disambiguates Display and Serialize roles. OHTTP KeyConfigs encoding for serialization is well specified by the rfc. We're using string representations in URLs and configs just for Payjoin V2 which is a separate thing

DanGould added 4 commits July 2, 2024 18:22
- use psbt.to_string() to get base64
- use base64::encode/decode_config with const configs
The `OhttpKeys` type is `Eq` so explicit impl can be replaced with
a derive macro.
@DanGould
DanGould force-pushed the refactor-ohttp-keys branch from 4ced3de to b7cf5e8 Compare July 2, 2024 22:32
@DanGould

DanGould commented Jul 2, 2024

Copy link
Copy Markdown
Member Author

I did a self review that re-ordered commits to put clippy first and change Error variants to exclude the word "Error" because it's redundant.

@DanGould
DanGould merged commit f978f41 into payjoin:master Jul 2, 2024
@DanGould
DanGould deleted the refactor-ohttp-keys branch July 2, 2024 22: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.

1 participant