Skip to content

Commit

Permalink
remove APIError::CannotOpenChannel
Browse files Browse the repository at this point in the history
  • Loading branch information
zoedberg committed Nov 5, 2024
1 parent ed92339 commit 13f36bd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
4 changes: 0 additions & 4 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ pub enum APIError {
#[error("Batch transfer cannot be set to failed status")]
CannotFailBatchTransfer,

#[error("Cannot open channel: {0}")]
CannotOpenChannel(String),

#[error("Cannot call other APIs while node is changing state")]
ChangingState,

Expand Down Expand Up @@ -315,7 +312,6 @@ impl IntoResponse for APIError {
| APIError::BatchTransferNotFound
| APIError::CannotEstimateFees
| APIError::CannotFailBatchTransfer
| APIError::CannotOpenChannel(_)
| APIError::ChangingState
| APIError::FailedBroadcast(_)
| APIError::FailedBitcoindConnection(_)
Expand Down
3 changes: 1 addition & 2 deletions src/routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2745,8 +2745,7 @@ pub(crate) async fn open_channel(
)
})
.await
.unwrap()
.map_err(|e| APIError::CannotOpenChannel(format!("{:?}", e)))?;
.unwrap()?;
}

*unlocked_state.rgb_send_lock.lock().unwrap() = true;
Expand Down
4 changes: 2 additions & 2 deletions src/test/openchannel_fail.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@ async fn open_fail() {
check_response_is_nok(
res,
reqwest::StatusCode::FORBIDDEN,
"Cannot open channel: InsufficientAllocationSlots",
"CannotOpenChannel",
"No uncolored UTXOs are available (hint: call createutxos)",
"NoAvailableUtxos",
)
.await;

Expand Down

0 comments on commit 13f36bd

Please sign in to comment.