Skip to content

Commit 268db78

Browse files
seditedh4sh3d
andcommitted
Swap: Derive strict encoding for Alice, Bob, and KeyManager (farcaster-project#318)
* Swap: Derive strict encoding for Alice, Bob, and KeyManager * chore: update changelog Co-authored-by: h4sh3d <h4sh3d@protonmail.com>
1 parent 441b42a commit 268db78

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- Derive strict encoding for `Alice` (segwit v0), `Bob` (segwit v0), and `KeyManager` by @TheCharlatan ([#318](https://github.com/farcaster-project/farcaster-core/pull/318))
13+
1014
### Changed
1115

1216
- Fee strategy `range` support is now under the new crate feature `fee_range` and disable by default ([#314](https://github.com/farcaster-project/farcaster-core/pull/314))

src/swap/btcxmr.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,11 @@ pub type Parameters = protocol::Parameters<
8080

8181
/// Fully defined type for Bitcoin-Monero atomic swap Alice protocol role.
8282
pub type Alice = protocol::Alice<bitcoin::Address, BitcoinSegwitV0, Monero>;
83+
impl_strict_encoding!(Alice);
8384

8485
/// Fully defined type for Bitcoin-Monero atomic swap Bob protocol role.
8586
pub type Bob = protocol::Bob<bitcoin::Address, BitcoinSegwitV0, Monero>;
87+
impl_strict_encoding!(Bob);
8688

8789
/// Fully defined type for Bitcoin-Monero atomic swap trade.
8890
pub type DealParameters =
@@ -224,6 +226,8 @@ impl Decodable for KeyManager {
224226
}
225227
}
226228

229+
impl_strict_encoding!(KeyManager);
230+
227231
impl KeyManager {
228232
/// Generate the derivation path of an account key, computed as:
229233
/// `m/44'/{blockchain}'/{swap_index}'`.

0 commit comments

Comments
 (0)