Skip to content

Commit eabd1fa

Browse files
committed
fix: impl Display on RegistrationStatus
Signed-off-by: William Hankins <william@sundae.fi>
1 parent aaa06ae commit eabd1fa

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

common/src/queries/accounts.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,15 @@ pub enum RegistrationStatus {
131131
Deregistered,
132132
}
133133

134+
impl std::fmt::Display for RegistrationStatus {
135+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
136+
match self {
137+
RegistrationStatus::Registered => write!(f, "registered"),
138+
RegistrationStatus::Deregistered => write!(f, "deregistered"),
139+
}
140+
}
141+
}
142+
134143
#[derive(
135144
Debug, Clone, serde::Serialize, serde::Deserialize, minicbor::Decode, minicbor::Encode,
136145
)]

modules/rest_blockfrost/src/handlers/accounts.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,7 @@ pub async fn handle_account_registrations_blockfrost(
199199

200200
rest_response.push(RegistrationUpdateREST {
201201
tx_hash: hex::encode(tx_hash),
202-
action: if r.deregistered {
203-
"deregistered".to_string()
204-
} else {
205-
"registered".to_string()
206-
},
202+
action: r.status.to_string(),
207203
});
208204
}
209205

0 commit comments

Comments
 (0)