From 3b15bc3771175e478e7dd3d3d2fad79525ce54e5 Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Wed, 20 Sep 2023 18:31:22 +0800 Subject: [PATCH 1/9] chain: add quit signal to mempool to unlock shutdown process This commit adds a quit signal such that mempool can be torn down quickly once the upper layer decides to shut down. --- chain/bitcoind_rpc_events.go | 2 ++ chain/bitcoind_zmq_events.go | 2 ++ chain/mempool.go | 50 ++++++++++++++++++++++++++++++++++-- chain/mempool_test.go | 39 ++++++++++++++++++++++++++++ 4 files changed, 91 insertions(+), 2 deletions(-) diff --git a/chain/bitcoind_rpc_events.go b/chain/bitcoind_rpc_events.go index 5ec2efe8e8..2fdbe46942 100644 --- a/chain/bitcoind_rpc_events.go +++ b/chain/bitcoind_rpc_events.go @@ -116,6 +116,8 @@ func (b *bitcoindRPCPollingEvents) Start() error { // Stop cleans up all the bitcoindRPCPollingEvents resources and goroutines. func (b *bitcoindRPCPollingEvents) Stop() error { + b.mempool.Shutdown() + close(b.quit) b.wg.Wait() return nil diff --git a/chain/bitcoind_zmq_events.go b/chain/bitcoind_zmq_events.go index 0091c1f5bf..b249315f57 100644 --- a/chain/bitcoind_zmq_events.go +++ b/chain/bitcoind_zmq_events.go @@ -168,6 +168,8 @@ func (b *bitcoindZMQEvents) Start() error { // Stop cleans up any of the resources and goroutines held by bitcoindZMQEvents. func (b *bitcoindZMQEvents) Stop() error { + b.mempool.Shutdown() + var returnErr error if err := b.txConn.Close(); err != nil { returnErr = err diff --git a/chain/mempool.go b/chain/mempool.go index 4ce1ea38cf..d6684f9f65 100644 --- a/chain/mempool.go +++ b/chain/mempool.go @@ -95,6 +95,9 @@ func (c *cachedInputs) removeInputsFromTx(txid chainhash.Hash) { type mempool struct { sync.RWMutex + // stopped is used to make sure we only stop mempool once. + stopped sync.Once + // txs stores the txids in the mempool. txs map[chainhash.Hash]bool @@ -111,6 +114,9 @@ type mempool struct { // initFin is a channel that will be closed once the mempool has been // initialized. initFin chan struct{} + + // quit is a channel that will be closed when the mempool exits. + quit chan struct{} } // newMempool creates a new mempool object. @@ -119,10 +125,21 @@ func newMempool(client rpcClient) *mempool { txs: make(map[chainhash.Hash]bool), inputs: newCachedInputs(), initFin: make(chan struct{}), + quit: make(chan struct{}), client: client, } } +// Shutdown signals the mempool to exit. +func (m *mempool) Shutdown() { + log.Debug("Local mempool shutting down...") + defer log.Debug("Local mempool shutdown complete") + + m.stopped.Do(func() { + close(m.quit) + }) +} + // Clean removes any of the given transactions from the mempool if they are // found there. func (m *mempool) Clean(txs []*wire.MsgTx) { @@ -290,7 +307,21 @@ func (m *mempool) updateInputs(tx *wire.MsgTx) { // WaitForInit waits for the mempool to be initialized. func (m *mempool) WaitForInit() { - <-m.initFin + select { + case <-m.initFin: + case <-m.quit: + log.Debugf("Mempool shutting down before init finished") + } +} + +// isShuttingDown returns true if the mempool is shutting down. +func (m *mempool) isShuttingDown() bool { + select { + case <-m.quit: + return true + default: + return false + } } // LoadMempool loads all the raw transactions found in mempool. @@ -310,6 +341,13 @@ func (m *mempool) LoadMempool() error { eg.SetLimit(runtime.NumCPU()) for _, txHash := range txs { + // Before we load the tx, we'll check if we're shutting + // down. If so, we'll exit early. + if m.isShuttingDown() { + log.Info("LoadMempool exited due to shutdown") + return + } + txHash := txHash eg.Go(func() error { @@ -330,7 +368,6 @@ func (m *mempool) LoadMempool() error { log.Debugf("Loaded mempool spends in %v", time.Since(now)) close(m.initFin) - }() return nil @@ -347,12 +384,21 @@ func (m *mempool) UpdateMempoolTxes(txids []*chainhash.Hash) []*wire.MsgTx { // Set all mempool txs to false. m.UnmarkAll() + // TODO(yy): let the OS manage the number of goroutines? var eg errgroup.Group eg.SetLimit(runtime.NumCPU()) // We'll scan through the most recent txs in the mempool to see whether // there are new txs that we need to send to the client. for _, txHash := range txids { + // Before we load the tx, we'll check if we're shutting down. + // If so, we'll exit early. + if m.isShuttingDown() { + log.Info("UpdateMempoolTxes exited due to shutdown") + + return txesToNotify + } + txHash := txHash // If the transaction is already in our local mempool, then we diff --git a/chain/mempool_test.go b/chain/mempool_test.go index a33c8ff83c..a07f47bf4a 100644 --- a/chain/mempool_test.go +++ b/chain/mempool_test.go @@ -520,6 +520,45 @@ func TestUpdateMempoolTxes(t *testing.T) { require.NotContains(m.inputs.txids, tx2Hash) } +// TestUpdateMempoolTxesOnShutdown tests that when the mempool is shutting +// down, UpdateMempoolTxes will also exit immediately. +func TestUpdateMempoolTxesOnShutdown(t *testing.T) { + require := require.New(t) + + // Create a mock client and init our mempool. + mockRPC := &mockRPCClient{} + m := newMempool(mockRPC) + + // Create a normal transaction. + op1 := wire.OutPoint{Hash: chainhash.Hash{1}} + tx1 := &wire.MsgTx{ + LockTime: 1, + TxIn: []*wire.TxIn{ + {PreviousOutPoint: op1}, + }, + } + tx1Hash := tx1.TxHash() + btcTx1 := btcutil.NewTx(tx1) + + // Create the current mempool state. + mempool := []*chainhash.Hash{&tx1Hash} + + // Mock the client to return the txes. + mockRPC.On("GetRawTransaction", &tx1Hash).Return(btcTx1, nil) + + // Shutdown the mempool before updating the txes. + m.Shutdown() + + // Update our mempool using the above mempool state. + newTxes := m.UpdateMempoolTxes(mempool) + + // We expect two transactions. + require.Empty(newTxes) + + // Assert GetRawTransaction is not called because mempool is quit. + mockRPC.AssertNotCalled(t, "GetRawTransaction") +} + // TestGetRawTxIgnoreErr tests that the mempool's GetRawTxIgnoreErr method // works as expected. func TestGetRawTxIgnoreErr(t *testing.T) { From 0efe36f8dedcd4cc158d290a7d79ac8261bd2e70 Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Wed, 20 Sep 2023 21:40:45 +0800 Subject: [PATCH 2/9] chain: refactor `UpdateMempoolTxes` to fetch mempool directly --- chain/bitcoind_rpc_events.go | 13 +++---------- chain/bitcoind_zmq_events.go | 13 +++---------- chain/mempool.go | 8 +++++++- chain/mempool_test.go | 9 ++++++--- 4 files changed, 19 insertions(+), 24 deletions(-) diff --git a/chain/bitcoind_rpc_events.go b/chain/bitcoind_rpc_events.go index 2fdbe46942..a7610758f8 100644 --- a/chain/bitcoind_rpc_events.go +++ b/chain/bitcoind_rpc_events.go @@ -249,16 +249,9 @@ func (b *bitcoindRPCPollingEvents) txEventHandlerRPC() { now := time.Now() // After each ticker interval, we poll the mempool to - // check for transactions we haven't seen yet. - txs, err := b.client.GetRawMempool() - if err != nil { - log.Errorf("Unable to retrieve mempool txs: "+ - "%v", err) - continue - } - - // Update our local mempool with the new mempool. - newTxs := b.mempool.UpdateMempoolTxes(txs) + // check for transactions we haven't seen yet and + // update our local mempool with the new mempool. + newTxs := b.mempool.UpdateMempoolTxes() log.Tracef("Reconciled mempool spends in %v", time.Since(now)) diff --git a/chain/bitcoind_zmq_events.go b/chain/bitcoind_zmq_events.go index b249315f57..5431c9b1b7 100644 --- a/chain/bitcoind_zmq_events.go +++ b/chain/bitcoind_zmq_events.go @@ -504,16 +504,9 @@ func (b *bitcoindZMQEvents) mempoolPoller() { now := time.Now() // After each ticker interval, we poll the mempool to - // check for transactions we haven't seen yet. - txs, err := b.mempool.client.GetRawMempool() - if err != nil { - log.Errorf("Unable to retrieve mempool txs: "+ - "%v", err) - continue - } - - // Update our local mempool with the new mempool. - b.mempool.UpdateMempoolTxes(txs) + // check for transactions we haven't seen yet and + // update our local mempool with the new mempool. + b.mempool.UpdateMempoolTxes() log.Tracef("Reconciled mempool spends in %v", time.Since(now)) diff --git a/chain/mempool.go b/chain/mempool.go index d6684f9f65..1f91489680 100644 --- a/chain/mempool.go +++ b/chain/mempool.go @@ -376,7 +376,13 @@ func (m *mempool) LoadMempool() error { // UpdateMempoolTxes takes a slice of transactions from the current mempool and // use it to update its internal mempool. It returns a slice of transactions // that's new to its internal mempool. -func (m *mempool) UpdateMempoolTxes(txids []*chainhash.Hash) []*wire.MsgTx { +func (m *mempool) UpdateMempoolTxes() []*wire.MsgTx { + txids, err := m.client.GetRawMempool() + if err != nil { + log.Errorf("Unable to get raw mempool txs: %v", err) + return nil + } + // txesToNotify is a list of txes to be notified to the client. var notixyMx sync.Mutex txesToNotify := make([]*wire.MsgTx, 0, len(txids)) diff --git a/chain/mempool_test.go b/chain/mempool_test.go index a07f47bf4a..65276cc364 100644 --- a/chain/mempool_test.go +++ b/chain/mempool_test.go @@ -443,11 +443,12 @@ func TestUpdateMempoolTxes(t *testing.T) { mempool1 := []*chainhash.Hash{&tx1Hash, &tx2Hash} // Mock the client to return the txes. + mockRPC.On("GetRawMempool").Return(mempool1) mockRPC.On("GetRawTransaction", &tx1Hash).Return(btcTx1, nil).Once() mockRPC.On("GetRawTransaction", &tx2Hash).Return(btctx2, nil).Once() // Update our mempool using the above mempool state. - newTxes := m.UpdateMempoolTxes(mempool1) + newTxes := m.UpdateMempoolTxes() // We expect two transactions. require.Len(newTxes, 2) @@ -480,11 +481,12 @@ func TestUpdateMempoolTxes(t *testing.T) { mempool2 := []*chainhash.Hash{&tx1Hash, &tx3Hash, &tx4Hash} // Mock the client to return the txes. + mockRPC.On("GetRawMempool").Return(mempool2) mockRPC.On("GetRawTransaction", &tx3Hash).Return(btctx3, nil).Once() mockRPC.On("GetRawTransaction", &tx4Hash).Return(btctx4, nil).Once() // Update our mempool using the above mempool state. - newTxes = m.UpdateMempoolTxes(mempool2) + newTxes = m.UpdateMempoolTxes() // We expect two transactions. require.Len(newTxes, 2) @@ -544,13 +546,14 @@ func TestUpdateMempoolTxesOnShutdown(t *testing.T) { mempool := []*chainhash.Hash{&tx1Hash} // Mock the client to return the txes. + mockRPC.On("GetRawMempool").Return(mempool) mockRPC.On("GetRawTransaction", &tx1Hash).Return(btcTx1, nil) // Shutdown the mempool before updating the txes. m.Shutdown() // Update our mempool using the above mempool state. - newTxes := m.UpdateMempoolTxes(mempool) + newTxes := m.UpdateMempoolTxes() // We expect two transactions. require.Empty(newTxes) From 9ef4483dc91f093d5c5670c7dea7e4a81f20645a Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Wed, 20 Sep 2023 22:35:43 +0800 Subject: [PATCH 3/9] chain: use batch client for mempool poller This commit replaces the normal client with a batch client created from `rpcclient.NewBatch`. All the `getrawtransaction` requests are now batched with a default size of 10,000, and the batch will wait for 1 second before attempting the next one. This change is made so less pressure is made on bitcoind as when the mempool is full, there will be loads of `getrawtransaction` calls made, resulting in a slow response for other RPC calls such as `getblockchaininfo`, causing issues in other systems. --- chain/bitcoind_conn.go | 7 +- chain/bitcoind_events.go | 10 +- chain/bitcoind_rpc_events.go | 6 +- chain/bitcoind_zmq_events.go | 6 +- chain/interface.go | 36 ++++- chain/mempool.go | 248 ++++++++++++++++++++++++----------- chain/mempool_test.go | 15 ++- chain/mocks_test.go | 37 +++++- 8 files changed, 257 insertions(+), 108 deletions(-) diff --git a/chain/bitcoind_conn.go b/chain/bitcoind_conn.go index 47f9a566f7..a59c335726 100644 --- a/chain/bitcoind_conn.go +++ b/chain/bitcoind_conn.go @@ -135,6 +135,11 @@ func NewBitcoindConn(cfg *BitcoindConfig) (*BitcoindConn, error) { return nil, err } + batchClient, err := rpcclient.NewBatch(clientCfg) + if err != nil { + return nil, err + } + // Verify that the node is running on the expected network. net, err := getCurrentNet(client) if err != nil { @@ -182,7 +187,7 @@ func NewBitcoindConn(cfg *BitcoindConfig) (*BitcoindConn, error) { quit: make(chan struct{}), } - bc.events, err = NewBitcoindEventSubscriber(cfg, client) + bc.events, err = NewBitcoindEventSubscriber(cfg, client, batchClient) if err != nil { return nil, err } diff --git a/chain/bitcoind_events.go b/chain/bitcoind_events.go index 74d19e307d..dcce473cb2 100644 --- a/chain/bitcoind_events.go +++ b/chain/bitcoind_events.go @@ -32,12 +32,12 @@ type BitcoindEvents interface { } // Ensure rpcclient.Client implements the rpcClient interface at compile time. -var _ rpcClient = (*rpcclient.Client)(nil) +var _ batchClient = (*rpcclient.Client)(nil) // NewBitcoindEventSubscriber initialises a new BitcoinEvents object impl // depending on the config passed. -func NewBitcoindEventSubscriber(cfg *BitcoindConfig, - client *rpcclient.Client) (BitcoindEvents, error) { +func NewBitcoindEventSubscriber(cfg *BitcoindConfig, client *rpcclient.Client, + bClient batchClient) (BitcoindEvents, error) { if cfg.PollingConfig != nil && cfg.ZMQConfig != nil { return nil, fmt.Errorf("either PollingConfig or ZMQConfig " + @@ -52,7 +52,7 @@ func NewBitcoindEventSubscriber(cfg *BitcoindConfig, } pollingEvents := newBitcoindRPCPollingEvents( - cfg.PollingConfig, client, + cfg.PollingConfig, client, bClient, ) return pollingEvents, nil @@ -71,7 +71,7 @@ func NewBitcoindEventSubscriber(cfg *BitcoindConfig, return nil, err } - return newBitcoindZMQEvents(cfg.ZMQConfig, client, hasRPC) + return newBitcoindZMQEvents(cfg.ZMQConfig, client, bClient, hasRPC) } // hasSpendingPrevoutRPC returns whether or not the bitcoind has the newer diff --git a/chain/bitcoind_rpc_events.go b/chain/bitcoind_rpc_events.go index a7610758f8..000b78b486 100644 --- a/chain/bitcoind_rpc_events.go +++ b/chain/bitcoind_rpc_events.go @@ -68,8 +68,8 @@ var _ BitcoindEvents = (*bitcoindRPCPollingEvents)(nil) // newBitcoindRPCPollingEvents instantiates a new bitcoindRPCPollingEvents // object. -func newBitcoindRPCPollingEvents(cfg *PollingConfig, - client *rpcclient.Client) *bitcoindRPCPollingEvents { +func newBitcoindRPCPollingEvents(cfg *PollingConfig, client *rpcclient.Client, + bClient batchClient) *bitcoindRPCPollingEvents { if cfg.BlockPollingInterval == 0 { cfg.BlockPollingInterval = defaultBlockPollInterval @@ -91,7 +91,7 @@ func newBitcoindRPCPollingEvents(cfg *PollingConfig, client: client, txNtfns: make(chan *wire.MsgTx), blockNtfns: make(chan *wire.MsgBlock), - mempool: newMempool(client), + mempool: newMempool(bClient), quit: make(chan struct{}), } } diff --git a/chain/bitcoind_zmq_events.go b/chain/bitcoind_zmq_events.go index 5431c9b1b7..5f9347d501 100644 --- a/chain/bitcoind_zmq_events.go +++ b/chain/bitcoind_zmq_events.go @@ -91,8 +91,8 @@ var _ BitcoindEvents = (*bitcoindZMQEvents)(nil) // newBitcoindZMQEvents initialises the necessary zmq connections to bitcoind. // If bitcoind is on a version with the gettxspendingprevout RPC, we can omit // the mempool. -func newBitcoindZMQEvents(cfg *ZMQConfig, - client *rpcclient.Client, hasRPC bool) (*bitcoindZMQEvents, error) { +func newBitcoindZMQEvents(cfg *ZMQConfig, client *rpcclient.Client, + bClient batchClient, hasRPC bool) (*bitcoindZMQEvents, error) { // Check polling config. if cfg.MempoolPollingInterval == 0 { @@ -141,7 +141,7 @@ func newBitcoindZMQEvents(cfg *ZMQConfig, hasPrevoutRPC: hasRPC, blockNtfns: make(chan *wire.MsgBlock), txNtfns: make(chan *wire.MsgTx), - mempool: newMempool(client), + mempool: newMempool(bClient), quit: make(chan struct{}), } diff --git a/chain/interface.go b/chain/interface.go index bbda7dd7f7..213aac3270 100644 --- a/chain/interface.go +++ b/chain/interface.go @@ -5,6 +5,7 @@ import ( "github.com/btcsuite/btcd/btcutil" "github.com/btcsuite/btcd/chaincfg/chainhash" + "github.com/btcsuite/btcd/rpcclient" "github.com/btcsuite/btcd/wire" "github.com/btcsuite/btcwallet/waddrmgr" "github.com/btcsuite/btcwallet/wtxmgr" @@ -124,8 +125,35 @@ type ( } ) -// rpcClient defines an interface that is used to interact with the RPC client. -type rpcClient interface { - GetRawMempool() ([]*chainhash.Hash, error) - GetRawTransaction(txHash *chainhash.Hash) (*btcutil.Tx, error) +// batchClient defines an interface that is used to interact with the RPC +// client. +// +// NOTE: the client returned from `rpcclient.NewBatch` will implement this +// interface. Unlike the client from `rpcclient.New`, calling `GetRawMempool` +// on this client will block and won't return. +// +// TODO(yy): create a new type BatchClient in `rpcclient`. +type batchClient interface { + // GetRawMempoolAsync returns an instance of a type that can be used to + // get the result of the RPC at some future time by invoking the + // Receive function on the returned instance. + GetRawMempoolAsync() rpcclient.FutureGetRawMempoolResult + + // GetRawTransactionAsync returns an instance of a type that can be + // used to get the result of the RPC at some future time by invoking + // the Receive function on the returned instance. + GetRawTransactionAsync( + txHash *chainhash.Hash) rpcclient.FutureGetRawTransactionResult + + // Send marshalls bulk requests and sends to the server creates a + // response channel to receive the response + Send() error +} + +// getRawTxReceiver defines an interface that's used to receive response from +// `GetRawTransactionAsync`. +type getRawTxReceiver interface { + // Receive waits for the Response promised by the future and returns a + // transaction given its hash. + Receive() (*btcutil.Tx, error) } diff --git a/chain/mempool.go b/chain/mempool.go index 1f91489680..84ddfccfe3 100644 --- a/chain/mempool.go +++ b/chain/mempool.go @@ -1,7 +1,7 @@ package chain import ( - "runtime" + "fmt" "strings" "sync" "time" @@ -10,12 +10,21 @@ import ( "github.com/btcsuite/btcd/btcutil" "github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/btcsuite/btcd/wire" - "golang.org/x/sync/errgroup" ) -// txNotFoundErr is an error returned from bitcoind's `getrawtransaction` RPC -// when the requested txid cannot be found. -const txNotFoundErr = "-5: No such mempool or blockchain transaction" +const ( + // txNotFoundErr is an error returned from bitcoind's + // `getrawtransaction` RPC when the requested txid cannot be found. + txNotFoundErr = "-5: No such mempool or blockchain transaction" + + // getRawTxBatchSize specifies the number of requests to be batched + // before sending them to the bitcoind client. + getRawTxBatchSize = 1000 + + // batchWaitInterval defines the time to sleep between each batched + // calls. + batchWaitInterval = 1 * time.Second +) // cachedInputs caches the inputs of the transactions in the mempool. This is // used to provide fast lookup between txids and inputs. @@ -109,7 +118,7 @@ type mempool struct { inputs *cachedInputs // client is the rpc client that we'll use to query for the mempool. - client rpcClient + client batchClient // initFin is a channel that will be closed once the mempool has been // initialized. @@ -120,7 +129,7 @@ type mempool struct { } // newMempool creates a new mempool object. -func newMempool(client rpcClient) *mempool { +func newMempool(client batchClient) *mempool { return &mempool{ txs: make(map[chainhash.Hash]bool), inputs: newCachedInputs(), @@ -327,46 +336,23 @@ func (m *mempool) isShuttingDown() bool { // LoadMempool loads all the raw transactions found in mempool. func (m *mempool) LoadMempool() error { log.Debugf("Loading mempool spends...") - now := time.Now() - txs, err := m.client.GetRawMempool() + // Fetch the latest mempool. + txids, err := m.getRawMempool() if err != nil { log.Errorf("Unable to get raw mempool txs: %v", err) return err } + // Load the mempool in a goroutine and signal it when done. go func() { - var eg errgroup.Group - eg.SetLimit(runtime.NumCPU()) - - for _, txHash := range txs { - // Before we load the tx, we'll check if we're shutting - // down. If so, we'll exit early. - if m.isShuttingDown() { - log.Info("LoadMempool exited due to shutdown") - return - } - - txHash := txHash - - eg.Go(func() error { - // Grab full mempool transaction from hash. - tx := m.getRawTxIgnoreErr(txHash) - if tx == nil { - return nil - } - - // Add the transaction to our local mempool. - m.Add(tx.MsgTx()) - return nil - }) + _, err := m.batchGetRawTxes(txids, false) + if err != nil { + log.Errorf("LoadMempool got error: %v", err) } - _ = eg.Wait() - log.Debugf("Loaded mempool spends in %v", time.Since(now)) - close(m.initFin) }() @@ -377,36 +363,32 @@ func (m *mempool) LoadMempool() error { // use it to update its internal mempool. It returns a slice of transactions // that's new to its internal mempool. func (m *mempool) UpdateMempoolTxes() []*wire.MsgTx { - txids, err := m.client.GetRawMempool() + // Fetch the latest mempool. + txids, err := m.getRawMempool() if err != nil { log.Errorf("Unable to get raw mempool txs: %v", err) return nil } - // txesToNotify is a list of txes to be notified to the client. - var notixyMx sync.Mutex - txesToNotify := make([]*wire.MsgTx, 0, len(txids)) - // Set all mempool txs to false. m.UnmarkAll() - // TODO(yy): let the OS manage the number of goroutines? - var eg errgroup.Group - eg.SetLimit(runtime.NumCPU()) + // newTxids stores a list of unseen txids found in the mempool. + newTxids := make([]*chainhash.Hash, 0) // We'll scan through the most recent txs in the mempool to see whether // there are new txs that we need to send to the client. for _, txHash := range txids { + txHash := txHash + // Before we load the tx, we'll check if we're shutting down. // If so, we'll exit early. if m.isShuttingDown() { log.Info("UpdateMempoolTxes exited due to shutdown") - return txesToNotify + return nil } - txHash := txHash - // If the transaction is already in our local mempool, then we // have already sent it to the client. if m.ContainsTx(*txHash) { @@ -416,48 +398,156 @@ func (m *mempool) UpdateMempoolTxes() []*wire.MsgTx { continue } - eg.Go(func() error { - // Grab full mempool transaction from hash. - tx := m.getRawTxIgnoreErr(txHash) + newTxids = append(newTxids, txHash) + } + + // Now, we clear our internal mempool of any unmarked transactions. + // These are all the transactions that we still have in the mempool but + // that were not returned in the latest GetRawMempool query. + m.DeleteUnmarked() + + // Fetch the raw transactions in batch. + txesToNotify, err := m.batchGetRawTxes(newTxids, true) + if err != nil { + log.Error("Batch getrawtransaction got %v", err) + } + + return txesToNotify +} + +// getRawMempool returns all the raw transactions found in mempool. +func (m *mempool) getRawMempool() ([]*chainhash.Hash, error) { + // Create an async request and send it immediately. + result := m.client.GetRawMempoolAsync() + + err := m.client.Send() + if err != nil { + log.Errorf("Unable to send GetRawMempool: %v", err) + return nil, err + } + + // Receive the response. + txids, err := result.Receive() + if err != nil { + log.Errorf("Unable to get raw mempool txs: %v", err) + return nil, err + } + + return txids, nil +} + +// batchGetRawTxes makes async GetRawTransaction requests in batches. Each +// batch has either a default size of 10000, or the value specified in +// getRawTxBatchSize. Once a batch is processed, it will wait for +// batchWaitInterval(1s) before attempting the next batch. +func (m *mempool) batchGetRawTxes(txids []*chainhash.Hash, + returnNew bool) ([]*wire.MsgTx, error) { + + log.Debugf("Batching GetRawTransaction in %v batches...", + len(txids)/getRawTxBatchSize+1) + defer log.Debugf("Finished batch GetRawTransaction") + + // respReceivers stores a list of response receivers returned from + // batch calling `GetRawTransactionAsync`. + respReceivers := make([]getRawTxReceiver, 0, getRawTxBatchSize) + + // Conditionally init a newTxes slice. + var newTxes []*wire.MsgTx + if returnNew { + newTxes = make([]*wire.MsgTx, 0, len(txids)) + } + + // processBatch asks the batch client to send its cached requests to + // bitcoind and waits for all the responses to return. Each time a + // response is received, it will be used to update the local mempool + // state and conditionally saved to a slice that will be returned. + processBatch := func(results []getRawTxReceiver) error { + // Ask the client to send all the batched requests. + err := m.client.Send() + if err != nil { + return fmt.Errorf("Send GetRawTransaction got %v", err) + } + + // Iterate the recievers and fetch the response. + for _, resp := range results { + tx := m.getRawTxIgnoreErr(resp) if tx == nil { - return nil + continue } - // Add the transaction to our local mempool. Note that - // we only do this after fetching the full raw - // transaction from bitcoind. We do this so that if - // that call happens to initially fail, then we will - // retry it on the next interval since it is still not - // in our local mempool. + // Add the transaction to our local mempool. m.Add(tx.MsgTx()) - // Save the tx to the slice. - notixyMx.Lock() - txesToNotify = append(txesToNotify, tx.MsgTx()) - notixyMx.Unlock() + // Add the tx to the slice if specified. + if returnNew { + newTxes = append(newTxes, tx.MsgTx()) + } + } - return nil - }) + return nil + } + + // Iterate all the txids. + for i, txHash := range txids { + // Before we load the tx, we'll check if we're shutting down. + // If so, we'll exit early. + if m.isShuttingDown() { + log.Info("LoadMempool exited due to shutdown") + return nil, nil + } + + // Create the async request and save it to txRespReceivers. + resp := m.client.GetRawTransactionAsync(txHash) + respReceivers = append(respReceivers, resp) + + // When getRawTxBatchSize is reached, we'd ask the batch client + // to send the requests and process the responses. + if len(respReceivers)%getRawTxBatchSize == 0 { + log.Debugf("Processing GetRawTransaction for batch "+ + "%v...", i/getRawTxBatchSize) + + if err := processBatch(respReceivers); err != nil { + return nil, err + } + + // We now pause the duration defined in + // `batchWaitInterval` or exit on quit signal. + select { + case <-time.After(batchWaitInterval): + case <-m.quit: + return nil, nil + } + + // Empty the slice for next batch iteration. + respReceivers = make( + []getRawTxReceiver, 0, getRawTxBatchSize, + ) + } } - _ = eg.Wait() + // Exit early if the receivers are all processed. + if len(respReceivers) == 0 { + return newTxes, nil + } - // Now, we clear our internal mempool of any unmarked transactions. - // These are all the transactions that we still have in the mempool but - // that were not returned in the latest GetRawMempool query. - m.DeleteUnmarked() + // Process the remaining recievers. + if err := processBatch(respReceivers); err != nil { + return nil, err + } - return txesToNotify + return newTxes, nil } -// getRawTxIgnoreErr wraps the GetRawTransaction call to bitcoind, and ignores -// the error returned since we can't do anything about it here in the mempool. +// getRawTxIgnoreErr takes a response receiver returned from +// `GetRawTransactionAsync` and receives the response. It ignores the error +// returned since we can't do anything about it here in the mempool. // -// NOTE: if `txindex` is not enabled, `GetRawTransaction` will only look for -// the txid in bitocind's mempool. If the tx is replaced, confirmed, or not yet -// included in bitcoind's mempool, the error txNotFoundErr will be returned. -func (m *mempool) getRawTxIgnoreErr(txid *chainhash.Hash) *btcutil.Tx { - tx, err := m.client.GetRawTransaction(txid) +// NOTE: if `txindex` is not enabled, `GetRawTransactionAsync` will only look +// for the txid in bitcoind's mempool. If the tx is replaced, confirmed, or not +// yet included in bitcoind's mempool, the error txNotFoundErr will be +// returned. +func (m *mempool) getRawTxIgnoreErr(rawTx getRawTxReceiver) *btcutil.Tx { + tx, err := rawTx.Receive() // Exit early if there's no error. if err == nil { @@ -468,14 +558,12 @@ func (m *mempool) getRawTxIgnoreErr(txid *chainhash.Hash) *btcutil.Tx { errStr := strings.ToLower(err.Error()) errExp := strings.ToLower(txNotFoundErr) if strings.Contains(errStr, errExp) { - log.Debugf("unable to fetch transaction %s from mempool: %v", - txid, err) + log.Debugf("unable to fetch transaction from mempool: %v", err) } else { // Otherwise, unexpected error is found, we'll create an error // log. - log.Errorf("unable to fetch transaction %s from mempool: %v", - txid, err) + log.Errorf("unable to fetch transaction from mempool: %v", err) } return nil diff --git a/chain/mempool_test.go b/chain/mempool_test.go index 65276cc364..f9121c9d45 100644 --- a/chain/mempool_test.go +++ b/chain/mempool_test.go @@ -577,24 +577,25 @@ func TestGetRawTxIgnoreErr(t *testing.T) { LockTime: 1, TxIn: []*wire.TxIn{{PreviousOutPoint: op}}, } - txid := tx.TxHash() btctx := btcutil.NewTx(tx) - // Mock the client to return the tx. - mockRPC.On("GetRawTransaction", &txid).Return(btctx, nil).Once() + // Mock the receiver. + mockReceiver := &mockGetRawTxReceiver{} + mockReceiver.On("Receive").Return(btctx, nil).Once() // Call the method and expect the tx to be returned. - resp := m.getRawTxIgnoreErr(&txid) + resp := m.getRawTxIgnoreErr(mockReceiver) require.Equal(btctx, resp) - // Mock the client to return an error. + // Mock the reciever to return an error. dummyErr := errors.New("dummy error") - mockRPC.On("GetRawTransaction", &txid).Return(nil, dummyErr).Once() + mockReceiver.On("Receive").Return(nil, dummyErr).Once() // Call the method again and expect nil response. - resp = m.getRawTxIgnoreErr(&txid) + resp = m.getRawTxIgnoreErr(mockReceiver) require.Nil(resp) // Assert the mock client was called as expected. mockRPC.AssertExpectations(t) + mockReceiver.AssertExpectations(t) } diff --git a/chain/mocks_test.go b/chain/mocks_test.go index c35470447a..43192e5d0f 100644 --- a/chain/mocks_test.go +++ b/chain/mocks_test.go @@ -8,6 +8,7 @@ import ( "github.com/btcsuite/btcd/btcutil/gcs" "github.com/btcsuite/btcd/chaincfg" "github.com/btcsuite/btcd/chaincfg/chainhash" + "github.com/btcsuite/btcd/rpcclient" "github.com/btcsuite/btcd/wire" "github.com/lightninglabs/neutrino" "github.com/lightninglabs/neutrino/banman" @@ -163,18 +164,41 @@ type mockRPCClient struct { } // Compile time assertion that MockPeer implements lnpeer.Peer. -var _ rpcClient = (*mockRPCClient)(nil) +var _ batchClient = (*mockRPCClient)(nil) + +func (m *mockRPCClient) GetRawMempoolAsync() rpcclient. + FutureGetRawMempoolResult { -func (m *mockRPCClient) GetRawMempool() ([]*chainhash.Hash, error) { args := m.Called() - return args.Get(0).([]*chainhash.Hash), args.Error(1) + return args.Get(0).(rpcclient.FutureGetRawMempoolResult) } -func (m *mockRPCClient) GetRawTransaction( - txHash *chainhash.Hash) (*btcutil.Tx, error) { +func (m *mockRPCClient) GetRawTransactionAsync( + txHash *chainhash.Hash) rpcclient.FutureGetRawTransactionResult { args := m.Called(txHash) + tx := args.Get(0) + if tx == nil { + return nil + } + + return args.Get(0).(rpcclient.FutureGetRawTransactionResult) +} + +func (m *mockRPCClient) Send() error { + args := m.Called() + return args.Error(0) +} + +// mockGetRawTxReceiver mocks the getRawTxReceiver interface. +type mockGetRawTxReceiver struct { + mock.Mock +} + +func (m *mockGetRawTxReceiver) Receive() (*btcutil.Tx, error) { + args := m.Called() + tx := args.Get(0) if tx == nil { return nil, args.Error(1) @@ -182,3 +206,6 @@ func (m *mockRPCClient) GetRawTransaction( return args.Get(0).(*btcutil.Tx), args.Error(1) } + +// Compile time assertion that MockPeer implements lnpeer.Peer. +var _ getRawTxReceiver = (*mockGetRawTxReceiver)(nil) From a82ce7c471f4bd92fdaca8cc07e88f04d52bf26a Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Wed, 20 Sep 2023 22:56:24 +0800 Subject: [PATCH 4/9] chain: make `getRawTxBatchSize` and `batchWaitInterval` configurable --- chain/bitcoind_rpc_events.go | 26 ++++++++++++++++- chain/bitcoind_zmq_events.go | 27 ++++++++++++++++- chain/mempool.go | 56 ++++++++++++++++++++++-------------- chain/mempool_test.go | 28 ++++++++++++++---- 4 files changed, 109 insertions(+), 28 deletions(-) diff --git a/chain/bitcoind_rpc_events.go b/chain/bitcoind_rpc_events.go index 000b78b486..3f9804f5ee 100644 --- a/chain/bitcoind_rpc_events.go +++ b/chain/bitcoind_rpc_events.go @@ -38,6 +38,14 @@ type PollingConfig struct { // jitter by scaling TxPollingInterval with it. This value must be no // less than 0. Default to 0, meaning no jitter will be applied. TxPollingIntervalJitter float64 + + // RPCBatchSize defines the number of RPC requests to be batches before + // sending them to the bitcoind node. + RPCBatchSize uint32 + + // RPCBatchInterval defines the time to wait before attempting the next + // batch when the current one finishes. + RPCBatchInterval time.Duration } // bitcoindRPCPollingEvents delivers block and transaction notifications that @@ -86,12 +94,28 @@ func newBitcoindRPCPollingEvents(cfg *PollingConfig, client *rpcclient.Client, cfg.TxPollingIntervalJitter = 0 } + // Create the config for mempool and attach default values if not + // configed. + mCfg := &mempoolConfig{ + client: bClient, + getRawTxBatchSize: cfg.RPCBatchSize, + batchWaitInterval: cfg.RPCBatchInterval, + } + + if cfg.RPCBatchSize == 0 { + mCfg.getRawTxBatchSize = DefaultGetRawTxBatchSize + } + + if cfg.RPCBatchInterval == 0 { + mCfg.batchWaitInterval = DefaultBatchWaitInterval + } + return &bitcoindRPCPollingEvents{ cfg: cfg, client: client, txNtfns: make(chan *wire.MsgTx), blockNtfns: make(chan *wire.MsgBlock), - mempool: newMempool(bClient), + mempool: newMempool(mCfg), quit: make(chan struct{}), } } diff --git a/chain/bitcoind_zmq_events.go b/chain/bitcoind_zmq_events.go index 5f9347d501..f7b31ff82c 100644 --- a/chain/bitcoind_zmq_events.go +++ b/chain/bitcoind_zmq_events.go @@ -47,6 +47,14 @@ type ZMQConfig struct { // // TODO(yy): replace this temp config with SEQUENCE check. PollingIntervalJitter float64 + + // RPCBatchSize defines the number of RPC requests to be batches before + // sending them to the bitcoind node. + RPCBatchSize uint32 + + // RPCBatchInterval defines the time to wait before attempting the next + // batch when the current one finishes. + RPCBatchInterval time.Duration } // bitcoindZMQEvents delivers block and transaction notifications that it gets @@ -133,6 +141,22 @@ func newBitcoindZMQEvents(cfg *ZMQConfig, client *rpcclient.Client, "events: %v", err) } + // Create the config for mempool and attach default values if not + // configed. + mCfg := &mempoolConfig{ + client: bClient, + getRawTxBatchSize: cfg.RPCBatchSize, + batchWaitInterval: cfg.RPCBatchInterval, + } + + if cfg.RPCBatchSize == 0 { + mCfg.getRawTxBatchSize = DefaultGetRawTxBatchSize + } + + if cfg.RPCBatchInterval == 0 { + mCfg.batchWaitInterval = DefaultBatchWaitInterval + } + zmqEvents := &bitcoindZMQEvents{ cfg: cfg, client: client, @@ -141,11 +165,12 @@ func newBitcoindZMQEvents(cfg *ZMQConfig, client *rpcclient.Client, hasPrevoutRPC: hasRPC, blockNtfns: make(chan *wire.MsgBlock), txNtfns: make(chan *wire.MsgTx), - mempool: newMempool(bClient), + mempool: newMempool(mCfg), quit: make(chan struct{}), } return zmqEvents, nil + } // Start spins off the bitcoindZMQEvent goroutines. diff --git a/chain/mempool.go b/chain/mempool.go index 84ddfccfe3..09ac64656c 100644 --- a/chain/mempool.go +++ b/chain/mempool.go @@ -17,13 +17,13 @@ const ( // `getrawtransaction` RPC when the requested txid cannot be found. txNotFoundErr = "-5: No such mempool or blockchain transaction" - // getRawTxBatchSize specifies the number of requests to be batched - // before sending them to the bitcoind client. - getRawTxBatchSize = 1000 + // DefaultGetRawTxBatchSize specifies the default number of requests to + // be batched before sending them to the bitcoind client. + DefaultGetRawTxBatchSize = 1000 - // batchWaitInterval defines the time to sleep between each batched - // calls. - batchWaitInterval = 1 * time.Second + // DefaultBatchWaitInterval defines the default time to sleep between + // each batched calls. + DefaultBatchWaitInterval = 1 * time.Second ) // cachedInputs caches the inputs of the transactions in the mempool. This is @@ -107,6 +107,9 @@ type mempool struct { // stopped is used to make sure we only stop mempool once. stopped sync.Once + // cfg specifies the config for the mempool. + cfg *mempoolConfig + // txs stores the txids in the mempool. txs map[chainhash.Hash]bool @@ -117,9 +120,6 @@ type mempool struct { // scripts. inputs *cachedInputs - // client is the rpc client that we'll use to query for the mempool. - client batchClient - // initFin is a channel that will be closed once the mempool has been // initialized. initFin chan struct{} @@ -128,14 +128,28 @@ type mempool struct { quit chan struct{} } +// mempoolConfig holds a list of config values specified by the callers. +type mempoolConfig struct { + // client is the rpc client that we'll use to query for the mempool. + client batchClient + + // getRawTxBatchSize specifies the number of getrawtransaction requests + // to be batched before sending them to the bitcoind client. + getRawTxBatchSize uint32 + + // batchWaitInterval defines the default time to sleep between each + // batched calls. + batchWaitInterval time.Duration +} + // newMempool creates a new mempool object. -func newMempool(client batchClient) *mempool { +func newMempool(cfg *mempoolConfig) *mempool { return &mempool{ + cfg: cfg, txs: make(map[chainhash.Hash]bool), inputs: newCachedInputs(), initFin: make(chan struct{}), quit: make(chan struct{}), - client: client, } } @@ -418,9 +432,9 @@ func (m *mempool) UpdateMempoolTxes() []*wire.MsgTx { // getRawMempool returns all the raw transactions found in mempool. func (m *mempool) getRawMempool() ([]*chainhash.Hash, error) { // Create an async request and send it immediately. - result := m.client.GetRawMempoolAsync() + result := m.cfg.client.GetRawMempoolAsync() - err := m.client.Send() + err := m.cfg.client.Send() if err != nil { log.Errorf("Unable to send GetRawMempool: %v", err) return nil, err @@ -444,12 +458,12 @@ func (m *mempool) batchGetRawTxes(txids []*chainhash.Hash, returnNew bool) ([]*wire.MsgTx, error) { log.Debugf("Batching GetRawTransaction in %v batches...", - len(txids)/getRawTxBatchSize+1) + uint32(len(txids))/m.cfg.getRawTxBatchSize+1) defer log.Debugf("Finished batch GetRawTransaction") // respReceivers stores a list of response receivers returned from // batch calling `GetRawTransactionAsync`. - respReceivers := make([]getRawTxReceiver, 0, getRawTxBatchSize) + respReceivers := make([]getRawTxReceiver, 0, m.cfg.getRawTxBatchSize) // Conditionally init a newTxes slice. var newTxes []*wire.MsgTx @@ -463,7 +477,7 @@ func (m *mempool) batchGetRawTxes(txids []*chainhash.Hash, // state and conditionally saved to a slice that will be returned. processBatch := func(results []getRawTxReceiver) error { // Ask the client to send all the batched requests. - err := m.client.Send() + err := m.cfg.client.Send() if err != nil { return fmt.Errorf("Send GetRawTransaction got %v", err) } @@ -497,14 +511,14 @@ func (m *mempool) batchGetRawTxes(txids []*chainhash.Hash, } // Create the async request and save it to txRespReceivers. - resp := m.client.GetRawTransactionAsync(txHash) + resp := m.cfg.client.GetRawTransactionAsync(txHash) respReceivers = append(respReceivers, resp) // When getRawTxBatchSize is reached, we'd ask the batch client // to send the requests and process the responses. - if len(respReceivers)%getRawTxBatchSize == 0 { + if uint32(len(respReceivers))%m.cfg.getRawTxBatchSize == 0 { log.Debugf("Processing GetRawTransaction for batch "+ - "%v...", i/getRawTxBatchSize) + "%v...", uint32(i)/m.cfg.getRawTxBatchSize) if err := processBatch(respReceivers); err != nil { return nil, err @@ -513,14 +527,14 @@ func (m *mempool) batchGetRawTxes(txids []*chainhash.Hash, // We now pause the duration defined in // `batchWaitInterval` or exit on quit signal. select { - case <-time.After(batchWaitInterval): + case <-time.After(m.cfg.batchWaitInterval): case <-m.quit: return nil, nil } // Empty the slice for next batch iteration. respReceivers = make( - []getRawTxReceiver, 0, getRawTxBatchSize, + []getRawTxReceiver, 0, m.cfg.getRawTxBatchSize, ) } } diff --git a/chain/mempool_test.go b/chain/mempool_test.go index f9121c9d45..e1d2d18a8f 100644 --- a/chain/mempool_test.go +++ b/chain/mempool_test.go @@ -207,7 +207,10 @@ func TestCachedInputsAddInputTwice(t *testing.T) { func TestMempool(t *testing.T) { require := require.New(t) - m := newMempool(nil) + m := newMempool(&mempoolConfig{ + batchWaitInterval: 0, + getRawTxBatchSize: 1, + }) // Create a transaction. op1 := wire.OutPoint{Hash: chainhash.Hash{1}} @@ -321,7 +324,10 @@ func TestMempool(t *testing.T) { func TestMempoolAdd(t *testing.T) { require := require.New(t) - m := newMempool(nil) + m := newMempool(&mempoolConfig{ + batchWaitInterval: 0, + getRawTxBatchSize: 1, + }) // Create a coinbase transaction. tx0 := &wire.MsgTx{ @@ -413,7 +419,11 @@ func TestUpdateMempoolTxes(t *testing.T) { // Create a mock client and init our mempool. mockRPC := &mockRPCClient{} - m := newMempool(mockRPC) + m := newMempool(&mempoolConfig{ + client: mockRPC, + batchWaitInterval: 0, + getRawTxBatchSize: 1, + }) // Create a normal transaction that has two inputs. op1 := wire.OutPoint{Hash: chainhash.Hash{1}} @@ -529,7 +539,11 @@ func TestUpdateMempoolTxesOnShutdown(t *testing.T) { // Create a mock client and init our mempool. mockRPC := &mockRPCClient{} - m := newMempool(mockRPC) + m := newMempool(&mempoolConfig{ + client: mockRPC, + batchWaitInterval: 0, + getRawTxBatchSize: 1, + }) // Create a normal transaction. op1 := wire.OutPoint{Hash: chainhash.Hash{1}} @@ -569,7 +583,11 @@ func TestGetRawTxIgnoreErr(t *testing.T) { // Create a mock client and init our mempool. mockRPC := &mockRPCClient{} - m := newMempool(mockRPC) + m := newMempool(&mempoolConfig{ + client: mockRPC, + batchWaitInterval: 0, + getRawTxBatchSize: 1, + }) // Create a normal transaction that has two inputs. op := wire.OutPoint{Hash: chainhash.Hash{1}} From 7f81f41b83a08dfe63f8ec0250ce25f852763a1d Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Thu, 21 Sep 2023 01:49:11 +0800 Subject: [PATCH 5/9] chain: modify mempool config to fix unit tests --- chain/mempool.go | 29 ++++++++++++++++--- chain/mempool_test.go | 67 +++++++++++++++++++++++++++++++++++-------- chain/mocks_test.go | 5 ++-- 3 files changed, 83 insertions(+), 18 deletions(-) diff --git a/chain/mempool.go b/chain/mempool.go index 09ac64656c..0909f15512 100644 --- a/chain/mempool.go +++ b/chain/mempool.go @@ -140,17 +140,37 @@ type mempoolConfig struct { // batchWaitInterval defines the default time to sleep between each // batched calls. batchWaitInterval time.Duration + + // rawMempoolGetter mounts to `m.getRawMempool` and is only changed in + // unit tests. + // + // TODO(yy): interface rpcclient.FutureGetRawMempoolResult so we can + // remove this hack. + rawMempoolGetter func() ([]*chainhash.Hash, error) + + // rawTxReceiver mounts to `m.getRawTxIgnoreErr` and is only changed in + // unit tests. + // + // TODO(yy): interface rpcclient.FutureGetRawTransactionResult so we + // can remove this hack. + rawTxReceiver func(getRawTxReceiver) *btcutil.Tx } // newMempool creates a new mempool object. func newMempool(cfg *mempoolConfig) *mempool { - return &mempool{ + m := &mempool{ cfg: cfg, txs: make(map[chainhash.Hash]bool), inputs: newCachedInputs(), initFin: make(chan struct{}), quit: make(chan struct{}), } + + // Mount the default methods. + m.cfg.rawMempoolGetter = m.getRawMempool + m.cfg.rawTxReceiver = m.getRawTxIgnoreErr + + return m } // Shutdown signals the mempool to exit. @@ -353,7 +373,7 @@ func (m *mempool) LoadMempool() error { now := time.Now() // Fetch the latest mempool. - txids, err := m.getRawMempool() + txids, err := m.cfg.rawMempoolGetter() if err != nil { log.Errorf("Unable to get raw mempool txs: %v", err) return err @@ -378,7 +398,7 @@ func (m *mempool) LoadMempool() error { // that's new to its internal mempool. func (m *mempool) UpdateMempoolTxes() []*wire.MsgTx { // Fetch the latest mempool. - txids, err := m.getRawMempool() + txids, err := m.cfg.rawMempoolGetter() if err != nil { log.Errorf("Unable to get raw mempool txs: %v", err) return nil @@ -424,6 +444,7 @@ func (m *mempool) UpdateMempoolTxes() []*wire.MsgTx { txesToNotify, err := m.batchGetRawTxes(newTxids, true) if err != nil { log.Error("Batch getrawtransaction got %v", err) + } return txesToNotify @@ -484,7 +505,7 @@ func (m *mempool) batchGetRawTxes(txids []*chainhash.Hash, // Iterate the recievers and fetch the response. for _, resp := range results { - tx := m.getRawTxIgnoreErr(resp) + tx := m.cfg.rawTxReceiver(resp) if tx == nil { continue } diff --git a/chain/mempool_test.go b/chain/mempool_test.go index e1d2d18a8f..b88e9bdfa1 100644 --- a/chain/mempool_test.go +++ b/chain/mempool_test.go @@ -7,6 +7,7 @@ import ( "github.com/btcsuite/btcd/btcutil" "github.com/btcsuite/btcd/chaincfg/chainhash" + "github.com/btcsuite/btcd/rpcclient" "github.com/btcsuite/btcd/wire" "github.com/stretchr/testify/require" ) @@ -436,7 +437,7 @@ func TestUpdateMempoolTxes(t *testing.T) { }, } tx1Hash := tx1.TxHash() - btcTx1 := btcutil.NewTx(tx1) + btctx1 := btcutil.NewTx(tx1) // Create another transaction. op3 := wire.OutPoint{Hash: chainhash.Hash{3}} @@ -452,10 +453,34 @@ func TestUpdateMempoolTxes(t *testing.T) { // Create the current mempool state. mempool1 := []*chainhash.Hash{&tx1Hash, &tx2Hash} + // Create mock receivers. + mockTx1Receiver := make(rpcclient.FutureGetRawTransactionResult) + mockTx2Receiver := make(rpcclient.FutureGetRawTransactionResult) + mockTx3Receiver := make(rpcclient.FutureGetRawTransactionResult) + mockTx4Receiver := make(rpcclient.FutureGetRawTransactionResult) + // Mock the client to return the txes. - mockRPC.On("GetRawMempool").Return(mempool1) - mockRPC.On("GetRawTransaction", &tx1Hash).Return(btcTx1, nil).Once() - mockRPC.On("GetRawTransaction", &tx2Hash).Return(btctx2, nil).Once() + mockRPC.On("GetRawTransactionAsync", &tx1Hash).Return( + mockTx1Receiver).Once() + mockRPC.On("GetRawTransactionAsync", &tx2Hash).Return( + mockTx2Receiver).Once() + mockRPC.On("Send").Return(nil).Twice() + + // Mock our rawMempoolGetter and rawTxReceiver. + m.cfg.rawMempoolGetter = func() ([]*chainhash.Hash, error) { + return mempool1, nil + } + m.cfg.rawTxReceiver = func(reciever getRawTxReceiver) *btcutil.Tx { + switch reciever { + case mockTx1Receiver: + return btctx1 + case mockTx2Receiver: + return btctx2 + } + + require.Fail("unexpected receiver") + return nil + } // Update our mempool using the above mempool state. newTxes := m.UpdateMempoolTxes() @@ -491,9 +516,27 @@ func TestUpdateMempoolTxes(t *testing.T) { mempool2 := []*chainhash.Hash{&tx1Hash, &tx3Hash, &tx4Hash} // Mock the client to return the txes. - mockRPC.On("GetRawMempool").Return(mempool2) - mockRPC.On("GetRawTransaction", &tx3Hash).Return(btctx3, nil).Once() - mockRPC.On("GetRawTransaction", &tx4Hash).Return(btctx4, nil).Once() + mockRPC.On("GetRawTransactionAsync", + &tx3Hash).Return(mockTx3Receiver).Once() + mockRPC.On("GetRawTransactionAsync", + &tx4Hash).Return(mockTx4Receiver).Once() + mockRPC.On("Send").Return(nil).Twice() + + // Mock our rawMempoolGetter and rawTxReceiver. + m.cfg.rawMempoolGetter = func() ([]*chainhash.Hash, error) { + return mempool2, nil + } + m.cfg.rawTxReceiver = func(reciever getRawTxReceiver) *btcutil.Tx { + switch reciever { + case mockTx3Receiver: + return btctx3 + case mockTx4Receiver: + return btctx4 + } + + require.Fail("unexpected receiver") + return nil + } // Update our mempool using the above mempool state. newTxes = m.UpdateMempoolTxes() @@ -554,14 +597,14 @@ func TestUpdateMempoolTxesOnShutdown(t *testing.T) { }, } tx1Hash := tx1.TxHash() - btcTx1 := btcutil.NewTx(tx1) // Create the current mempool state. mempool := []*chainhash.Hash{&tx1Hash} - // Mock the client to return the txes. - mockRPC.On("GetRawMempool").Return(mempool) - mockRPC.On("GetRawTransaction", &tx1Hash).Return(btcTx1, nil) + // Mock our rawMempoolGetter and rawTxReceiver. + m.cfg.rawMempoolGetter = func() ([]*chainhash.Hash, error) { + return mempool, nil + } // Shutdown the mempool before updating the txes. m.Shutdown() @@ -573,7 +616,7 @@ func TestUpdateMempoolTxesOnShutdown(t *testing.T) { require.Empty(newTxes) // Assert GetRawTransaction is not called because mempool is quit. - mockRPC.AssertNotCalled(t, "GetRawTransaction") + mockRPC.AssertNotCalled(t, "GetRawTransactionAsync") } // TestGetRawTxIgnoreErr tests that the mempool's GetRawTxIgnoreErr method diff --git a/chain/mocks_test.go b/chain/mocks_test.go index 43192e5d0f..f19dac72d6 100644 --- a/chain/mocks_test.go +++ b/chain/mocks_test.go @@ -163,7 +163,7 @@ type mockRPCClient struct { mock.Mock } -// Compile time assertion that MockPeer implements lnpeer.Peer. +// Compile time assert the implementation. var _ batchClient = (*mockRPCClient)(nil) func (m *mockRPCClient) GetRawMempoolAsync() rpcclient. @@ -193,6 +193,7 @@ func (m *mockRPCClient) Send() error { // mockGetRawTxReceiver mocks the getRawTxReceiver interface. type mockGetRawTxReceiver struct { + *rpcclient.FutureGetRawTransactionResult mock.Mock } @@ -207,5 +208,5 @@ func (m *mockGetRawTxReceiver) Receive() (*btcutil.Tx, error) { return args.Get(0).(*btcutil.Tx), args.Error(1) } -// Compile time assertion that MockPeer implements lnpeer.Peer. +// Compile time assert the implementation. var _ getRawTxReceiver = (*mockGetRawTxReceiver)(nil) From adadc8613dffd0a55d303f73e33ed6d6a755136c Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Wed, 20 Sep 2023 18:03:57 +0800 Subject: [PATCH 6/9] multi: add command to clean modules --- Makefile | 7 +++++++ scripts/tidy_modules.sh | 17 +++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100755 scripts/tidy_modules.sh diff --git a/Makefile b/Makefile index a76c98fc94..5dcc489309 100644 --- a/Makefile +++ b/Makefile @@ -109,6 +109,13 @@ clean: @$(call print, "Cleaning source.$(NC)") $(RM) coverage.txt +tidy-module: + echo "Running 'go mod tidy' for all modules" + scripts/tidy_modules.sh + +tidy-module-check: tidy-module + if test -n "$$(git status --porcelain)"; then echo "modules not updated, please run `make tidy-module` again!"; git status; exit 1; fi + .PHONY: all \ default \ build \ diff --git a/scripts/tidy_modules.sh b/scripts/tidy_modules.sh new file mode 100755 index 0000000000..3fa5bfb252 --- /dev/null +++ b/scripts/tidy_modules.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +SUBMODULES=$(find . -mindepth 2 -name "go.mod" | cut -d'/' -f2) + + +# Run 'go mod tidy' for root. +go mod tidy + +# Run 'go mod tidy' for each module. +for submodule in $SUBMODULES +do + pushd $submodule + + go mod tidy + + popd +done From d9466fa0aebc067e35b7f96de0e861f438c85490 Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Wed, 20 Sep 2023 17:57:56 +0800 Subject: [PATCH 7/9] gomod: update mod using `go work sync` Running the following commands, ``` go work sync make tidy-module ``` --- go.mod | 32 ++++---- go.sum | 96 +++++++++++------------ wallet/txauthor/go.mod | 9 +++ wallet/txauthor/go.sum | 41 +++++----- wallet/txrules/go.mod | 9 +++ wallet/txrules/go.sum | 37 +++++---- wallet/txsizes/go.mod | 10 ++- wallet/txsizes/go.sum | 37 ++++----- walletdb/go.mod | 4 +- walletdb/go.sum | 26 +++++- wtxmgr/go.mod | 9 +++ wtxmgr/go.sum | 174 +++++++++++++++++++++++++++++++++++++---- 12 files changed, 338 insertions(+), 146 deletions(-) diff --git a/go.mod b/go.mod index f88842945c..99ac697bde 100644 --- a/go.mod +++ b/go.mod @@ -1,7 +1,7 @@ module github.com/btcsuite/btcwallet require ( - github.com/btcsuite/btcd v0.23.4 + github.com/btcsuite/btcd v0.23.5-0.20230711222809-7faa9b266231 github.com/btcsuite/btcd/btcec/v2 v2.2.2 github.com/btcsuite/btcd/btcutil v1.1.3 github.com/btcsuite/btcd/btcutil/psbt v1.1.8 @@ -15,20 +15,19 @@ require ( github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 github.com/davecgh/go-spew v1.1.1 github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 - github.com/golang/protobuf v1.4.2 + github.com/golang/protobuf v1.5.2 github.com/jessevdk/go-flags v1.4.0 github.com/jrick/logrotate v1.0.0 github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf - github.com/lightninglabs/neutrino v0.15.1-0.20230727175126-fc413d722789 - github.com/lightninglabs/neutrino/cache v1.1.0 + github.com/lightninglabs/neutrino v0.16.0 + github.com/lightninglabs/neutrino/cache v1.1.1 github.com/lightningnetwork/lnd/ticker v1.0.0 github.com/lightningnetwork/lnd/tlv v1.0.2 - github.com/stretchr/testify v1.8.1 + github.com/stretchr/testify v1.8.2 golang.org/x/crypto v0.7.0 - golang.org/x/net v0.8.0 - golang.org/x/sync v0.1.0 - golang.org/x/term v0.6.0 - google.golang.org/grpc v1.18.0 + golang.org/x/net v0.10.0 + golang.org/x/term v0.8.0 + google.golang.org/grpc v1.53.0 ) require ( @@ -36,16 +35,19 @@ require ( github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd // indirect github.com/decred/dcrd/crypto/blake256 v1.0.0 // indirect github.com/decred/dcrd/lru v1.0.0 // indirect - github.com/kkdai/bstream v0.0.0-20181106074824-b3251f7901ec // indirect + github.com/kkdai/bstream v1.0.0 // indirect + github.com/kr/pretty v0.3.0 // indirect github.com/lightningnetwork/lnd/clock v1.0.1 // indirect github.com/lightningnetwork/lnd/queue v1.0.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/rogpeppe/go-internal v1.9.0 // indirect github.com/stretchr/objx v0.5.0 // indirect - go.etcd.io/bbolt v1.3.5-0.20200615073812-232d8fc87f50 // indirect - golang.org/x/sys v0.6.0 // indirect - golang.org/x/text v0.8.0 // indirect - google.golang.org/genproto v0.0.0-20190201180003-4b09977fb922 // indirect - google.golang.org/protobuf v1.23.0 // indirect + go.etcd.io/bbolt v1.3.7 // indirect + golang.org/x/sys v0.8.0 // indirect + golang.org/x/text v0.9.0 // indirect + google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect + google.golang.org/protobuf v1.30.0 // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 9a7c5531bb..0eebc143e0 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,3 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/aead/siphash v1.0.1 h1:FwHfE/T45KPKYuuSAKyyvE+oPWcaQ+CUmFW0bPlM+kg= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= @@ -7,8 +6,8 @@ github.com/btcsuite/btcd v0.22.0-beta.0.20220204213055-eaf0459ff879/go.mod h1:os github.com/btcsuite/btcd v0.22.0-beta.0.20220207191057-4dc4ff7963b4/go.mod h1:7alexyj/lHlOtr2PJK7L/+HDJZpcGDn/pAU98r7DY08= github.com/btcsuite/btcd v0.23.0/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY= github.com/btcsuite/btcd v0.23.1/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY= -github.com/btcsuite/btcd v0.23.4 h1:IzV6qqkfwbItOS/sg/aDfPDsjPP8twrCOE2R93hxMlQ= -github.com/btcsuite/btcd v0.23.4/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY= +github.com/btcsuite/btcd v0.23.5-0.20230711222809-7faa9b266231 h1:FZR6mILlSI/GDx8ydNVBZAlXlRXsoRBWX2Un64mpfsI= +github.com/btcsuite/btcd v0.23.5-0.20230711222809-7faa9b266231/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY= github.com/btcsuite/btcd/btcec/v2 v2.1.0/go.mod h1:2VzYrv4Gm4apmbVVsSq5bqf1Ec8v56E48Vt0Y/umPgA= github.com/btcsuite/btcd/btcec/v2 v2.1.1/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= github.com/btcsuite/btcd/btcec/v2 v2.1.3/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= @@ -48,7 +47,7 @@ github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 h1:R8vQdOQdZ9Y3SkEwmHoWBmX1DNXhXZqlTpq6s4tyJGc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -61,45 +60,46 @@ github.com/decred/dcrd/lru v1.0.0 h1:Kbsb1SFDsIlaupWPwsPp+dkxiBY1frcS07PCPgotKz8 github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jrick/logrotate v1.0.0 h1:lQ1bL/n9mBNeIXoTUoYRlK4dHuNJVofX9oWqBtPnSzI= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= -github.com/kkdai/bstream v0.0.0-20181106074824-b3251f7901ec h1:n1NeQ3SgUHyISrjFFoO5dR748Is8dBL9qpaTNfphQrs= -github.com/kkdai/bstream v0.0.0-20181106074824-b3251f7901ec/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kkdai/bstream v1.0.0 h1:Se5gHwgp2VT2uHfDrkbbgbgEvV9cimLELwrPJctSjg8= +github.com/kkdai/bstream v1.0.0/go.mod h1:FDnDOHt5Yx4p3FaHcioFT0QjDOtgUpvjeZqAs+NVZZA= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf h1:HZKvJUHlcXI/f/O0Avg7t8sqkPo78HFzjmeYFl6DPnc= github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf/go.mod h1:vxmQPeIQxPf6Jf9rM8R+B4rKBqLA2AjttNxkFBL2Plk= -github.com/lightninglabs/neutrino v0.15.1-0.20230727175126-fc413d722789 h1:AKeX/5ab9ZLtu5ztI8D+ef+hYpp9YBjr6zmi40UsHf4= -github.com/lightninglabs/neutrino v0.15.1-0.20230727175126-fc413d722789/go.mod h1:pmjwElN/091TErtSE9Vd5W4hpxoG2/+xlb+HoPm9Gug= -github.com/lightninglabs/neutrino/cache v1.1.0 h1:szZIhVabiQIsGzJjhvo76sj05Au+zVotj2M34EquGME= -github.com/lightninglabs/neutrino/cache v1.1.0/go.mod h1:XJNcgdOw1LQnanGjw8Vj44CvguYA25IMKjWFZczwZuo= +github.com/lightninglabs/neutrino v0.16.0 h1:YNTQG32fPR/Zg0vvJVI65OBH8l3U18LSXXtX91hx0q0= +github.com/lightninglabs/neutrino v0.16.0/go.mod h1:x3OmY2wsA18+Kc3TSV2QpSUewOCiscw2mKpXgZv2kZk= +github.com/lightninglabs/neutrino/cache v1.1.1 h1:TllWOSlkABhpgbWJfzsrdUaDH2fBy/54VSIB4vVqV8M= +github.com/lightninglabs/neutrino/cache v1.1.1/go.mod h1:XJNcgdOw1LQnanGjw8Vj44CvguYA25IMKjWFZczwZuo= github.com/lightningnetwork/lnd/clock v1.0.1 h1:QQod8+m3KgqHdvVMV+2DRNNZS1GRFir8mHZYA+Z2hFo= github.com/lightningnetwork/lnd/clock v1.0.1/go.mod h1:KnQudQ6w0IAMZi1SgvecLZQZ43ra2vpDNj7H/aasemg= github.com/lightningnetwork/lnd/queue v1.0.1 h1:jzJKcTy3Nj5lQrooJ3aaw9Lau3I0IwvQR5sqtjdv2R0= @@ -119,6 +119,9 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= @@ -127,34 +130,26 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= -go.etcd.io/bbolt v1.3.5-0.20200615073812-232d8fc87f50 h1:ASw9n1EHMftwnP3Az4XW6e308+gNsrHzmdhd0Olz9Hs= go.etcd.io/bbolt v1.3.5-0.20200615073812-232d8fc87f50/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= +go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ= +go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -165,37 +160,37 @@ golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190201180003-4b09977fb922 h1:mBVYJnbrXLA/ZCBTCe7PtEgAUP+1bg92qTaFoPHdz+8= -google.golang.org/genproto v0.0.0-20190201180003-4b09977fb922/go.mod h1:L3J43x8/uS+qIUoksaLKe6OS3nUKxOKuIFz1sl2/jx4= -google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= -google.golang.org/grpc v1.18.0 h1:IZl7mfBGfbhYx2p2rKRtYgDFw6SBz+kclmxYrCksPPA= -google.golang.org/grpc v1.18.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= +google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f h1:BWUVssLB0HVOSY78gIdvk1dTVYtT1y8SBWtPYuTJ/6w= +google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/grpc v1.53.0 h1:LAv2ds7cmFV/XTS3XG1NneeENYrXGmorPxsBbptIjNc= +google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= +google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -205,4 +200,3 @@ gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/wallet/txauthor/go.mod b/wallet/txauthor/go.mod index 2ec2d59e01..072bffbce5 100644 --- a/wallet/txauthor/go.mod +++ b/wallet/txauthor/go.mod @@ -7,4 +7,13 @@ require ( github.com/btcsuite/btcd/btcutil v1.1.1 github.com/btcsuite/btcwallet/wallet/txrules v1.2.0 github.com/btcsuite/btcwallet/wallet/txsizes v1.2.3 + github.com/fsnotify/fsnotify v1.5.4 // indirect + github.com/kkdai/bstream v1.0.0 // indirect + github.com/kr/pretty v0.3.0 // indirect + github.com/onsi/gomega v1.26.0 // indirect + github.com/rogpeppe/go-internal v1.9.0 // indirect + github.com/stretchr/testify v1.8.2 // indirect + golang.org/x/crypto v0.7.0 // indirect + golang.org/x/net v0.10.0 // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect ) diff --git a/wallet/txauthor/go.sum b/wallet/txauthor/go.sum index ccdd7ffab4..30843868a5 100644 --- a/wallet/txauthor/go.sum +++ b/wallet/txauthor/go.sum @@ -22,8 +22,6 @@ github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufo github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcwallet/wallet/txrules v1.2.0 h1:BtEN5Empw62/RVnZ0VcJaVtVlBijnLlJY+dwjAye2Bg= github.com/btcsuite/btcwallet/wallet/txrules v1.2.0/go.mod h1:AtkqiL7ccKWxuLYtZm8Bu8G6q82w4yIZdgq6riy60z0= -github.com/btcsuite/btcwallet/wallet/txsizes v1.2.2 h1:vtfutRuUoNsdgmKgYShuUgmBawNeC+lWu9jeucWkAII= -github.com/btcsuite/btcwallet/wallet/txsizes v1.2.2/go.mod h1:q08Rms52VyWyXcp5zDc4tdFRKkFgNsMQrv3/LvE1448= github.com/btcsuite/btcwallet/wallet/txsizes v1.2.3 h1:PszOub7iXVYbtGybym5TGCp9Dv1h1iX4rIC3HICZGLg= github.com/btcsuite/btcwallet/wallet/txsizes v1.2.3/go.mod h1:q08Rms52VyWyXcp5zDc4tdFRKkFgNsMQrv3/LvE1448= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= @@ -43,62 +41,65 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1 github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= +github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= -github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23 h1:FOOIBWrEkLgmlgGfMuZT83xIwfPDxEI2OHu6xUmJMFE= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kkdai/bstream v1.0.0 h1:Se5gHwgp2VT2uHfDrkbbgbgEvV9cimLELwrPJctSjg8= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= +github.com/onsi/ginkgo/v2 v2.7.0 h1:/XxtEV3I3Eif/HobnVx9YmJgk8ENdRsuUmM+fLCFNow= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.26.0 h1:03cDLK28U6hWvCAns6NeydX3zIm4SF3ci69ulidS32Q= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc h1:zK/HqS5bZxDptfPJNq8v7vJfXtkU7r9TLIoSr1bXaP4= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -108,32 +109,30 @@ golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed h1:J22ig1FUekjjkmZUM7pTKixYm8DvrYsvrBZdunYeIuQ= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/wallet/txrules/go.mod b/wallet/txrules/go.mod index c88976ce3e..a296853063 100644 --- a/wallet/txrules/go.mod +++ b/wallet/txrules/go.mod @@ -5,4 +5,13 @@ go 1.12 require ( github.com/btcsuite/btcd v0.23.4 github.com/btcsuite/btcd/btcutil v1.1.0 + github.com/fsnotify/fsnotify v1.5.4 // indirect + github.com/kkdai/bstream v1.0.0 // indirect + github.com/kr/pretty v0.3.0 // indirect + github.com/onsi/gomega v1.26.0 // indirect + github.com/rogpeppe/go-internal v1.9.0 // indirect + github.com/stretchr/testify v1.8.2 // indirect + golang.org/x/crypto v0.7.0 // indirect + golang.org/x/net v0.10.0 // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect ) diff --git a/wallet/txrules/go.sum b/wallet/txrules/go.sum index c343fccea0..37da6fd5f7 100644 --- a/wallet/txrules/go.sum +++ b/wallet/txrules/go.sum @@ -33,57 +33,62 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1 github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= +github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= -github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23 h1:FOOIBWrEkLgmlgGfMuZT83xIwfPDxEI2OHu6xUmJMFE= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= -github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= +github.com/kkdai/bstream v1.0.0 h1:Se5gHwgp2VT2uHfDrkbbgbgEvV9cimLELwrPJctSjg8= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= +github.com/onsi/ginkgo/v2 v2.7.0 h1:/XxtEV3I3Eif/HobnVx9YmJgk8ENdRsuUmM+fLCFNow= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.26.0 h1:03cDLK28U6hWvCAns6NeydX3zIm4SF3ci69ulidS32Q= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc h1:zK/HqS5bZxDptfPJNq8v7vJfXtkU7r9TLIoSr1bXaP4= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -93,31 +98,29 @@ golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed h1:J22ig1FUekjjkmZUM7pTKixYm8DvrYsvrBZdunYeIuQ= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/wallet/txsizes/go.mod b/wallet/txsizes/go.mod index ccf7ddd4e1..f676cb2ef2 100644 --- a/wallet/txsizes/go.mod +++ b/wallet/txsizes/go.mod @@ -4,6 +4,12 @@ go 1.12 require ( github.com/btcsuite/btcd v0.23.4 - github.com/kr/pretty v0.1.0 // indirect - gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect + github.com/fsnotify/fsnotify v1.5.4 // indirect + github.com/kr/pretty v0.3.0 // indirect + github.com/onsi/gomega v1.26.0 // indirect + github.com/rogpeppe/go-internal v1.9.0 // indirect + github.com/stretchr/testify v1.8.2 // indirect + golang.org/x/crypto v0.7.0 // indirect + golang.org/x/net v0.10.0 // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect ) diff --git a/wallet/txsizes/go.sum b/wallet/txsizes/go.sum index 85c6b0905a..71c4f4ce8d 100644 --- a/wallet/txsizes/go.sum +++ b/wallet/txsizes/go.sum @@ -32,61 +32,64 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1 github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= +github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= +github.com/onsi/ginkgo/v2 v2.7.0 h1:/XxtEV3I3Eif/HobnVx9YmJgk8ENdRsuUmM+fLCFNow= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.26.0 h1:03cDLK28U6hWvCAns6NeydX3zIm4SF3ci69ulidS32Q= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc h1:zK/HqS5bZxDptfPJNq8v7vJfXtkU7r9TLIoSr1bXaP4= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -96,32 +99,30 @@ golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed h1:J22ig1FUekjjkmZUM7pTKixYm8DvrYsvrBZdunYeIuQ= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/walletdb/go.mod b/walletdb/go.mod index f5ca20bcbf..0adf6b807d 100644 --- a/walletdb/go.mod +++ b/walletdb/go.mod @@ -5,5 +5,7 @@ go 1.12 require ( github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f github.com/davecgh/go-spew v1.1.1 - go.etcd.io/bbolt v1.3.5-0.20200615073812-232d8fc87f50 + github.com/stretchr/testify v1.8.2 // indirect + go.etcd.io/bbolt v1.3.7 + golang.org/x/sys v0.8.0 // indirect ) diff --git a/walletdb/go.sum b/walletdb/go.sum index 28549dab19..e3faf084a9 100644 --- a/walletdb/go.sum +++ b/walletdb/go.sum @@ -1,8 +1,26 @@ github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f h1:bAs4lUbRJpnnkd9VhRV3jjAVU7DJVjMaK+IsvSeZvFo= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -go.etcd.io/bbolt v1.3.5-0.20200615073812-232d8fc87f50 h1:ASw9n1EHMftwnP3Az4XW6e308+gNsrHzmdhd0Olz9Hs= -go.etcd.io/bbolt v1.3.5-0.20200615073812-232d8fc87f50/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 h1:LfCXLvNmTYH9kEmVgqbnsWfruoXZIrh4YBgqVHtDvw0= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ= +go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +go.etcd.io/gofail v0.1.0/go.mod h1:VZBCXYGZhHAinaBiiqYvuDynvahNsAyLFwB3kEHKz1M= +golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/wtxmgr/go.mod b/wtxmgr/go.mod index f9e682e2a6..62b6f65fb5 100644 --- a/wtxmgr/go.mod +++ b/wtxmgr/go.mod @@ -8,5 +8,14 @@ require ( github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f github.com/btcsuite/btcwallet/walletdb v1.3.5 + github.com/fsnotify/fsnotify v1.5.4 // indirect + github.com/kr/pretty v0.3.0 // indirect github.com/lightningnetwork/lnd/clock v1.0.1 + github.com/onsi/gomega v1.26.0 // indirect + github.com/rogpeppe/go-internal v1.9.0 // indirect + github.com/stretchr/testify v1.8.2 // indirect + go.etcd.io/bbolt v1.3.7 // indirect + golang.org/x/crypto v0.7.0 // indirect + golang.org/x/net v0.10.0 // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect ) diff --git a/wtxmgr/go.sum b/wtxmgr/go.sum index bb139963d4..62a50b1762 100644 --- a/wtxmgr/go.sum +++ b/wtxmgr/go.sum @@ -24,6 +24,10 @@ github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -34,95 +38,231 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1 github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= +github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= +github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= +github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/lightningnetwork/lnd/clock v1.0.1 h1:QQod8+m3KgqHdvVMV+2DRNNZS1GRFir8mHZYA+Z2hFo= github.com/lightningnetwork/lnd/clock v1.0.1/go.mod h1:KnQudQ6w0IAMZi1SgvecLZQZ43ra2vpDNj7H/aasemg= -github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= +github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU= +github.com/onsi/ginkgo/v2 v2.1.6/go.mod h1:MEH45j8TBi6u9BMogfbp0stKC5cdGjumZj5Y7AG4VIk= +github.com/onsi/ginkgo/v2 v2.3.0/go.mod h1:Eew0uilEqZmIEZr8JrvYlvOM7Rr6xzTmMV8AyFNU9d0= +github.com/onsi/ginkgo/v2 v2.4.0/go.mod h1:iHkDK1fKGcBoEHT5W7YBq4RFWaQulw+caOMkAt4OrFo= +github.com/onsi/ginkgo/v2 v2.5.0/go.mod h1:Luc4sArBICYCS8THh8v3i3i5CuSZO+RaQRaJoeNwomw= +github.com/onsi/ginkgo/v2 v2.7.0 h1:/XxtEV3I3Eif/HobnVx9YmJgk8ENdRsuUmM+fLCFNow= +github.com/onsi/ginkgo/v2 v2.7.0/go.mod h1:yjiuMwPokqY1XauOgju45q3sJt6VzQ/Fict1LFVcsAo= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= +github.com/onsi/gomega v1.20.1/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= +github.com/onsi/gomega v1.21.1/go.mod h1:iYAIXgPSaDHak0LCMA+AWBpIKBr8WZicMxnE8luStNc= +github.com/onsi/gomega v1.22.1/go.mod h1:x6n7VNe4hw0vkyYUM4mjIXx3JbLiPaBPNgB7PRQ1tuM= +github.com/onsi/gomega v1.24.0/go.mod h1:Z/NWtiqwBrwUt4/2loMmHL63EDLnYHmVbuBpDr2vQAg= +github.com/onsi/gomega v1.24.1/go.mod h1:3AOiACssS3/MajrniINInwbfOOtfZvplPzuRSmvt1jM= +github.com/onsi/gomega v1.26.0 h1:03cDLK28U6hWvCAns6NeydX3zIm4SF3ci69ulidS32Q= +github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= -go.etcd.io/bbolt v1.3.5-0.20200615073812-232d8fc87f50 h1:ASw9n1EHMftwnP3Az4XW6e308+gNsrHzmdhd0Olz9Hs= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.etcd.io/bbolt v1.3.5-0.20200615073812-232d8fc87f50/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= +go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ= +go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +go.etcd.io/gofail v0.1.0/go.mod h1:VZBCXYGZhHAinaBiiqYvuDynvahNsAyLFwB3kEHKz1M= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= +golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= +golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= +golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc h1:zK/HqS5bZxDptfPJNq8v7vJfXtkU7r9TLIoSr1bXaP4= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= +golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed h1:J22ig1FUekjjkmZUM7pTKixYm8DvrYsvrBZdunYeIuQ= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= +golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= +golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From 026bbea06020e79bec9d16e9af3dab2a3175f4bb Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Thu, 21 Sep 2023 18:32:16 +0800 Subject: [PATCH 8/9] chain: add verbose logging when error in `getRawTxIgnoreErr` This commit modifies the method `getRawTxIgnoreErr` to log more useful info. It also removes `*mempool` as the method reciever as it's unnecessary to put it on mempool. --- chain/mempool.go | 30 +++++++++++++++++++----------- chain/mempool_test.go | 21 ++++++++------------- 2 files changed, 27 insertions(+), 24 deletions(-) diff --git a/chain/mempool.go b/chain/mempool.go index 0909f15512..0b2125e78d 100644 --- a/chain/mempool.go +++ b/chain/mempool.go @@ -153,7 +153,7 @@ type mempoolConfig struct { // // TODO(yy): interface rpcclient.FutureGetRawTransactionResult so we // can remove this hack. - rawTxReceiver func(getRawTxReceiver) *btcutil.Tx + rawTxReceiver func(chainhash.Hash, getRawTxReceiver) *btcutil.Tx } // newMempool creates a new mempool object. @@ -168,7 +168,7 @@ func newMempool(cfg *mempoolConfig) *mempool { // Mount the default methods. m.cfg.rawMempoolGetter = m.getRawMempool - m.cfg.rawTxReceiver = m.getRawTxIgnoreErr + m.cfg.rawTxReceiver = getRawTxIgnoreErr return m } @@ -482,9 +482,13 @@ func (m *mempool) batchGetRawTxes(txids []*chainhash.Hash, uint32(len(txids))/m.cfg.getRawTxBatchSize+1) defer log.Debugf("Finished batch GetRawTransaction") + // txRecievers defines a map that has the txid as its key and the tx's + // response reciever as its value. + type txRecievers map[chainhash.Hash]getRawTxReceiver + // respReceivers stores a list of response receivers returned from // batch calling `GetRawTransactionAsync`. - respReceivers := make([]getRawTxReceiver, 0, m.cfg.getRawTxBatchSize) + respReceivers := make(txRecievers, m.cfg.getRawTxBatchSize) // Conditionally init a newTxes slice. var newTxes []*wire.MsgTx @@ -496,7 +500,7 @@ func (m *mempool) batchGetRawTxes(txids []*chainhash.Hash, // bitcoind and waits for all the responses to return. Each time a // response is received, it will be used to update the local mempool // state and conditionally saved to a slice that will be returned. - processBatch := func(results []getRawTxReceiver) error { + processBatch := func(results txRecievers) error { // Ask the client to send all the batched requests. err := m.cfg.client.Send() if err != nil { @@ -504,8 +508,8 @@ func (m *mempool) batchGetRawTxes(txids []*chainhash.Hash, } // Iterate the recievers and fetch the response. - for _, resp := range results { - tx := m.cfg.rawTxReceiver(resp) + for txid, resp := range results { + tx := m.cfg.rawTxReceiver(txid, resp) if tx == nil { continue } @@ -533,7 +537,7 @@ func (m *mempool) batchGetRawTxes(txids []*chainhash.Hash, // Create the async request and save it to txRespReceivers. resp := m.cfg.client.GetRawTransactionAsync(txHash) - respReceivers = append(respReceivers, resp) + respReceivers[*txHash] = resp // When getRawTxBatchSize is reached, we'd ask the batch client // to send the requests and process the responses. @@ -555,7 +559,7 @@ func (m *mempool) batchGetRawTxes(txids []*chainhash.Hash, // Empty the slice for next batch iteration. respReceivers = make( - []getRawTxReceiver, 0, m.cfg.getRawTxBatchSize, + txRecievers, m.cfg.getRawTxBatchSize, ) } } @@ -581,7 +585,9 @@ func (m *mempool) batchGetRawTxes(txids []*chainhash.Hash, // for the txid in bitcoind's mempool. If the tx is replaced, confirmed, or not // yet included in bitcoind's mempool, the error txNotFoundErr will be // returned. -func (m *mempool) getRawTxIgnoreErr(rawTx getRawTxReceiver) *btcutil.Tx { +func getRawTxIgnoreErr(txid chainhash.Hash, + rawTx getRawTxReceiver) *btcutil.Tx { + tx, err := rawTx.Receive() // Exit early if there's no error. @@ -593,12 +599,14 @@ func (m *mempool) getRawTxIgnoreErr(rawTx getRawTxReceiver) *btcutil.Tx { errStr := strings.ToLower(err.Error()) errExp := strings.ToLower(txNotFoundErr) if strings.Contains(errStr, errExp) { - log.Debugf("unable to fetch transaction from mempool: %v", err) + log.Debugf("unable to fetch transaction %s from mempool: %v", + txid, err) } else { // Otherwise, unexpected error is found, we'll create an error // log. - log.Errorf("unable to fetch transaction from mempool: %v", err) + log.Errorf("unable to fetch transaction %s from mempool: %v", + txid, err) } return nil diff --git a/chain/mempool_test.go b/chain/mempool_test.go index b88e9bdfa1..c9599deca4 100644 --- a/chain/mempool_test.go +++ b/chain/mempool_test.go @@ -470,7 +470,9 @@ func TestUpdateMempoolTxes(t *testing.T) { m.cfg.rawMempoolGetter = func() ([]*chainhash.Hash, error) { return mempool1, nil } - m.cfg.rawTxReceiver = func(reciever getRawTxReceiver) *btcutil.Tx { + m.cfg.rawTxReceiver = func(txid chainhash.Hash, + reciever getRawTxReceiver) *btcutil.Tx { + switch reciever { case mockTx1Receiver: return btctx1 @@ -526,7 +528,9 @@ func TestUpdateMempoolTxes(t *testing.T) { m.cfg.rawMempoolGetter = func() ([]*chainhash.Hash, error) { return mempool2, nil } - m.cfg.rawTxReceiver = func(reciever getRawTxReceiver) *btcutil.Tx { + m.cfg.rawTxReceiver = func(txid chainhash.Hash, + reciever getRawTxReceiver) *btcutil.Tx { + switch reciever { case mockTx3Receiver: return btctx3 @@ -624,14 +628,6 @@ func TestUpdateMempoolTxesOnShutdown(t *testing.T) { func TestGetRawTxIgnoreErr(t *testing.T) { require := require.New(t) - // Create a mock client and init our mempool. - mockRPC := &mockRPCClient{} - m := newMempool(&mempoolConfig{ - client: mockRPC, - batchWaitInterval: 0, - getRawTxBatchSize: 1, - }) - // Create a normal transaction that has two inputs. op := wire.OutPoint{Hash: chainhash.Hash{1}} tx := &wire.MsgTx{ @@ -645,7 +641,7 @@ func TestGetRawTxIgnoreErr(t *testing.T) { mockReceiver.On("Receive").Return(btctx, nil).Once() // Call the method and expect the tx to be returned. - resp := m.getRawTxIgnoreErr(mockReceiver) + resp := getRawTxIgnoreErr(tx.TxHash(), mockReceiver) require.Equal(btctx, resp) // Mock the reciever to return an error. @@ -653,10 +649,9 @@ func TestGetRawTxIgnoreErr(t *testing.T) { mockReceiver.On("Receive").Return(nil, dummyErr).Once() // Call the method again and expect nil response. - resp = m.getRawTxIgnoreErr(mockReceiver) + resp = getRawTxIgnoreErr(tx.TxHash(), mockReceiver) require.Nil(resp) // Assert the mock client was called as expected. - mockRPC.AssertExpectations(t) mockReceiver.AssertExpectations(t) } From 4acd62b41d643f07c3cc5b214e1cb397de393718 Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Thu, 21 Sep 2023 21:30:22 +0800 Subject: [PATCH 9/9] chain: patch unit tests for `batchGetRawTxes` --- chain/mempool_test.go | 238 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 238 insertions(+) diff --git a/chain/mempool_test.go b/chain/mempool_test.go index c9599deca4..2f2f786a65 100644 --- a/chain/mempool_test.go +++ b/chain/mempool_test.go @@ -4,6 +4,7 @@ import ( "errors" "math" "testing" + "time" "github.com/btcsuite/btcd/btcutil" "github.com/btcsuite/btcd/chaincfg/chainhash" @@ -12,6 +13,10 @@ import ( "github.com/stretchr/testify/require" ) +// testTimeout is used to ensure the test will time out if the expected result +// is not returned in 5 seconds. +const testTimeout = 5 * time.Second + // TestCachedInputs tests that the cachedInputs works as expected. func TestCachedInputs(t *testing.T) { require := require.New(t) @@ -655,3 +660,236 @@ func TestGetRawTxIgnoreErr(t *testing.T) { // Assert the mock client was called as expected. mockReceiver.AssertExpectations(t) } + +// TestBatchGetRawTxesOnBatchSize checks that the batch size is properly +// handled. It defines a testing batch size of 3, and creates 7 testing +// transactions. Then it asserts there are 3 batches created and handled. +func TestBatchGetRawTxesOnBatchSize(t *testing.T) { + require := require.New(t) + + const ( + // Define a small batch size for testing only. + testBatchSize = 3 + + // Create 7 test transactions so we can hit our batching logic + // - we should create two full batches and one batch with the + // remaining transaction. + numTxes = testBatchSize*2 + 1 + ) + + // Create a mock client and init our mempool. + mockRPC := &mockRPCClient{} + m := newMempool(&mempoolConfig{ + client: mockRPC, + batchWaitInterval: 0, + getRawTxBatchSize: testBatchSize, + }) + + // Create test transactions and mempool state. + mempool := make([]*chainhash.Hash, 0, numTxes) + + // Create a map of raw tx response receivers, keyed by txid. + mockTxResponses := make(map[chainhash.Hash]*btcutil.Tx, numTxes) + + // Fill up the slices and mock the methods. + for i := 0; i < numTxes; i++ { + // Create testing transactions. + op := wire.OutPoint{Hash: chainhash.Hash{byte(i)}} + tx := &wire.MsgTx{ + LockTime: 1, + TxIn: []*wire.TxIn{{PreviousOutPoint: op}}, + } + + // Fill the testing mempool. + txHash := tx.TxHash() + mempool = append(mempool, &txHash) + + // Create a testing resposne receiver to be returned by + // GetRawTransactionAsync. + mockTxReceiver := make(rpcclient.FutureGetRawTransactionResult) + + // Add this tx to our mocked responses. + btcTx := btcutil.NewTx(tx) + mockTxResponses[txHash] = btcTx + + // Mock `GetRawTransactionAsync` to return the mocked value. + mockRPC.On("GetRawTransactionAsync", + &txHash).Return(mockTxReceiver).Once() + } + + // Mock the rawTxReceiver to find and return the tx found in map + // `mockTxResponses`. + m.cfg.rawTxReceiver = func(txid chainhash.Hash, + reciever getRawTxReceiver) *btcutil.Tx { + + btcTx, ok := mockTxResponses[txid] + require.Truef(ok, "unexpected receiver for %v", txid) + + return btcTx + } + + // We expect to send the batched requests three times - two for the + // full batch and one for the remaining batch. + mockRPC.On("Send").Return(nil).Times(3) + + // Call the method under test. + newTxes, err := m.batchGetRawTxes(mempool, true) + require.NoError(err) + + // Validate we have the expected number of transactions returned. + require.Len(newTxes, numTxes) + + // Assert the mock methods are called as expected. + mockRPC.AssertExpectations(t) +} + +// TestBatchGetRawTxesOnShutdown checks that the method returns immediately +// when the mempool is shutting down. +func TestBatchGetRawTxesOnShutdown(t *testing.T) { + require := require.New(t) + + // Create a mock client and init our mempool. + mockRPC := &mockRPCClient{} + m := newMempool(&mempoolConfig{ + client: mockRPC, + batchWaitInterval: 0, + getRawTxBatchSize: 1, + }) + + // Create a normal transaction. + op1 := wire.OutPoint{Hash: chainhash.Hash{1}} + tx1 := &wire.MsgTx{ + LockTime: 1, + TxIn: []*wire.TxIn{ + {PreviousOutPoint: op1}, + }, + } + tx1Hash := tx1.TxHash() + + // Create the current mempool state. + mempool := []*chainhash.Hash{&tx1Hash} + + // Shutdown the mempool before call the method. + m.Shutdown() + + // Call the method under test. + newTxes, err := m.batchGetRawTxes(mempool, true) + + // We expect no error and transactions. + require.NoError(err) + require.Empty(newTxes) + + // Assert GetRawTransaction is not called because mempool has quit. + mockRPC.AssertNotCalled(t, "GetRawTransactionAsync") + mockRPC.AssertNotCalled(t, "Send") +} + +// TestBatchGetRawTxesOnWait checks that the method stays on hold once the +// first batch is finished. +func TestBatchGetRawTxesOnWait(t *testing.T) { + require := require.New(t) + + const ( + // Define a long wait interval for testing only. + testWaitInterval = 10 * time.Minute + + // Define a small batch size for testing only. + testBatchSize = 3 + + // Create 4 test transactions so we can hit our batching logic + // once and then starts waiting. + numTxes = testBatchSize + 1 + ) + + // Create a mock client and init our mempool. + mockRPC := &mockRPCClient{} + m := newMempool(&mempoolConfig{ + client: mockRPC, + batchWaitInterval: testWaitInterval, + getRawTxBatchSize: testBatchSize, + }) + + // Create test transactions and mempool state. + mempool := make([]*chainhash.Hash, 0, numTxes) + + // Create a map of raw tx response receivers, keyed by txid. + mockTxResponses := make(map[chainhash.Hash]*btcutil.Tx, numTxes) + + // Fill up the slices. + for i := 0; i < numTxes; i++ { + // Create testing transactions. + op := wire.OutPoint{Hash: chainhash.Hash{byte(i)}} + tx := &wire.MsgTx{ + LockTime: 1, + TxIn: []*wire.TxIn{{PreviousOutPoint: op}}, + } + + // Fill the testing mempool. + txHash := tx.TxHash() + mempool = append(mempool, &txHash) + + // Add this tx to our mocked responses. + btcTx := btcutil.NewTx(tx) + mockTxResponses[txHash] = btcTx + } + + // Mock GetRawTransactionAsync. We expect it to be called 3 times. + for i := 0; i < testBatchSize; i++ { + // Create a testing resposne receiver. + mockTxReceiver := make(rpcclient.FutureGetRawTransactionResult) + + // Mock `GetRawTransactionAsync` to return the mocked value. + mockRPC.On("GetRawTransactionAsync", + mempool[i]).Return(mockTxReceiver).Once() + } + + // Mock the rawTxReceiver to find and return the tx found in map + // `mockTxResponses`. + m.cfg.rawTxReceiver = func(txid chainhash.Hash, + reciever getRawTxReceiver) *btcutil.Tx { + + btcTx, ok := mockTxResponses[txid] + require.Truef(ok, "unexpected receiver for %v", txid) + + return btcTx + } + + // We expect to send the batched requests exactly one time as the + // second batch will be blocked on the waiting. + mockRPC.On("Send").Return(nil).Once() + + var ( + err error + newTxes []*wire.MsgTx + done = make(chan struct{}) + ) + + // Call the method under test in a goroutine so we don't need to wait. + go func() { + newTxes, err = m.batchGetRawTxes(mempool, true) + + // Signal it's returned. + close(done) + }() + + // Sleep one second to allow the mempool moves to the point where the + // first batch is finished and it's now blocked on the waiting. We then + // shut down the mempool so batchGetRawTxes will return immediately. + time.Sleep(1 * time.Second) + m.Shutdown() + + // Catch the returned values with timeout. + select { + case <-done: + // Assert no error is returned, and we should get a nil slice + // since mempool is shut down. + require.NoError(err) + require.Nil(newTxes) + + case <-time.After(testTimeout): + require.Fail("timeout waiting for batchGetRawTxes") + } + + // Assert the mock methods are called as expected. + mockRPC.AssertExpectations(t) +}