Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
553 commits
Select commit Hold shift + click to select a range
ded69c5
walletdb: fix address itest lint
yyforyongyu May 11, 2026
e2488d8
walletdb: fix fixture itest lint
yyforyongyu May 11, 2026
9ffba89
walletdb: fix tx corruption itest lint
yyforyongyu May 11, 2026
3dc9461
walletdb: fix tx/utxo itest lint
yyforyongyu May 11, 2026
0f4cccd
build: lint tagged itest variants
yyforyongyu May 11, 2026
a782795
db: add account query validators
yyforyongyu May 12, 2026
430146a
db: add AccountStore to Store
yyforyongyu May 12, 2026
9da6f08
db: add AddressStore to Store
yyforyongyu May 12, 2026
d1dc565
db: add WalletStore placeholder
yyforyongyu May 13, 2026
3230721
kvdb+wallet: thread addr store into Store
yyforyongyu May 12, 2026
3dd4da1
wallet: add keyvault bridge
yyforyongyu May 12, 2026
2b0da61
wallet: add NilIfEmptyBytes fn
GustavoStingelin Apr 30, 2026
3d8ca8a
wallet: hash pg dbname for long test names
GustavoStingelin Apr 30, 2026
723d0b1
wallet: enforce watch-only invariant on imported account creation
GustavoStingelin May 13, 2026
1c6594d
wallet: derive account watch-only from wallet at read time
GustavoStingelin May 13, 2026
f869ae2
wallet: add canonical watch-only hierarchy tests for accounts
GustavoStingelin May 13, 2026
4c744c6
wallet: reject watch-only wallet secrets insertion
GustavoStingelin Apr 28, 2026
b4d14bd
wallet: use watch-only from wallet in addresses
GustavoStingelin Apr 28, 2026
3ca1e68
wallet: enforce watch-only invariants in sql
GustavoStingelin Apr 29, 2026
e185fa6
wallet: test sql watch-only invariants
GustavoStingelin Apr 29, 2026
3996f1a
wallet: make watch-only immutable
GustavoStingelin May 4, 2026
9235a96
wallet: require key-scope secrets for spendable rows
GustavoStingelin May 14, 2026
268ad3e
wallet: enforce key-scope watch-only invariants
GustavoStingelin May 14, 2026
3f693c8
wallet: make wallet ownership immutable
GustavoStingelin May 14, 2026
80f13f5
wallet: increase postgres itest connection budget
GustavoStingelin May 14, 2026
2e66125
wallet: store wallet public key in plaintext
GustavoStingelin May 5, 2026
7a38786
wallet: store key scope public key in plaintext
GustavoStingelin May 5, 2026
629858b
wallet: add adr comment for plaintext fields
GustavoStingelin May 15, 2026
64725ed
wallet: replace advisory lock with persisted account counter
GustavoStingelin May 7, 2026
d45fd64
wallet: extract shared CreateDerivedAccount workflow
GustavoStingelin May 7, 2026
cafb70a
wallet: use testify mock for derived account ops tests
GustavoStingelin May 15, 2026
e826aed
docs: add mock.Mock guidance for interface tests
GustavoStingelin May 15, 2026
2b51bcb
waddrmgr: export namespace key and master HD bucket readers
yyforyongyu May 14, 2026
04f52ed
waddrmgr: add derived-account allocator and put-with-keys
yyforyongyu May 14, 2026
6c7609b
waddrmgr: add imported-account allocator and put-with-keys
yyforyongyu May 14, 2026
b2406fa
db: collapse `AccountProperties` into `AccountInfo`
yyforyongyu May 14, 2026
9d5f27f
db: filter Balance by key scope
yyforyongyu May 15, 2026
955bf5e
wallet: introduce runtime cache scaffolding
yyforyongyu May 14, 2026
8331407
db: add `MasterPubKey` to `WalletInfo`
yyforyongyu May 14, 2026
8c51b24
db: route AccountDerivationFunc through AccountStore.CreateDerivedAcc…
yyforyongyu May 15, 2026
9145067
db: invoke AccountDerivationFunc in CreateDerivedAccountWithOps
yyforyongyu May 15, 2026
f77668b
wallet: add account derivation helper
yyforyongyu May 14, 2026
2132d71
itest: clean up pre-existing lint findings
yyforyongyu May 14, 2026
4344be2
itest: bump postgres `max_connections` budget
yyforyongyu May 14, 2026
a915db3
lint: exempt kvdb backend from wrapcheck
yyforyongyu May 14, 2026
d2274d3
db: surface `PublicKey` and `MasterFingerprint` on lightweight accoun…
yyforyongyu May 15, 2026
8f60884
db: thread balance fields through `AccountInfoRow` plumbing
yyforyongyu May 15, 2026
e876117
db: add `AccountBalance` query
yyforyongyu May 15, 2026
00cb390
db: dispatch `AccountBalance` on `GetAccount` reads
yyforyongyu May 15, 2026
e983c99
db: add `AccountBalancesByIDs` query
yyforyongyu May 15, 2026
89407f4
db: dispatch `AccountBalancesByIDs` on `ListAccounts` reads
yyforyongyu May 15, 2026
be18152
waddrmgr: expose legacy adapter methods on public interfaces
yyforyongyu May 15, 2026
9501d18
wallet: cache master fingerprint on Wallet at Manager.Load
yyforyongyu May 19, 2026
630b861
wallet: remove Balance account API
yyforyongyu May 20, 2026
c95b2fb
wallet: move AccountsResult to deprecated
yyforyongyu Jun 26, 2026
65ae204
wallet: surface db.AccountInfo on read APIs
yyforyongyu May 19, 2026
1ead97f
wallet: return account info lists
yyforyongyu May 20, 2026
756fc1d
wallet: split account name lookup
yyforyongyu May 20, 2026
9d154b0
wtxmgr: add `UnspentOutputsIncludingLocked`
yyforyongyu May 19, 2026
014fd27
wallet: wire keyVault into the test fixture
yyforyongyu May 19, 2026
fa491d2
db: add Name field to BalanceParams
yyforyongyu May 20, 2026
c59291f
sql: thread Name through Balance backend
yyforyongyu May 20, 2026
8b41967
kvdb: implement `GetEncryptedHDSeed`
yyforyongyu May 14, 2026
9c5e97b
kvdb: implement `GetAccount`
yyforyongyu May 14, 2026
daa1842
wallet: route `GetAccount` through `Store`
yyforyongyu May 14, 2026
9555e53
kvdb: implement `ListAccounts`
yyforyongyu May 14, 2026
9148a87
wallet: route ListAccounts through cache
yyforyongyu May 19, 2026
282f8c7
wallet: route ListAccountsByScope through cache
yyforyongyu May 19, 2026
57a22bf
wallet: route ListAccountsByName through cache
yyforyongyu May 19, 2026
9cbc426
kvdb: implement `RenameAccount`
yyforyongyu May 19, 2026
4229c26
wallet: route `RenameAccount` through `Store`
yyforyongyu May 19, 2026
62b8c1d
kvdb: implement `Balance`
yyforyongyu May 19, 2026
74c422c
kvdb: implement `CreateDerivedAccount` via ops adapter
yyforyongyu May 19, 2026
99f8b4b
wallet: route `NewAccount` through `Store`
yyforyongyu May 19, 2026
61c9f5b
kvdb: implement `CreateImportedAccount`
yyforyongyu May 19, 2026
b5a4cf6
wallet: route `ImportAccount` through `Store`
yyforyongyu May 19, 2026
266f3ba
wallet: support neutered kvdb account derivation
yyforyongyu May 20, 2026
4717ba8
wallet: refactor wallet db to ops interface
GustavoStingelin May 20, 2026
122b87c
wallet: add wallet db ops interface unit tests
GustavoStingelin May 20, 2026
7181722
wallet: add get wallet secrets to store
GustavoStingelin May 21, 2026
0fef4e6
wallet: remove underline from wallet test names
GustavoStingelin May 21, 2026
83473cf
wallet: use type walletInfoRow interface for common structs
GustavoStingelin May 22, 2026
128f8e0
wallet: split wallet store implementations to specific files
GustavoStingelin May 22, 2026
24c7d5b
wallet: split wallet db implementations to specific files
GustavoStingelin May 22, 2026
bff5640
wallet: split wallet store itests to specific files
GustavoStingelin May 25, 2026
c489bf5
wallet: split wallet store unit tests to specific files
GustavoStingelin May 25, 2026
119090d
wallet: distinguish missing wallet secrets from missing wallet
GustavoStingelin May 25, 2026
0b25975
docs: add ADR 0011 (no addresses.used column)
yyforyongyu May 20, 2026
e3a3074
waddrmgr: export taproot script codec
yyforyongyu May 11, 2026
8c21c3c
waddrmgr: export `ManagedPubKeyAddressHasPrivateKey`
yyforyongyu May 16, 2026
5ad0ca5
db: add HasScript field + IsWatchOnly helper to imported address params
yyforyongyu May 20, 2026
2b04a5c
db: add SQL helpers for derived-address adapter rows
yyforyongyu May 26, 2026
fd6ab1b
db: thread per-account addrSchema and PubKey through address derivation
yyforyongyu May 26, 2026
c7c7e1c
db: add account-metadata fields + helpers on AddressInfo
yyforyongyu May 20, 2026
de8d060
db: select account metadata columns in address read queries
yyforyongyu May 20, 2026
2e599fd
db: wire pg/sqlite address adapters through ApplyAddressAccountMetadata
yyforyongyu May 20, 2026
ccd7661
db: add IsUsed to AddressInfo + AddressInfoRow
yyforyongyu May 20, 2026
91e133b
db: derive IsUsed from utxos via EXISTS on SQL
yyforyongyu May 22, 2026
ff8ae03
db: move derived-address types to data_types.go
yyforyongyu May 27, 2026
1d169d7
kvdb: add address type metadata
yyforyongyu May 12, 2026
751eb77
kvdb: add address iterator
yyforyongyu May 12, 2026
4b30a36
kvdb: add legacy test helpers for address tests
yyforyongyu May 16, 2026
833ad70
wallet: add internal addresstype bridge
yyforyongyu May 22, 2026
53f3eee
wallet: add address-store routing helpers
yyforyongyu May 22, 2026
6cffa22
kvdb: implement derived address creation
yyforyongyu May 22, 2026
b33a929
wallet: route NewAddress and GetUnusedAddress through store
yyforyongyu May 20, 2026
51f6f6f
kvdb: implement imported address creation
yyforyongyu May 16, 2026
1f158f6
wallet: route ImportPublicKey and ImportTaprootScript through store
yyforyongyu May 20, 2026
60b1663
wallet: trim derived-address mock matcher
yyforyongyu May 25, 2026
97415f9
kvdb: implement address lookup
yyforyongyu May 16, 2026
e4c6a3c
wallet: route GetAddressInfo and ScriptForOutput through store
yyforyongyu May 22, 2026
61d4489
wallet: add derivation-based privKey path for store addresses
yyforyongyu May 22, 2026
7a16176
kvdb: implement address listing
yyforyongyu May 16, 2026
346f877
wallet: route ListAddresses through store
yyforyongyu May 22, 2026
97229a1
wallet: route GetPrivKeyForAddress through store-derived path
yyforyongyu May 22, 2026
72553a8
wallet: add derived-address signer test helpers; tighten derivation g…
yyforyongyu May 26, 2026
a183790
bwtest/mock: add package skeleton
yyforyongyu May 26, 2026
1740576
bwtest/mock: add address store mocks
yyforyongyu May 26, 2026
96af895
bwtest/mock: add tx and address mocks
yyforyongyu May 26, 2026
a04ec6e
bwtest/mock: add chain mocks
yyforyongyu May 26, 2026
5afa67d
wallet/internal/bwtest: add mocks
yyforyongyu May 26, 2026
69f1480
kvdb: use shared address mocks
yyforyongyu May 26, 2026
2d8fb7d
wallet: use shared test mocks
yyforyongyu May 26, 2026
9cba5a2
wallet: use shared chain mock
yyforyongyu May 26, 2026
432bf19
wallet: prune lifted mock definitions
yyforyongyu May 26, 2026
62e0c30
wallet: delete chain mock client
yyforyongyu May 26, 2026
8842b15
db: hoist block↔stamp converters to block_common.go
yyforyongyu May 27, 2026
4d94e22
db: tighten account row generic constraints to int16|int64
yyforyongyu May 27, 2026
2dfdd70
db: expose effective AddrSchema on AccountInfo
yyforyongyu May 27, 2026
427b09a
kvdb: add package logger
yyforyongyu May 27, 2026
5c3f115
kvdb: implement GetWallet
yyforyongyu May 16, 2026
f5adcde
wallet: route GetWallet through store
yyforyongyu May 20, 2026
5cb6ca2
kvdb: implement UpdateWallet
yyforyongyu May 27, 2026
b8c3571
wallet: route UpdateWallet through store
yyforyongyu May 19, 2026
2483d68
db: simplify optional block conversion
yyforyongyu Jun 2, 2026
111f84f
wallet: extract CreateDerivedAccount shared workflow
GustavoStingelin Jun 3, 2026
a6fae43
wallet: extract CreateImportedAccount shared workflow
GustavoStingelin Jun 3, 2026
d2984bc
wallet: extract GetAccount shared workflow
GustavoStingelin Jun 3, 2026
1ae67a8
wallet: extract ListAccounts shared workflow
GustavoStingelin Jun 3, 2026
7c36fbd
wallet: extract RenameAccount shared workflow
GustavoStingelin Jun 3, 2026
8e26766
wallet: rename accounts_common to accountstore_common
GustavoStingelin Jun 3, 2026
189aa33
wallet: move CreateDerivedAccount across all backends
GustavoStingelin Jun 3, 2026
9b7f15c
wallet: move CreateImportedAccount across all backends
GustavoStingelin Jun 3, 2026
c9a9237
wallet: move GetAccount across all backends
GustavoStingelin Jun 3, 2026
4b8448b
wallet: move ListAccounts across all backends
GustavoStingelin Jun 3, 2026
385bbd4
wallet: move RenameAccount across all backends
GustavoStingelin Jun 3, 2026
fed6f29
wallet: rename shared account backend helpers
GustavoStingelin Jun 3, 2026
61c6d8c
wallet: split itest CreateAccount invariants tests
GustavoStingelin Jun 3, 2026
5ada550
wallet: split itest CreateDerivedAccount tests
GustavoStingelin Jun 3, 2026
e11727c
wallet: split itest CreateImportedAccount tests
GustavoStingelin Jun 3, 2026
75701e2
wallet: split itest GetAccount tests
GustavoStingelin Jun 3, 2026
50c7669
wallet: split itest ListAccounts tests
GustavoStingelin Jun 3, 2026
e0b111b
wallet: split itest RenameAccount tests
GustavoStingelin Jun 3, 2026
5cc0251
wallet: split itest account helpers
GustavoStingelin Jun 3, 2026
50075a9
wallet: extract EnsureKeyScope shared workflow
GustavoStingelin Jun 3, 2026
f374f33
wallet: move EnsureKeyScope across all backends
GustavoStingelin Jun 3, 2026
717a154
wallet: rename account_common to accountinfo
GustavoStingelin Jun 3, 2026
16caedb
wallet: readd create max account number itest
GustavoStingelin Jun 4, 2026
9706902
Makefile: pin sqlfluff docker image
GustavoStingelin Jun 4, 2026
0f16f27
wallet: plumb SQL account row IDs into AccountInfo
GustavoStingelin Jun 5, 2026
88b6266
wallet: add get account ops workflow
GustavoStingelin Jun 5, 2026
66c563e
wallet: implement get account ops adapters
GustavoStingelin Jun 5, 2026
fc6c90a
wallet: add list accounts ops workflow
GustavoStingelin Jun 5, 2026
3fe28b1
wallet: implement list accounts ops adapters
GustavoStingelin Jun 5, 2026
d05301d
wallet: add ensure key scope ops workflow
GustavoStingelin Jun 5, 2026
6442caa
wallet: implement ensure key scope ops adapters
GustavoStingelin Jun 5, 2026
f48fc89
wallet: add imported account ops workflow
GustavoStingelin Jun 5, 2026
b30733e
wallet: implement imported account ops adapters
GustavoStingelin Jun 5, 2026
15460af
wallet: add rename account ops workflow
GustavoStingelin Jun 5, 2026
7e20ac1
wallet: implement rename account ops adapters
GustavoStingelin Jun 5, 2026
723f6a5
docs/adr: add ADR 0012 wallet-level watch-only uniformity
yyforyongyu May 27, 2026
a41b1bc
db: add symmetric watch-only sentinels + helper for SQL backends
yyforyongyu May 27, 2026
ea11f13
db: add symmetric address sentinel + helper for SQL backends
yyforyongyu May 27, 2026
bdd69c3
db: enforce ADR 0012 invariant at imported-account/address create
yyforyongyu May 27, 2026
b761596
db+wallet: add Wallet.IsWatchOnly() and clean up per-row docstrings
yyforyongyu May 27, 2026
48d7411
wallet: validate WatchOnly + InitialAccounts upfront in Create
yyforyongyu May 27, 2026
c73d12f
db: reserve imported address account name
yyforyongyu Jun 5, 2026
2bbea77
db: auto-create imported address bucket
yyforyongyu Jun 5, 2026
ea28f03
db: update imported address bucket tests
yyforyongyu Jun 5, 2026
040f8f1
db/sql: add idempotent imported-bucket insert
yyforyongyu Jun 9, 2026
25d467a
db: materialize imported bucket idempotently
yyforyongyu Jun 9, 2026
f9118c3
db: reject renaming an account onto the reserved imported bucket
yyforyongyu Jun 10, 2026
9a8ada8
db/sql: enrich UTXO queries with account/address/scope columns
yyforyongyu May 28, 2026
8ff09c2
db: add UTXO enrichment fields + KeyScopeFromIDs helper
yyforyongyu Jun 10, 2026
18929eb
db: surface UTXO enrichment fields on UtxoInfo
yyforyongyu Jun 10, 2026
7f7d19f
db: test UTXO enrichment fields on ListUTXOs/GetUtxo
yyforyongyu Jun 10, 2026
0283a20
db/sql: add scoped AccountName filter to ListUtxos query
yyforyongyu May 28, 2026
d3013c7
db: add scoped AccountName filter to ListUtxosQuery
yyforyongyu May 28, 2026
5dd4af3
db: stop precreating imported UTXO account
yyforyongyu Jun 5, 2026
295fb65
kvdb: add UTXO enrichment helpers
yyforyongyu Jun 10, 2026
54dbfc6
kvdb: implement GetUtxo
yyforyongyu Jun 10, 2026
205bfd5
kvdb: test GetUtxo
yyforyongyu Jun 10, 2026
1d4b4da
kvdb: implement LeaseOutput
yyforyongyu Jun 1, 2026
7738c8b
kvdb: add ListUTXOs account-filter helpers
yyforyongyu Jun 10, 2026
62c4106
kvdb: implement ListUTXOs
yyforyongyu Jun 10, 2026
c05d919
kvdb: test ListUTXOs listing and enrichment
yyforyongyu Jun 10, 2026
eb259cf
kvdb: test ListUTXOs account filtering
yyforyongyu Jun 10, 2026
eacb51f
kvdb: implement ListLeasedOutputs
yyforyongyu Jun 1, 2026
8e3db4f
kvdb: align ReleaseOutput error mapping with db sentinels
yyforyongyu Jun 2, 2026
663e388
wallet: route GetUtxo through store
yyforyongyu Jun 1, 2026
21b99f6
wallet: route ListUnspent through store
yyforyongyu Jun 1, 2026
74f63cb
wallet: route LeaseOutput through store
yyforyongyu Jun 1, 2026
64e8363
wallet: route ListLeasedOutputs through store
yyforyongyu Jun 1, 2026
8a45f92
wallet: route address balances through store UTXOs
yyforyongyu Jun 1, 2026
8f7a3cd
wallet: add wallet-native UTXO error sentinels
yyforyongyu Jun 3, 2026
858d36e
wallet: move legacy change source helper to deprecated.go
yyforyongyu May 27, 2026
fb7fd4f
wallet: generify constantInputSource; add constantUtxoInputSource
yyforyongyu May 27, 2026
fcfe7e2
wallet: add createChangeSource helper
yyforyongyu May 27, 2026
45ab102
wallet/psbt: remove obsolete funding unit tests
yyforyongyu Jun 2, 2026
f405d4b
wallet: route change source through store
yyforyongyu Jun 2, 2026
97e3bc4
wallet: route tx inputs and coin selection through store
yyforyongyu Jun 10, 2026
a90ef50
wallet: add store-routed tx-creator coverage
yyforyongyu Jun 10, 2026
a1ec059
wallet: reject immature coinbase in selected utxo paths
yyforyongyu Jun 10, 2026
d0b7782
wallet: drop dead tx-creator test helpers
yyforyongyu May 27, 2026
4661fd8
wallet: add sub AGENTS.md
GustavoStingelin May 28, 2026
575ebde
AGENTS.md: redact considering the subagents
GustavoStingelin May 28, 2026
577fb9e
kvdb: add CreateTx credit helpers
yyforyongyu Jun 10, 2026
c08ebd2
kvdb: implement CreateTx
yyforyongyu Jun 10, 2026
a935481
kvdb: test CreateTx credit validation
yyforyongyu Jun 10, 2026
cbd4c3b
wallet: add tx publisher store matchers
yyforyongyu May 19, 2026
eafe702
wallet: detect wallet-output spends for sweep recording
yyforyongyu Jun 10, 2026
b6628a4
wallet: route tx recording and ownership filtering through store
yyforyongyu Jun 10, 2026
038d2dd
kvdb: implement InvalidateUnminedTx
yyforyongyu May 16, 2026
f3a27d0
wallet: route invalid tx cleanup through store
yyforyongyu May 19, 2026
115b96d
db: validate CreateTx credit address membership
yyforyongyu Jun 10, 2026
fc25cbe
db/sql: resolve CreateTx credit owners by address
yyforyongyu Jun 10, 2026
94d36f1
db/itest: cover CreateTx credit owner resolution
yyforyongyu Jun 10, 2026
94c0f70
db/sql: add batched address script query
yyforyongyu Jun 8, 2026
d283dc4
db: add owned address script resolver
yyforyongyu Jun 8, 2026
dda1fcc
db: expose owned address resolver
yyforyongyu Jun 8, 2026
b1dca8d
wallet: batch tx publisher owned address lookups
yyforyongyu Jun 10, 2026
35a2926
wallet: benchmark batched owned address filtering
yyforyongyu Jun 10, 2026
2469412
db: stop precreating bare multisig account
yyforyongyu Jun 5, 2026
d76de16
wallet: treat already-known/confirmed txs as a successful publish
yyforyongyu Jun 10, 2026
506e713
wallet: add PSBT store fixtures
yyforyongyu May 19, 2026
2d36def
wallet: route PSBT UTXO lookup through store
yyforyongyu May 19, 2026
dfea846
wallet: route PSBT lock checks through store
yyforyongyu May 19, 2026
91bccb7
wallet: route PSBT parent tx lookup through store
yyforyongyu May 19, 2026
daf039b
wallet: remove PSBT legacy credit helper
yyforyongyu May 19, 2026
f418150
docs: update keyvault ADR scoping to one wallet
GustavoStingelin Jun 11, 2026
91f413b
wallet: add lifecycle to keyvault interface
GustavoStingelin Jun 11, 2026
2cbb6ba
wallet: fix taproot PSBT derivation
yyforyongyu Jun 17, 2026
f0f133b
kvdb: return empty missing-scope accounts
yyforyongyu Jun 17, 2026
3eeea24
wallet: keep recovery same-block spends
yyforyongyu Jun 17, 2026
6b9c5b5
db: verify existing block metadata
yyforyongyu Jun 17, 2026
4e3de76
kvdb: report watch-only wallet state
yyforyongyu Jun 17, 2026
10c0f3c
db/sql: rewind rollback to stored block
yyforyongyu Jun 17, 2026
39d4ef7
wallet: reject nil account xpub
yyforyongyu Jun 17, 2026
47b7511
wallet: handle value coin sources
yyforyongyu Jun 17, 2026
90eaacc
wallet+db: complete btcd-v2 migration for sql-wallet rebase
yyforyongyu Jun 26, 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
  •  
  •  
  •  
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
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +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