Skip to content

Commit ba6f515

Browse files
committed
Rename receiver::v2::ReceiverState receiver::v2::State
1 parent 23e4fc7 commit ba6f515

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

payjoin/src/receive/v2/mod.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -153,20 +153,20 @@ impl ReceiverTypeState {
153153
}
154154
}
155155

156-
pub trait ReceiverState {}
156+
pub trait State {}
157157

158158
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
159-
pub struct Receiver<State: ReceiverState> {
159+
pub struct Receiver<State> {
160160
pub(crate) state: State,
161161
}
162162

163-
impl<State: ReceiverState> core::ops::Deref for Receiver<State> {
163+
impl<State> core::ops::Deref for Receiver<State> {
164164
type Target = State;
165165

166166
fn deref(&self) -> &Self::Target { &self.state }
167167
}
168168

169-
impl<State: ReceiverState> core::ops::DerefMut for Receiver<State> {
169+
impl<State> core::ops::DerefMut for Receiver<State> {
170170
fn deref_mut(&mut self) -> &mut Self::Target { &mut self.state }
171171
}
172172

@@ -202,7 +202,7 @@ pub fn process_err_res(body: &[u8], context: ohttp::ClientResponse) -> Result<()
202202
/// The receiver is not initialized yet, no session context is available yet
203203
pub struct UninitializedReceiver {}
204204

205-
impl ReceiverState for UninitializedReceiver {}
205+
impl State for UninitializedReceiver {}
206206

207207
impl Receiver<UninitializedReceiver> {
208208
/// Creates a new [`Receiver<Initialized>`] with the provided parameters.
@@ -250,7 +250,7 @@ pub struct Initialized {
250250
context: SessionContext,
251251
}
252252

253-
impl ReceiverState for Initialized {}
253+
impl State for Initialized {}
254254

255255
impl Receiver<Initialized> {
256256
/// Extract an OHTTP Encapsulated HTTP GET request for the Original PSBT
@@ -432,7 +432,7 @@ pub struct UncheckedProposal {
432432
pub(crate) context: SessionContext,
433433
}
434434

435-
impl ReceiverState for UncheckedProposal {}
435+
impl State for UncheckedProposal {}
436436

437437
impl Receiver<UncheckedProposal> {
438438
/// Call after checking that the Original PSBT can be broadcast.
@@ -503,7 +503,7 @@ pub struct MaybeInputsOwned {
503503
context: SessionContext,
504504
}
505505

506-
impl ReceiverState for MaybeInputsOwned {}
506+
impl State for MaybeInputsOwned {}
507507

508508
impl Receiver<MaybeInputsOwned> {
509509
/// The Sender's Original PSBT
@@ -554,7 +554,7 @@ pub struct MaybeInputsSeen {
554554
context: SessionContext,
555555
}
556556

557-
impl ReceiverState for MaybeInputsSeen {}
557+
impl State for MaybeInputsSeen {}
558558

559559
impl Receiver<MaybeInputsSeen> {
560560
/// Make sure that the original transaction inputs have never been seen before.
@@ -601,7 +601,7 @@ pub struct OutputsUnknown {
601601
context: SessionContext,
602602
}
603603

604-
impl ReceiverState for OutputsUnknown {}
604+
impl State for OutputsUnknown {}
605605

606606
impl Receiver<OutputsUnknown> {
607607
/// Find which outputs belong to the receiver
@@ -645,7 +645,7 @@ pub struct WantsOutputs {
645645
context: SessionContext,
646646
}
647647

648-
impl ReceiverState for WantsOutputs {}
648+
impl State for WantsOutputs {}
649649

650650
impl Receiver<WantsOutputs> {
651651
/// Whether the receiver is allowed to substitute original outputs or not.
@@ -699,7 +699,7 @@ pub struct WantsInputs {
699699
context: SessionContext,
700700
}
701701

702-
impl ReceiverState for WantsInputs {}
702+
impl State for WantsInputs {}
703703

704704
impl Receiver<WantsInputs> {
705705
/// Select receiver input such that the payjoin avoids surveillance.
@@ -762,7 +762,7 @@ pub struct ProvisionalProposal {
762762
context: SessionContext,
763763
}
764764

765-
impl ReceiverState for ProvisionalProposal {}
765+
impl State for ProvisionalProposal {}
766766

767767
impl Receiver<ProvisionalProposal> {
768768
/// Return a Payjoin Proposal PSBT that the sender will find acceptable.
@@ -810,7 +810,7 @@ pub struct PayjoinProposal {
810810
context: SessionContext,
811811
}
812812

813-
impl ReceiverState for PayjoinProposal {}
813+
impl State for PayjoinProposal {}
814814

815815
impl PayjoinProposal {
816816
#[cfg(feature = "_multiparty")]

0 commit comments

Comments
 (0)