mirror of
https://github.com/lightninglabs/pool.git
synced 2026-08-13 12:33:04 +02:00
rpcserver: marshall channel type in order list
This commit is contained in:
parent
a85a4ae60e
commit
e8a0127c7d
1 changed files with 17 additions and 0 deletions
17
rpcserver.go
17
rpcserver.go
|
|
@ -1533,6 +1533,9 @@ func (s *rpcServer) ListOrders(ctx context.Context,
|
|||
CreationTimestampNs: uint64(evt.Timestamp().UnixNano()),
|
||||
Events: rpcEvents,
|
||||
MinUnitsMatch: uint32(dbOrder.Details().MinUnitsMatch),
|
||||
ChannelType: marshallChannelType(
|
||||
dbOrder.Details().ChannelType,
|
||||
),
|
||||
}
|
||||
|
||||
switch o := dbOrder.(type) {
|
||||
|
|
@ -2950,6 +2953,20 @@ func unmarshallNodeTier(nodeTier auctioneerrpc.NodeTier) (order.NodeTier,
|
|||
}
|
||||
}
|
||||
|
||||
// marshallChannelType maps the channel type into the RPC counterpart.
|
||||
func marshallChannelType(
|
||||
channelType order.ChannelType) auctioneerrpc.OrderChannelType {
|
||||
|
||||
switch channelType {
|
||||
case order.ChannelTypePeerDependent:
|
||||
return auctioneerrpc.OrderChannelType_ORDER_CHANNEL_TYPE_PEER_DEPENDENT
|
||||
case order.ChannelTypeScriptEnforced:
|
||||
return auctioneerrpc.OrderChannelType_ORDER_CHANNEL_TYPE_SCRIPT_ENFORCED
|
||||
default:
|
||||
return auctioneerrpc.OrderChannelType_ORDER_CHANNEL_TYPE_UNKNOWN
|
||||
}
|
||||
}
|
||||
|
||||
// marshallChannelInfo turns the given channel information map into its RPC
|
||||
// counterpart.
|
||||
func marshallChannelInfo(chanInfos map[wire.OutPoint]*chaninfo.ChannelInfo) (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue