Commit Graph

18 Commits

Author SHA1 Message Date
yyforyongyu
1f67d6a548
bitcoindnotify: fix subtest closure in unit tests 2023-01-19 21:06:23 +08:00
positiveblue
c602ac07e7
chainntnfs: move cache implementation to channeldb
This commit moves the `HeightHintCache` implementation to the
`channeldb` package and inverts the dependency relation between
`chainntnfs` and `channeldb`.

Many packages depend on channeldb for type definitions,
interfaces, etc. `chainntnfs` is an example of that. `chainntnfs`
defines the  `SpendHintCache` and `ConfirmHintCache` interfaces but
it also implments them (`HeightHintCache` struct). The implementation
uses logic that should not leak from channeldb (ex: bucket paths).
This makes our code highly coupled + it would not allow us to use any
of these interfaces in a package that is imported by `channeldb`
(circular dependency).
2023-01-16 03:13:17 -08:00
Eng Zer Jun
cac8f54a45
chainntnfs: replace defer cleanup with t.Cleanup
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-10-13 17:01:35 +08:00
Eng Zer Jun
712177ee03
chainntnfs: use T.TempDir to create temporary test directory
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-08-24 08:58:16 +08:00
Olaoluwa Osuntokun
08f1c2e93a
chainntfns: add new option for conf notifications to send block
In this commit, we add a new option for the existing confirmation
notification system that optionally allows the caller to specify that a
block should be included as well.

The only quirk w/ the implementation here is the neutrino backend:
usually we get filtered blocks, we so need to first fetch the block
again so we can deliver the full block to the notifier. On the notifier
end, it'll only be checking for the transactions we care about, to
sending a full block doesn't affect the correctness.

We also extend the `testBatchConfirmationNotification` test to assert
that a block is only included if the caller specifies it.
2022-08-01 19:59:21 -07:00
Tommy Volk
9a10c80bcb multi: move many t.Fatalf calls to require.NoError 2022-06-17 04:26:55 +00:00
Elle Mouton
0459ccf542
chainntnfs: test both zmq and rpc bitcoind modes 2022-05-11 09:02:13 +02:00
Oliver Gugger
7dfe4018ce
multi: use btcd's btcec/v2 and btcutil modules
This commit was previously split into the following parts to ease
review:
 - 2d746f68: replace imports
 - 4008f0fd: use ecdsa.Signature
 - 849e33d1: remove btcec.S256()
 - b8f6ebbd: use v2 library correctly
 - fa80bca9: bump go modules
2022-03-09 19:02:37 +01:00
Oliver Gugger
ffee7d1bcf
multi: fix newly detected linter issues 2022-02-10 11:02:02 +01:00
Andras Banki-Horvath
d059f78b4d
build: add dev tag to the linter config 2022-01-24 17:43:00 +01:00
Oliver Gugger
0b4e03f5fc
multi: add golang 1.17 compatible build tags
With go 1.17 a change to the build flags was implemented:
https://go.googlesource.com/proposal/+/master/design/draft-gobuild.md

The formatter now automatically adds the forward-compatible build tag
format and the linter checks for them, so we need to include them in our
code.
2021-09-29 17:31:37 -07:00
Olaoluwa Osuntokun
0d8ffd95dd
chainntnfs/test: add new test assertion to ensure block epoch headers set 2021-08-25 16:47:04 -07:00
Oliver Gugger
482f76a0f4
mod+kvdb+channeldb: use btcwallet new DB interface
Depends on btcsuite/btcwallet#757.
Pulls in the updated version of btcwallet and walletdb that have the DB
interface enhanced by their own View() and Update() methods with the
reset callback/closure supported out of the box. That way the global
package-level View() and Update() functions now become pure redirects.
2021-08-04 14:55:55 +02:00
Elle Mouton
f8de10511e chainntnfs: add block cache to NeutrinoNotifier
This commit adds gives BtcdNotifier access to the block cache and wraps
its GetBlock method so that the block cache's mutex map for the specific
hash is used.
2021-04-28 09:59:50 +02:00
Elle Mouton
a0f7bf8b2d chainntnfs: add block cache to BtcdNotifier
This commit adds gives BtcdNotifier access to the block cache and wraps
its GetBlock method so that it uses the block cache.
2021-04-28 09:46:11 +02:00
Elle Mouton
8a33fbf11a chainntnfs: add block cache to BitcoindNotifier
This commit adds a blockcache pointer to BitcoindNotifier and wraps its
GetBlock method so that the block cache is used.
2021-04-28 09:46:11 +02:00
Wilmer Paulino
a620ce3682
build: update btcd and btcwallet dependencies 2021-04-05 15:41:04 -07:00
Conner Fromknecht
ea8d02eb68
chainntnfs/test: parallelize iface tests by backend 2020-12-10 20:56:10 -08:00