Skip to content

Commit 063a956

Browse files
committed
fix json reason format
1 parent 5589a32 commit 063a956

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

protocol/src/lib.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,7 @@ pub enum Covenant {
115115
#[derive(Copy, Clone, PartialEq, Debug)]
116116
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
117117
#[cfg_attr(feature = "bincode", derive(Encode, Decode))]
118-
#[cfg_attr(
119-
feature = "serde",
120-
serde(rename_all = "snake_case", tag = "revoke_reason")
121-
)]
118+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
122119
pub enum RevokeReason {
123120
BidPsbt(BidPsbtReason),
124121
/// Space was prematurely spent during the auctions phase
@@ -138,14 +135,14 @@ pub enum RevokeReason {
138135
#[cfg_attr(feature = "bincode", derive(Encode, Decode))]
139136
pub enum RejectReason {
140137
AlreadyExists,
141-
BidPSBT(BidPsbtReason),
138+
BidPsbt(BidPsbtReason),
142139
}
143140

144141
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
145142
#[cfg_attr(
146143
feature = "serde",
147144
derive(Serialize, Deserialize),
148-
serde(rename_all = "snake_case", tag = "bid_psbt_reason")
145+
serde(rename_all = "snake_case")
149146
)]
150147
#[cfg_attr(feature = "bincode", derive(Encode, Decode))]
151148
pub enum BidPsbtReason {

protocol/src/validate.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ impl Validator {
338338
None => {
339339
let reject = ScriptError::Reject(RejectParams {
340340
name,
341-
reason: RejectReason::BidPSBT(BidPsbtReason::Required),
341+
reason: RejectReason::BidPsbt(BidPsbtReason::Required),
342342
});
343343

344344
changeset.spends[spend_index].script_error = Some(reject);
@@ -350,7 +350,7 @@ impl Validator {
350350
if auctiond.output.is_none() {
351351
let reject = ScriptError::Reject(RejectParams {
352352
name,
353-
reason: RejectReason::BidPSBT(BidPsbtReason::OutputSpent),
353+
reason: RejectReason::BidPsbt(BidPsbtReason::OutputSpent),
354354
});
355355
changeset.spends[spend_index].script_error = Some(reject);
356356
return;
@@ -379,7 +379,7 @@ impl Validator {
379379
if !fullspaceout.verify_bid_sig() {
380380
let reject = ScriptError::Reject(RejectParams {
381381
name: fullspaceout.spaceout.space.unwrap().name,
382-
reason: RejectReason::BidPSBT(BidPsbtReason::BadSignature),
382+
reason: RejectReason::BidPsbt(BidPsbtReason::BadSignature),
383383
});
384384
changeset.spends[spend_index].script_error = Some(reject);
385385
return;

0 commit comments

Comments
 (0)