From b49d2827a261da33b7f13fbd9a0554dbebe01554 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Thu, 22 Dec 2016 12:53:20 -0800 Subject: [PATCH] lnwallet/btcwallet: add compile-time interface assertions for Signer+BlockChainIO --- lnwallet/btcwallet/blockchain.go | 5 +++++ lnwallet/btcwallet/signer.go | 4 ++++ routing/fibonacci.go | 1 + 3 files changed, 10 insertions(+) create mode 100644 routing/fibonacci.go diff --git a/lnwallet/btcwallet/blockchain.go b/lnwallet/btcwallet/blockchain.go index 5618d6e83..4853b1e7d 100644 --- a/lnwallet/btcwallet/blockchain.go +++ b/lnwallet/btcwallet/blockchain.go @@ -3,6 +3,7 @@ package btcwallet import ( "encoding/hex" + "github.com/lightningnetwork/lnd/lnwallet" "github.com/roasbeef/btcd/wire" ) @@ -73,3 +74,7 @@ func (b *BtcWallet) GetBlockHash(blockHeight int64) (*wire.ShaHash, error) { return blockHash, nil } + +// A compile time check to ensure that BtcWallet implements the BlockChainIO +// interface. +var _ lnwallet.WalletController = (*BtcWallet)(nil) diff --git a/lnwallet/btcwallet/signer.go b/lnwallet/btcwallet/signer.go index 470208fce..2579386ce 100644 --- a/lnwallet/btcwallet/signer.go +++ b/lnwallet/btcwallet/signer.go @@ -199,3 +199,7 @@ func (b *BtcWallet) ComputeInputScript(tx *wire.MsgTx, return inputScript, nil } + +// A compile time check to ensure that BtcWallet implements the Signer +// interface. +var _ lnwallet.Signer = (*BtcWallet)(nil) diff --git a/routing/fibonacci.go b/routing/fibonacci.go new file mode 100644 index 000000000..4fb0f0cb4 --- /dev/null +++ b/routing/fibonacci.go @@ -0,0 +1 @@ +package routing