mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
loop+cmd: extract types into swap module
This commit is contained in:
parent
7a1680d7d6
commit
69f2af9fdc
13 changed files with 104 additions and 89 deletions
25
interface.go
25
interface.go
|
|
@ -5,6 +5,7 @@ import (
|
|||
|
||||
"github.com/btcsuite/btcutil"
|
||||
"github.com/lightninglabs/loop/loopdb"
|
||||
"github.com/lightninglabs/loop/swap"
|
||||
"github.com/lightningnetwork/lnd/lntypes"
|
||||
)
|
||||
|
||||
|
|
@ -235,28 +236,6 @@ type SwapInfoKit struct {
|
|||
LastUpdateTime time.Time
|
||||
}
|
||||
|
||||
// Type indicates the type of swap.
|
||||
type Type uint8
|
||||
|
||||
const (
|
||||
// TypeIn is a loop in swap.
|
||||
TypeIn Type = iota
|
||||
|
||||
// TypeOut is a loop out swap.
|
||||
TypeOut
|
||||
)
|
||||
|
||||
func (t Type) String() string {
|
||||
switch t {
|
||||
case TypeIn:
|
||||
return "In"
|
||||
case TypeOut:
|
||||
return "Out"
|
||||
default:
|
||||
return "Unknown"
|
||||
}
|
||||
}
|
||||
|
||||
// SwapInfo exposes common info fields for loop in and loop out swaps.
|
||||
type SwapInfo struct {
|
||||
loopdb.SwapStateData
|
||||
|
|
@ -265,7 +244,7 @@ type SwapInfo struct {
|
|||
|
||||
SwapHash lntypes.Hash
|
||||
|
||||
SwapType Type
|
||||
SwapType swap.Type
|
||||
|
||||
loopdb.SwapContract
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue