Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
691 commits
Select commit Hold shift + click to select a range
6bdb56c
build: fix tidy-module script
yyforyongyu Mar 13, 2026
d658b49
multi: fix wtxmgr module tidy check
yyforyongyu Mar 10, 2026
2f8cb49
wallet: fix flaky account itest timestamps
yyforyongyu Mar 10, 2026
52e39d9
wallet: add `_time_format` for sqlite
yyforyongyu Mar 11, 2026
9e88f7c
wallet: fix postgres itest container readiness
yyforyongyu Mar 13, 2026
8e63058
build: add consolidated sql make target
yyforyongyu Mar 13, 2026
2969edc
docs: add ADR 0006 implementation notes
yyforyongyu Mar 13, 2026
6826245
wallet: prep db TxStore/UTXOStore interfaces
yyforyongyu Mar 13, 2026
7db04b6
wallet: add wtxmgr migrations (ADR 0006)
yyforyongyu Mar 13, 2026
4adab47
wallet: add sqlc queries for transactions
yyforyongyu Mar 13, 2026
c48b174
wallet: add sqlc queries for utxos
yyforyongyu Mar 13, 2026
95a246c
wallet: add sqlc queries for tx_replacements
yyforyongyu Mar 13, 2026
e038810
wallet: add sqlc queries for utxo_leases
yyforyongyu Mar 13, 2026
35b29f0
wallet: generate sqlc for wtxmgr
yyforyongyu Mar 13, 2026
25c7e19
wallet: dynamic set pg itest store max connections
GustavoStingelin Mar 24, 2026
905e800
wallet: give each parallel subtest its own test store
GustavoStingelin Mar 25, 2026
23f2ab7
bwtest: wait for miner p2p readiness
yyforyongyu Mar 25, 2026
76b1305
wallet: refactor itest testing his name
GustavoStingelin Mar 27, 2026
407a391
wallet: size postgres itest max_connections to P*M + M + 3*P
GustavoStingelin Mar 27, 2026
f907857
chain: fix flaky TestPrunedBlockDispatcherQuerySameBlock
yyforyongyu Feb 9, 2026
2c8199d
wallet: double postgres itest max_connections budget
yyforyongyu Mar 30, 2026
7e19f89
docs: add repo guide for coding agents
yyforyongyu Mar 30, 2026
21902c0
repo: ignore repo-local worktrees
yyforyongyu Mar 30, 2026
a34b937
wallet: update store interfaces's terminologies
yyforyongyu Mar 27, 2026
c3befff
wallet: update store SQL's terminologies
yyforyongyu Mar 27, 2026
e006c49
wallet: update tx store interfaces
yyforyongyu Mar 27, 2026
062a241
wallet: add `HasInvalidWalletUtxoByOutpoint` queries
yyforyongyu Mar 27, 2026
1d8e8ed
wallet: add `UpdateTransactionStateByHash` queries
yyforyongyu Mar 27, 2026
56dac5a
wallet: add `ListTransactionsWithoutBlock` queries
yyforyongyu Mar 27, 2026
2249a7e
wallet: fix sqlite lease query parameters
yyforyongyu Mar 24, 2026
11a12e4
wallet: add tx store itest helpers
yyforyongyu Mar 27, 2026
240aacb
wallet: add tx store common helpers
yyforyongyu Mar 27, 2026
7e742e9
wallet: add CreateTx ops
yyforyongyu Mar 27, 2026
932b595
wallet: add CreateTx
yyforyongyu Mar 27, 2026
d76ef39
wallet: add GetTx
yyforyongyu Mar 27, 2026
c88c681
wallet: add UpdateTx ops
yyforyongyu Mar 27, 2026
47fc361
wallet: add UpdateTx
yyforyongyu Mar 27, 2026
c11950b
wallet: add ListTxns
yyforyongyu Mar 27, 2026
20e0a3b
wallet: add DeleteTx ops
yyforyongyu Mar 27, 2026
1b3dcd3
wallet: add DeleteTx
yyforyongyu Mar 27, 2026
1a5b78e
wallet: add RollbackToBlock ops
yyforyongyu Mar 27, 2026
bf5af73
wallet: add RollbackToBlock
yyforyongyu Mar 27, 2026
193162f
wallet: add utxo store common helpers
yyforyongyu Mar 27, 2026
dec90a4
wallet: add GetUtxo
yyforyongyu Mar 27, 2026
c99db8b
wallet: add ListUTXOs
yyforyongyu Mar 27, 2026
bf0c2ed
wallet: add LeaseOutput ops
yyforyongyu Mar 27, 2026
0aa1864
wallet: add LeaseOutput
yyforyongyu Mar 27, 2026
0dab42c
wallet: add ReleaseOutput ops
yyforyongyu Mar 27, 2026
5ef42d1
wallet: add ReleaseOutput
yyforyongyu Mar 27, 2026
f51581c
wallet: add ListLeasedOutputs
yyforyongyu Mar 27, 2026
0716f00
wallet: add Balance
yyforyongyu Mar 27, 2026
2ac741d
wallet: type sqlite utxo store filters
yyforyongyu Apr 3, 2026
8b39ddb
wallet: document db ops interface pattern
yyforyongyu Apr 3, 2026
98ca8b3
wallet: share nullable SQL casting helpers
yyforyongyu Apr 3, 2026
d03b803
wallet: improve goroutine-safety in concurrent itests
GustavoStingelin Apr 2, 2026
906f26e
wallet: remove timing dependency from timestamp itest
GustavoStingelin Apr 2, 2026
1bcf34a
wallet: add AddressStore interface impl compile check
GustavoStingelin Mar 11, 2026
437cd36
wallet: add pagination base
GustavoStingelin Mar 9, 2026
12f26d6
wallet: add pagination to addresses
GustavoStingelin Mar 11, 2026
3902e8c
wallet: add pagination to wallets
GustavoStingelin Mar 11, 2026
1bac78f
wallet: change `rootHashes` from map to be set
yyforyongyu Apr 8, 2026
23314dc
wallet: exclude direct roots from descendant walk
yyforyongyu Apr 7, 2026
7a79b6d
wallet: add InvalidateUnminedTx API to TxStore
yyforyongyu Mar 27, 2026
cb76deb
wallet: add shared unmined invalidation workflow
yyforyongyu Mar 27, 2026
a56f5cb
wallet: add postgres and sqlite InvalidateUnminedTx backends
yyforyongyu Mar 27, 2026
dc93381
wallet: embed invalidation ops in CreateTx adapters
yyforyongyu Apr 7, 2026
65f8369
wallet: add CreateTx conflict backend hooks
yyforyongyu Apr 7, 2026
cb8ed49
wallet: reuse existing CreateTx rows
yyforyongyu Apr 7, 2026
e03633f
wallet: handle CreateTx conflicts in shared flow
yyforyongyu Apr 7, 2026
72f4cd5
wallet: add CreateTx conflict itests
yyforyongyu Apr 7, 2026
58d6cd3
wallet: integrate orphan handling into RollbackToBlock
yyforyongyu Mar 27, 2026
d7278d5
docs: add tx invalidation flow guide
yyforyongyu Mar 27, 2026
32555cf
wallet: rename `transaction` to `tx`
yyforyongyu Apr 7, 2026
b24e1f5
wallet: keep UpdateTx row-local
yyforyongyu Apr 7, 2026
13e7088
wallet: use mock.Mock in utxo helper tests
yyforyongyu Apr 7, 2026
0df6578
wallet: use mock.Mock in tx store helper tests
yyforyongyu Apr 7, 2026
3af194b
wallet: add tx status and utxo helper coverage
yyforyongyu Apr 8, 2026
1755e50
wallet: add tx store unit coverage
yyforyongyu Apr 8, 2026
f67a766
wallet: add tx corruption itest fixtures
yyforyongyu Mar 27, 2026
1925551
wallet: add create tx edge-case itests
yyforyongyu Mar 27, 2026
9e8ec36
wallet: add tx store corruption itests
yyforyongyu Mar 27, 2026
6398d92
wallet: add tx store edge-case itests
yyforyongyu Mar 27, 2026
2d96713
wallet: add utxo store edge-case itests
yyforyongyu Mar 27, 2026
3566ab4
wallet: add postgres tx store overflow itests
yyforyongyu Mar 27, 2026
c965077
wallet: add backend tx store error-path coverage
yyforyongyu Apr 7, 2026
4b2f0c8
wallet: add shared tx store helper coverage
yyforyongyu Apr 8, 2026
4d96cfe
wallet: add tx invalidation and corruption itests
yyforyongyu Apr 7, 2026
9d27699
wallet: add tx store edge-case itests
yyforyongyu Apr 8, 2026
92d3992
db: export shared backend helpers
yyforyongyu Apr 9, 2026
51a9a4c
db/sqlite: move backend files
yyforyongyu Apr 8, 2026
396fe24
db/pg: move backend files
yyforyongyu Apr 8, 2026
d0321be
sql/sqlite: move sql assets
yyforyongyu Apr 8, 2026
29419d4
sql/pg: move sql assets
yyforyongyu Apr 8, 2026
871e133
db/sqlite: drop private backend prefixes
yyforyongyu Apr 8, 2026
4e3b5d5
db/pg: drop private backend prefixes
yyforyongyu Apr 8, 2026
b82a653
db/sqlite: rename exported store API
yyforyongyu Apr 8, 2026
bb71424
db/pg: rename exported store API
yyforyongyu Apr 8, 2026
732b511
lint: relax split backend wrapcheck
yyforyongyu Apr 9, 2026
048f27e
wallet: simplify migration instance creation
GustavoStingelin Apr 14, 2026
2a7aea6
wallet: add rollback migrations functionality
GustavoStingelin Apr 14, 2026
a2758c1
wallet: fix addresses rollback objects
GustavoStingelin Apr 12, 2026
51769a5
wallet: test migration rollback reapply
GustavoStingelin Apr 14, 2026
0123b14
wallet: simplify pagination api
yyforyongyu Apr 8, 2026
9b9d103
wallet: validate page limits on construction
yyforyongyu Apr 13, 2026
bb0ee77
wallet: cleanup import aliases
GustavoStingelin Apr 14, 2026
fdd247c
db/err: add shared SQL error types
yyforyongyu Apr 14, 2026
b115645
db/pg: add SQL error mapper
yyforyongyu Apr 14, 2026
a76bfb5
db/sqlite: add SQL error mapper
yyforyongyu Apr 14, 2026
b98c0bc
db/err: add SQL error stats
yyforyongyu Apr 14, 2026
f3750da
db/err: add package README
yyforyongyu Apr 14, 2026
3c6170b
db/runtime: add ambiguous tx commit error
yyforyongyu Apr 14, 2026
e6ded29
db/runtime: add Read helper
yyforyongyu Apr 14, 2026
3931812
db/runtime: add Write helper
yyforyongyu Apr 14, 2026
b9afec3
bwtest: pin bitcoind to v1 transport
yyforyongyu Apr 15, 2026
87f5d66
wallet: add key scope wallet/id index
GustavoStingelin Apr 16, 2026
250d9a8
wallet: scope accounts to wallet ownership
GustavoStingelin Apr 16, 2026
78a069f
wallet: scope addresses to wallet ownership
GustavoStingelin Apr 16, 2026
196fed4
wallet: make address scripts unique per wallet
GustavoStingelin Apr 16, 2026
1431154
wallet: scope GetAddressSecret to wallet_id
GustavoStingelin Apr 21, 2026
70a186c
db/err: preserve domain errors
yyforyongyu Apr 21, 2026
eb09ea3
db: add runtime stats snapshots
yyforyongyu Apr 21, 2026
ceadcf9
db/sqlite: add runtime store helpers
yyforyongyu Apr 21, 2026
6a1361e
db/sqlite: route write paths through runtime
yyforyongyu Apr 21, 2026
8866d96
db/sqlite: route read paths through runtime
yyforyongyu Apr 21, 2026
c4ef453
db/pg: add runtime store helpers
yyforyongyu Apr 21, 2026
969ac15
db/pg: route write paths through runtime
yyforyongyu Apr 21, 2026
3f1400f
db/pg: route read paths through runtime
yyforyongyu Apr 21, 2026
6dfc08f
db: drop legacy tx helper
yyforyongyu Apr 15, 2026
0bdd33f
db/itest: verify SQL error classification
yyforyongyu Apr 20, 2026
324d01c
wallet: guard nil derived address callbacks
GustavoStingelin Apr 22, 2026
7d52af9
waddrmgr: fix address cache bookkeeping
yyforyongyu Apr 17, 2026
a425950
wallet: add wallet-owned address metadata types
yyforyongyu Apr 16, 2026
119a692
wallet: rename AddressInfo to GetAddressInfo
yyforyongyu Apr 16, 2026
447438d
wallet: return address metadata from lookup paths
yyforyongyu Apr 16, 2026
d5b8d30
wallet: separate signer key access from address lookup
yyforyongyu Apr 16, 2026
0929d61
waddrmgr: add AddressType output metadata
yyforyongyu Apr 17, 2026
8669e88
waddrmgr: add AddressType scope metadata
yyforyongyu Apr 16, 2026
f33d79d
wallet: replace metadata switches with AddressType methods
yyforyongyu Apr 16, 2026
ef9d30b
waddrmgr: add AddressType signing helpers
yyforyongyu Apr 17, 2026
e69e4db
wallet: return output script metadata
yyforyongyu Apr 17, 2026
13febb4
wallet: use address metadata in PSBT helpers
yyforyongyu Apr 17, 2026
9acddba
wallet: use AddressType signer helpers
yyforyongyu Apr 16, 2026
3e027b4
waddrmgr: derive imported pubkey script addresses
yyforyongyu Apr 17, 2026
57510dc
wallet+waddrmgr: trim account creation wrappers
yyforyongyu Apr 16, 2026
beb4b40
waddrmgr: reorder importPublicKey for funcorder
yyforyongyu Apr 20, 2026
51a887d
ci: detect bitcoind path in docker image
yyforyongyu Apr 23, 2026
9a052d2
wallet: move legacy helpers to deprecated
yyforyongyu Apr 16, 2026
7bf8f64
wallet: drop stale PSBT wrappers
yyforyongyu Apr 16, 2026
f9726a4
kvdb: rename UTXO adapter files
yyforyongyu Apr 15, 2026
361e805
wtxmgr: move legacy tx wrappers
yyforyongyu Apr 15, 2026
9963bd9
db+kvdb: add UpdateTx store support
yyforyongyu Apr 15, 2026
5082b49
wallet: migrate LabelTx to db.Store
yyforyongyu Apr 15, 2026
d6099e0
wallet: move legacy tx detail helper
yyforyongyu Apr 22, 2026
d1dda73
db: add tx detail read models
yyforyongyu Apr 22, 2026
22280e2
db: add tx detail ops interfaces
yyforyongyu Apr 22, 2026
df66fc0
db: add tx detail ops workflows
yyforyongyu Apr 22, 2026
4125ad2
sql/pg: add tx detail read queries
yyforyongyu Apr 22, 2026
c996d96
pg: implement tx detail reads
yyforyongyu Apr 22, 2026
58fba9e
sql/sqlite: add tx detail read queries
yyforyongyu Apr 22, 2026
fe5309c
sqlite: implement tx detail reads
yyforyongyu Apr 22, 2026
a564239
kvdb: add GetTx store adapter
yyforyongyu Apr 30, 2026
d4d456a
kvdb: add ListTxns store adapter
yyforyongyu Apr 30, 2026
84bfbee
kvdb: add GetTxDetail store adapter
yyforyongyu Apr 30, 2026
81c6cbf
kvdb: add ListTxDetails store adapter
yyforyongyu Apr 30, 2026
943b161
kvdb: wrap missing tx buckets
yyforyongyu Apr 30, 2026
668ba2e
db+wallet: expose tx detail reads
yyforyongyu Apr 30, 2026
b68b0c6
wallet: route GetTx through store
yyforyongyu Apr 30, 2026
b8498d0
wallet: route ListTxns through store
yyforyongyu Apr 30, 2026
ccbf93d
wallet: update tx reader benchmarks
yyforyongyu Apr 30, 2026
9fb92cc
itest: fix tagged lint issues
yyforyongyu May 11, 2026
413ce48
walletdb: fix account/wallet itest lint
yyforyongyu May 11, 2026
78ccf7a
walletdb: fix address itest lint
yyforyongyu May 11, 2026
51b2c47
walletdb: fix fixture itest lint
yyforyongyu May 11, 2026
5b08b57
walletdb: fix tx corruption itest lint
yyforyongyu May 11, 2026
46dfc8e
walletdb: fix tx/utxo itest lint
yyforyongyu May 11, 2026
187ac56
build: lint tagged itest variants
yyforyongyu May 11, 2026
cea3fbe
db: add account query validators
yyforyongyu May 12, 2026
743f693
db: add AccountStore to Store
yyforyongyu May 12, 2026
bda0ee9
db: add AddressStore to Store
yyforyongyu May 12, 2026
380350e
db: add WalletStore placeholder
yyforyongyu May 13, 2026
ed9bd95
kvdb+wallet: thread addr store into Store
yyforyongyu May 12, 2026
82699f6
wallet: add keyvault bridge
yyforyongyu May 12, 2026
31aa8df
wallet: add NilIfEmptyBytes fn
GustavoStingelin Apr 30, 2026
adea89c
wallet: hash pg dbname for long test names
GustavoStingelin Apr 30, 2026
d68acfc
wallet: enforce watch-only invariant on imported account creation
GustavoStingelin May 13, 2026
aeb3070
wallet: derive account watch-only from wallet at read time
GustavoStingelin May 13, 2026
041df5c
wallet: add canonical watch-only hierarchy tests for accounts
GustavoStingelin May 13, 2026
e8aa653
wallet: reject watch-only wallet secrets insertion
GustavoStingelin Apr 28, 2026
32db8e2
wallet: use watch-only from wallet in addresses
GustavoStingelin Apr 28, 2026
cfbcad4
wallet: enforce watch-only invariants in sql
GustavoStingelin Apr 29, 2026
5827a31
wallet: test sql watch-only invariants
GustavoStingelin Apr 29, 2026
b49261b
wallet: make watch-only immutable
GustavoStingelin May 4, 2026
23f3539
wallet: require key-scope secrets for spendable rows
GustavoStingelin May 14, 2026
cd31d33
wallet: enforce key-scope watch-only invariants
GustavoStingelin May 14, 2026
85da1ee
wallet: make wallet ownership immutable
GustavoStingelin May 14, 2026
75d9693
wallet: increase postgres itest connection budget
GustavoStingelin May 14, 2026
9b59e47
wallet: store wallet public key in plaintext
GustavoStingelin May 5, 2026
c77120c
wallet: store key scope public key in plaintext
GustavoStingelin May 5, 2026
655da70
wallet: add adr comment for plaintext fields
GustavoStingelin May 15, 2026
63bc244
wallet: replace advisory lock with persisted account counter
GustavoStingelin May 7, 2026
af3b4f6
wallet: extract shared CreateDerivedAccount workflow
GustavoStingelin May 7, 2026
1659d64
wallet: use testify mock for derived account ops tests
GustavoStingelin May 15, 2026
8e11aa6
docs: add mock.Mock guidance for interface tests
GustavoStingelin May 15, 2026
ed917a3
waddrmgr: export namespace key and master HD bucket readers
yyforyongyu May 14, 2026
f195134
waddrmgr: add derived-account allocator and put-with-keys
yyforyongyu May 14, 2026
3411a32
waddrmgr: add imported-account allocator and put-with-keys
yyforyongyu May 14, 2026
d1118b5
db: collapse `AccountProperties` into `AccountInfo`
yyforyongyu May 14, 2026
d6f5236
db: filter Balance by key scope
yyforyongyu May 15, 2026
b1fc63a
wallet: introduce runtime cache scaffolding
yyforyongyu May 14, 2026
797e501
db: add `MasterPubKey` to `WalletInfo`
yyforyongyu May 14, 2026
796dc0e
db: route AccountDerivationFunc through AccountStore.CreateDerivedAcc…
yyforyongyu May 15, 2026
cc490a1
db: invoke AccountDerivationFunc in CreateDerivedAccountWithOps
yyforyongyu May 15, 2026
bf3bda8
wallet: add account derivation helper
yyforyongyu May 14, 2026
f174920
itest: clean up pre-existing lint findings
yyforyongyu May 14, 2026
3968223
itest: bump postgres `max_connections` budget
yyforyongyu May 14, 2026
bad5f54
lint: exempt kvdb backend from wrapcheck
yyforyongyu May 14, 2026
ab09ee3
db: surface `PublicKey` and `MasterFingerprint` on lightweight accoun…
yyforyongyu May 15, 2026
b59b2af
db: thread balance fields through `AccountInfoRow` plumbing
yyforyongyu May 15, 2026
d7cc57a
db: add `AccountBalance` query
yyforyongyu May 15, 2026
2f03756
db: dispatch `AccountBalance` on `GetAccount` reads
yyforyongyu May 15, 2026
a44507a
db: add `AccountBalancesByIDs` query
yyforyongyu May 15, 2026
e905d47
db: dispatch `AccountBalancesByIDs` on `ListAccounts` reads
yyforyongyu May 15, 2026
7f76b27
waddrmgr: expose legacy adapter methods on public interfaces
yyforyongyu May 15, 2026
80803e6
wallet: cache master fingerprint on Wallet at Manager.Load
yyforyongyu May 19, 2026
5199b9e
wallet: remove Balance account API
yyforyongyu May 20, 2026
3720530
wallet: move AccountsResult to deprecated
yyforyongyu May 20, 2026
d8ad1dd
wallet: surface db.AccountInfo on read APIs
yyforyongyu May 19, 2026
8c4c30a
wallet: return account info lists
yyforyongyu May 20, 2026
bb06f9b
wallet: split account name lookup
yyforyongyu May 20, 2026
9feb0dd
wtxmgr: add `UnspentOutputsIncludingLocked`
yyforyongyu May 19, 2026
34ab6b1
wallet: wire keyVault into the test fixture
yyforyongyu May 19, 2026
9a98e58
db: add Name field to BalanceParams
yyforyongyu May 20, 2026
34fcee8
sql: thread Name through Balance backend
yyforyongyu May 20, 2026
f2e8478
kvdb: implement `GetEncryptedHDSeed`
yyforyongyu May 14, 2026
66e71eb
kvdb: implement `GetAccount`
yyforyongyu May 14, 2026
95e6931
wallet: route `GetAccount` through `Store`
yyforyongyu May 14, 2026
e2882da
kvdb: implement `ListAccounts`
yyforyongyu May 14, 2026
51fc914
wallet: route ListAccounts through cache
yyforyongyu May 19, 2026
64e6331
wallet: route ListAccountsByScope through cache
yyforyongyu May 19, 2026
2df598b
wallet: route ListAccountsByName through cache
yyforyongyu May 19, 2026
b1e581d
kvdb: implement `RenameAccount`
yyforyongyu May 19, 2026
6d5ffb6
wallet: route `RenameAccount` through `Store`
yyforyongyu May 19, 2026
1c01dab
kvdb: implement `Balance`
yyforyongyu May 19, 2026
ff23567
kvdb: implement `CreateDerivedAccount` via ops adapter
yyforyongyu May 19, 2026
5900068
wallet: route `NewAccount` through `Store`
yyforyongyu May 19, 2026
7f6ad15
kvdb: implement `CreateImportedAccount`
yyforyongyu May 19, 2026
a9c1859
wallet: route `ImportAccount` through `Store`
yyforyongyu May 19, 2026
f370e3b
wallet: support neutered kvdb account derivation
yyforyongyu May 20, 2026
7c90b78
wip: setup ll linter
GustavoStingelin May 25, 2026
1b021a4
wip: auto fix
GustavoStingelin May 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .custom-gcl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
version: v2.12.2
plugins:
- module: 'github.com/lightningnetwork/lnd/tools/linters'
version: v0.0.0-20260525132409-9f03672bdaba
2 changes: 1 addition & 1 deletion .gemini/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ code_review:

