multi: finalize rename from uncharge to loop out

This commit is contained in:
Olaoluwa Osuntokun 2019-03-06 20:32:24 -08:00
parent e299dc696c
commit 94f347e673
No known key found for this signature in database
GPG key ID: CE58F7F8E20FD9A2
26 changed files with 656 additions and 572 deletions

25
swap.go
View file

@ -5,33 +5,34 @@ import (
"time"
"github.com/lightninglabs/loop/lndclient"
"github.com/lightninglabs/loop/utils"
"github.com/lightninglabs/loop/loopdb"
"github.com/lightninglabs/loop/swap"
"github.com/lightningnetwork/lnd/lntypes"
)
type swapKit struct {
htlc *utils.Htlc
htlc *swap.Htlc
hash lntypes.Hash
height int32
log *utils.SwapLog
log *SwapLog
lastUpdateTime time.Time
cost SwapCost
state SwapState
state loopdb.SwapState
executeConfig
swapConfig
contract *SwapContract
swapType SwapType
contract *loopdb.SwapContract
swapType Type
}
func newSwapKit(hash lntypes.Hash, swapType SwapType, cfg *swapConfig,
contract *SwapContract) (*swapKit, error) {
func newSwapKit(hash lntypes.Hash, swapType Type, cfg *swapConfig,
contract *loopdb.SwapContract) (*swapKit, error) {
// Compose expected on-chain swap script
htlc, err := utils.NewHtlc(
htlc, err := swap.NewHtlc(
contract.CltvExpiry, contract.SenderKey,
contract.ReceiverKey, hash,
)
@ -45,7 +46,7 @@ func newSwapKit(hash lntypes.Hash, swapType SwapType, cfg *swapConfig,
return nil, err
}
log := &utils.SwapLog{
log := &SwapLog{
Hash: hash,
Logger: logger,
}
@ -57,7 +58,7 @@ func newSwapKit(hash lntypes.Hash, swapType SwapType, cfg *swapConfig,
hash: hash,
log: log,
htlc: htlc,
state: StateInitiated,
state: loopdb.StateInitiated,
contract: contract,
swapType: swapType,
}, nil
@ -91,6 +92,6 @@ type genericSwap interface {
type swapConfig struct {
lnd *lndclient.LndServices
store swapClientStore
store loopdb.SwapStore
server swapServerClient
}