Skip to content

Commit

Permalink
rfqmsg: remove unused RFQ reject message error types
Browse files Browse the repository at this point in the history
Eliminating these error types ensures that all current errors align with
those documented in the BLIP.
  • Loading branch information
ffranr committed Sep 16, 2024
1 parent ad1b5d5 commit 9351be1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
14 changes: 0 additions & 14 deletions rfqmsg/reject.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,20 +103,6 @@ var (
Code: 1,
Msg: "price oracle unavailable",
}

// ErrNoSuitableSellOffer is the error code for when there is no
// suitable sell offer available.
ErrNoSuitableSellOffer = RejectErr{
Code: 2,
Msg: "no suitable sell offer available",
}

// ErrNoSuitableBuyOffer is the error code for when there is no suitable
// buy offer available.
ErrNoSuitableBuyOffer = RejectErr{
Code: 3,
Msg: "no suitable buy offer available",
}
)

const (
Expand Down
10 changes: 8 additions & 2 deletions rfqmsg/reject_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,20 @@ func TestRejectEncodeDecode(t *testing.T) {
peer: route.Vertex{1, 2, 3},
version: 0,
id: id,
err: ErrNoSuitableSellOffer,
},
{
testName: "all fields populated with basic values",
peer: route.Vertex{1, 2, 3},
version: 5,
id: id,
err: ErrNoSuitableBuyOffer,
},
{
testName: "all fields populated with basic values; " +
"error field populated",
peer: route.Vertex{1, 2, 3},
version: 5,
id: id,
err: ErrPriceOracleUnavailable,
},
}

Expand Down

0 comments on commit 9351be1

Please sign in to comment.