# List of glob patterns to ignore (files and directories).
# Type: array of string, default: [].
ignore_patterns: []
ignore_patterns: ["deprecated.go"]
6 changes: 3 additions & 3 deletions .gemini/styleguide.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# LND Style Guide
# Btcwallet Style Guide

## Code Documentation and Commenting

Expand All @@ -9,7 +9,7 @@
- Unit tests must always use the `require` library. Either table driven unit
tests or tests using the `rapid` library are preferred.
- The line length MUST NOT exceed 80 characters, this is very important.
You must count the Golang indentation (tabulator character) as 8 spaces when
You must count the Golang indentation (tabulator character) as 4 spaces when
determining the line length. Use creative approaches or the wrapping rules
specified below to make sure the line length isn't exceeded.
- Every function must be commented with its purpose and assumptions.
Expand Down Expand Up @@ -151,7 +151,7 @@ if amt < 546 {
### 80 character line length

- Wrap columns at 80 characters.
- Tabs are 8 spaces.
- Tabs are 4 spaces.

**WRONG**
```go
Expand Down
260 changes: 244 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ env:
BITCOIND_VERSION: '22.0'
BITCOIND_IMAGE: 'lightninglabs/bitcoin-core'

BTCD_VERSION_LATEST: v0.25.0

jobs:
########################
# Format, compileation and lint check
Expand Down Expand Up @@ -63,6 +65,15 @@ jobs:
- name: Check RPC format
run: make rpc-check

- name: Check generated SQL code is up-to-date
run: make sqlc-check

- name: Check SQL formatting
run: make sql-format-check

- name: Check SQL linting
run: make sql-lint-check

- name: compile code
run: go install -v ./...

Expand Down Expand Up @@ -112,28 +123,29 @@ jobs:
steps:
- name: extract bitcoind from docker image
run: |-
docker pull ${{ env.BITCOIND_IMAGE }}:${{ env.BITCOIND_VERSION }}
CONTAINER_ID=$(docker create ${{ env.BITCOIND_IMAGE }}:${{ env.BITCOIND_VERSION }})
sudo docker cp $CONTAINER_ID:/opt/bitcoin-${{ env.BITCOIND_VERSION }}/bin/bitcoind /usr/local/bin/bitcoind
IMAGE=${{ env.BITCOIND_IMAGE }}:${{ env.BITCOIND_VERSION }}
docker pull $IMAGE

BIN_PATH=$(docker run --rm --entrypoint sh $IMAGE -c '
command -v bitcoind ||
find /opt /usr -type f -name bitcoind 2>/dev/null | head -n 1
')
if [ -z "$BIN_PATH" ]; then
echo "could not locate bitcoind in $IMAGE" >&2
exit 1
fi

CONTAINER_ID=$(docker create $IMAGE)
sudo docker cp $CONTAINER_ID:$BIN_PATH /usr/local/bin/bitcoind
docker rm $CONTAINER_ID
bitcoind --version

- name: git checkout
uses: actions/checkout@v5

- name: Clean up runner space
uses: ./.github/actions/cleanup-space

- name: go cache
uses: actions/cache@v4
with:
path: /home/runner/work/go
key: btcwallet-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
btcwallet-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-${{ hashFiles('**/go.sum') }}
btcwallet-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ github.job }}-
btcwallet-${{ runner.os }}-go-${{ env.GO_VERSION }}-
btcwallet-${{ runner.os }}-go-

- name: setup go ${{ env.GO_VERSION }}
uses: actions/setup-go@v5
with:
Expand All @@ -143,9 +155,225 @@ jobs:
run: make ${{ matrix.unit_type }}

- name: Send coverage
uses: shogo82148/actions-goveralls@v1
uses: coverallsapp/github-action@v2
if: matrix.unit_type == 'unit-cover'
continue-on-error: true
with:
path-to-profile: coverage.txt
file: coverage.txt
flag-name: unit
format: golang
parallel: true

########################
# run integration tests (SQLite + Postgres)
########################
itest-db:
name: ${{ matrix.db }} itest (${{ matrix.race && 'race' || 'cover' }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
db: [sqlite, postgres]
race: [false, true]
steps:
- name: git checkout
uses: actions/checkout@v5

- name: Clean up runner space
uses: ./.github/actions/cleanup-space

- name: setup go ${{ env.GO_VERSION }}
uses: actions/setup-go@v5
with:
go-version: '${{ env.GO_VERSION }}'

- name: run ${{ matrix.db }} itest-db (coverage)
if: ${{ !matrix.race }}
run: make itest-db db=${{ matrix.db }} cover=1 verbose=1

- name: run ${{ matrix.db }} itest-db-race
if: matrix.race
run: make itest-db-race db=${{ matrix.db }} verbose=1

- name: Upload coverage to Coveralls
uses: coverallsapp/github-action@v2
if: ${{ !matrix.race }}
continue-on-error: true
with:
file: coverage-itest-${{ matrix.db }}.txt
flag-name: itest-db-${{ matrix.db }}
format: golang
parallel: true

########################
# Run bwtest integration tests against each supported chain backend.
#
# These jobs currently use kvdb only. Database expansion is planned via a
# separate matrix in a future change.
########################
itest-btcd:
name: itest btcd
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v5

- name: Clean up runner space
uses: ./.github/actions/cleanup-space

- name: setup go ${{ env.GO_VERSION }}
uses: actions/setup-go@v5
with:
go-version: '${{ env.GO_VERSION }}'

- name: add go bin to PATH
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH

- name: install btcd ${{ env.BTCD_VERSION_LATEST }}
run: go install -v github.com/btcsuite/btcd@${{ env.BTCD_VERSION_LATEST }}

- name: check btcd version
run: btcd --version

# The btcd backend job runs btcd for both the shared miner and the chain
# backend under test.
- name: run itest (btcd, kvdb)
run: make itest chain=btcd db=kvdb

- name: upload itest logs
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: itest-logs-btcd
path: itest/test-logs
retention-days: 5

########################
# Run bwtest integration tests with the neutrino backend.
#
# Job flow:
# - Install btcd `${{ env.BTCD_VERSION_LATEST }}`.
# - Use btcd as the shared miner for the suite.
# - Run `make itest chain=neutrino db=kvdb` so wallets use the in-process
# neutrino backend while blocks/peers come from btcd.
########################
itest-neutrino:
name: itest neutrino
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v5

- name: Clean up runner space
uses: ./.github/actions/cleanup-space

- name: setup go ${{ env.GO_VERSION }}
uses: actions/setup-go@v5
with:
go-version: '${{ env.GO_VERSION }}'

- name: add go bin to PATH
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH

- name: install btcd ${{ env.BTCD_VERSION_LATEST }}
run: go install -v github.com/btcsuite/btcd@${{ env.BTCD_VERSION_LATEST }}

- name: check btcd version
run: btcd --version

# Neutrino runs in-process, but it still relies on the shared btcd miner
# for chain data and peer connectivity.
- name: run itest (neutrino, kvdb)
run: make itest chain=neutrino db=kvdb

- name: upload itest logs
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: itest-logs-neutrino
path: itest/test-logs
retention-days: 5

########################
# Run bwtest integration tests with the bitcoind backend.
#
# Job flow:
# - Install btcd `${{ env.BTCD_VERSION_LATEST }}` as the shared miner.
# - Run a matrix over bitcoind versions `30` (latest) and `28` (older).
# - Extract each matrix binary from the docker image and run
# `make itest chain=bitcoind db=kvdb`.
########################
itest-bitcoind:
name: itest bitcoind (v${{ matrix.bitcoind_version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
bitcoind_version: ['30', '28']
steps:
- name: git checkout
uses: actions/checkout@v5

- name: Clean up runner space
uses: ./.github/actions/cleanup-space

- name: setup go ${{ env.GO_VERSION }}
uses: actions/setup-go@v5
with:
go-version: '${{ env.GO_VERSION }}'

- name: add go bin to PATH
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH

- name: install btcd ${{ env.BTCD_VERSION_LATEST }}
run: go install -v github.com/btcsuite/btcd@${{ env.BTCD_VERSION_LATEST }}

- name: check btcd version
run: btcd --version

# For bitcoind backend tests, btcd remains the shared miner while the
# matrix covers both bitcoind v30 (latest) and v28 (older).
- name: extract bitcoind from docker image (${{ matrix.bitcoind_version }})
run: |-
IMAGE=${{ env.BITCOIND_IMAGE }}:${{ matrix.bitcoind_version }}
docker pull $IMAGE

BIN_PATH=$(docker run --rm --entrypoint sh $IMAGE -c '
command -v bitcoind ||
find /opt /usr -type f -name bitcoind 2>/dev/null | head -n 1
')
if [ -z "$BIN_PATH" ]; then
echo "could not locate bitcoind in $IMAGE" >&2
exit 1
fi

CONTAINER_ID=$(docker create $IMAGE)
sudo docker cp $CONTAINER_ID:$BIN_PATH /usr/local/bin/bitcoind
docker rm $CONTAINER_ID
bitcoind --version

- name: run itest (bitcoind, kvdb)
run: make itest chain=bitcoind db=kvdb

- name: upload itest logs
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: itest-logs-bitcoind-${{ matrix.bitcoind_version }}
path: itest/test-logs
retention-days: 5

########################
# Complete parallel coverage uploads
########################
finish:
name: Finish coverage upload
if: ${{ !cancelled() }}
needs: [unit-test, itest-db]
runs-on: ubuntu-latest
steps:
- name: Finish parallel Coveralls upload
uses: coverallsapp/github-action@v2
continue-on-error: true
with:
parallel-finished: true
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,20 @@ btcwallet
vendor
.idea
coverage.txt
coverage-itest-postgres.txt
coverage-itest-sqlite.txt
*.swp
.vscode
.DS_Store
.aider*
/.worktrees/
coverage.out
*.prof
*.test
*cpu.out

# Integration test logs.
itest/test-logs/

# Backwards compatibility for older log dir.
itest/.minerlogs/
Loading
Loading