Skip to content

Commit 6130dac

Browse files
committed
rfq: rename oracle error code values
Changes these to avoid the 'Err..' convention presently reserved for type names.
1 parent aef763a commit 6130dac

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

rfq/negotiator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ func createCustomRejectErr(err error) rfqmsg.RejectErr {
511511
switch oracleError.Code {
512512
// The rejection message will state that the oracle doesn't
513513
// support the asset.
514-
case ErrUnsupportedOracleAsset:
514+
case UnsupportedAssetOracleErrorCode:
515515
msg := oracleError.Msg
516516
return rfqmsg.ErrRejectWithCustomMsg(msg)
517517

rfq/oracle.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ type OracleError struct {
9797
type OracleErrorCode uint8
9898

9999
const (
100-
// ErrUnspecifiedOracleError represents the case where the oracle has
100+
// UnspecifiedOracleErrorCode represents the case where the oracle has
101101
// declined to give a more specific reason for the error.
102-
ErrUnspecifiedOracleError OracleErrorCode = iota
102+
UnspecifiedOracleErrorCode OracleErrorCode = iota
103103

104-
// ErrUnsupportedOracleAsset represents the case in which an oracle does
105-
// not provide quotes for the requested asset.
106-
ErrUnsupportedOracleAsset
104+
// UnsupportedAssetOracleErrorCode represents the case in which an
105+
// oracle does not provide quotes for the requested asset.
106+
UnsupportedAssetOracleErrorCode
107107
)
108108

109109
// Error returns a human-readable string representation of the error.
@@ -385,11 +385,11 @@ func (r *RpcPriceOracle) QuerySellPrice(ctx context.Context,
385385
func marshallErrorCode(code oraclerpc.ErrorCode) OracleErrorCode {
386386
switch code {
387387
case oraclerpc.ErrorCode_ERROR_UNSPECIFIED:
388-
return ErrUnspecifiedOracleError
388+
return UnspecifiedOracleErrorCode
389389
case oraclerpc.ErrorCode_ERROR_UNSUPPORTED:
390-
return ErrUnsupportedOracleAsset
390+
return UnsupportedAssetOracleErrorCode
391391
default:
392-
return ErrUnspecifiedOracleError
392+
return UnspecifiedOracleErrorCode
393393
}
394394
}
395395

0 commit comments

Comments
 (0)