Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
785 commits
Select commit Hold shift + click to select a range
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
f0e1d87
wallet: refactor wallet db to ops interface
GustavoStingelin May 20, 2026
95b49bc
wallet: add wallet db ops interface unit tests
GustavoStingelin May 20, 2026
c4ae704
wallet: add get wallet secrets to store
GustavoStingelin May 21, 2026
f97fec7
wallet: remove underline from wallet test names
GustavoStingelin May 21, 2026
14531b2
wallet: use type walletInfoRow interface for common structs
GustavoStingelin May 22, 2026
985420e
wallet: split wallet store implementations to specific files
GustavoStingelin May 22, 2026
019d227
wallet: split wallet db implementations to specific files
GustavoStingelin May 22, 2026
8894cbd
wallet: split wallet store itests to specific files
GustavoStingelin May 25, 2026
29c3941
wallet: split wallet store unit tests to specific files
GustavoStingelin May 25, 2026
2f53265
wallet: distinguish missing wallet secrets from missing wallet
GustavoStingelin May 25, 2026
c4e2e90
docs: add ADR 0011 (no addresses.used column)
yyforyongyu May 20, 2026
8f758dd
waddrmgr: export taproot script codec
yyforyongyu May 11, 2026
cbf1f55
waddrmgr: export `ManagedPubKeyAddressHasPrivateKey`
yyforyongyu May 16, 2026
18c3443
db: add HasScript field + IsWatchOnly helper to imported address params
yyforyongyu May 20, 2026
c448962
db: add SQL helpers for derived-address adapter rows
yyforyongyu May 26, 2026
0d7fa3b
db: thread per-account addrSchema and PubKey through address derivation
yyforyongyu May 26, 2026
d3ee08b
db: add account-metadata fields + helpers on AddressInfo
yyforyongyu May 20, 2026
537f76e
db: select account metadata columns in address read queries
yyforyongyu May 20, 2026
ae15c3b
db: wire pg/sqlite address adapters through ApplyAddressAccountMetadata
yyforyongyu May 20, 2026
23f3086
db: add IsUsed to AddressInfo + AddressInfoRow
yyforyongyu May 20, 2026
2f3f0ad
db: derive IsUsed from utxos via EXISTS on SQL
yyforyongyu May 22, 2026
7da3106
db: move derived-address types to data_types.go
yyforyongyu May 27, 2026
e91a476
kvdb: add address type metadata
yyforyongyu May 12, 2026
deb0436
kvdb: add address iterator
yyforyongyu May 12, 2026
de0836a
kvdb: add legacy test helpers for address tests
yyforyongyu May 16, 2026
3aca579
wallet: add internal addresstype bridge
yyforyongyu May 22, 2026
4699c09
wallet: add address-store routing helpers
yyforyongyu May 22, 2026
fd19d48
kvdb: implement derived address creation
yyforyongyu May 22, 2026
b3d102b
wallet: route NewAddress and GetUnusedAddress through store
yyforyongyu May 20, 2026
f5ef0c2
kvdb: implement imported address creation
yyforyongyu May 16, 2026
761cfda
wallet: route ImportPublicKey and ImportTaprootScript through store
yyforyongyu May 20, 2026
d95c32b
wallet: trim derived-address mock matcher
yyforyongyu May 25, 2026
f94b3f3
kvdb: implement address lookup
yyforyongyu May 16, 2026
a05a9f4
wallet: route GetAddressInfo and ScriptForOutput through store
yyforyongyu May 22, 2026
0ffefb0
wallet: add derivation-based privKey path for store addresses
yyforyongyu May 22, 2026
c6d0e03
kvdb: implement address listing
yyforyongyu May 16, 2026
3027864
wallet: route ListAddresses through store
yyforyongyu May 22, 2026
ac2e6e0
wallet: route GetPrivKeyForAddress through store-derived path
yyforyongyu May 22, 2026
aeb557f
wallet: add derived-address signer test helpers; tighten derivation g…
yyforyongyu May 26, 2026
107d5f7
bwtest/mock: add package skeleton
yyforyongyu May 26, 2026
9819687
bwtest/mock: add address store mocks
yyforyongyu May 26, 2026
81d4c97
bwtest/mock: add tx and address mocks
yyforyongyu May 26, 2026
71bdc41
bwtest/mock: add chain mocks
yyforyongyu May 26, 2026
9d3ad9f
wallet/internal/bwtest: add mocks
yyforyongyu May 26, 2026
63a440d
kvdb: use shared address mocks
yyforyongyu May 26, 2026
63cc917
wallet: use shared test mocks
yyforyongyu May 26, 2026
1f8b6ba
wallet: use shared chain mock
yyforyongyu May 26, 2026
502e5cd
wallet: prune lifted mock definitions
yyforyongyu May 26, 2026
2b1f498
wallet: delete chain mock client
yyforyongyu May 26, 2026
62e3af5
db: hoist block↔stamp converters to block_common.go
yyforyongyu May 27, 2026
d8a00e3
db: tighten account row generic constraints to int16|int64
yyforyongyu May 27, 2026
c8c9fea
db: expose effective AddrSchema on AccountInfo
yyforyongyu May 27, 2026
349f50c
kvdb: add package logger
yyforyongyu May 27, 2026
c3dfc1f
kvdb: implement GetWallet
yyforyongyu May 16, 2026
58e2578
wallet: route GetWallet through store
yyforyongyu May 20, 2026
6f69649
kvdb: implement UpdateWallet
yyforyongyu May 27, 2026
d51cd57
wallet: route UpdateWallet through store
yyforyongyu May 19, 2026
3af7480
db: simplify optional block conversion
yyforyongyu Jun 2, 2026
ad7e8b6
wallet: extract CreateDerivedAccount shared workflow
GustavoStingelin Jun 3, 2026
04cd7e9
wallet: extract CreateImportedAccount shared workflow
GustavoStingelin Jun 3, 2026
47b7234
wallet: extract GetAccount shared workflow
GustavoStingelin Jun 3, 2026
543403e
wallet: extract ListAccounts shared workflow
GustavoStingelin Jun 3, 2026
5edee0b
wallet: extract RenameAccount shared workflow
GustavoStingelin Jun 3, 2026
8ab0af6
wallet: rename accounts_common to accountstore_common
GustavoStingelin Jun 3, 2026
ef33ace
wallet: move CreateDerivedAccount across all backends
GustavoStingelin Jun 3, 2026
23bbdcf
wallet: move CreateImportedAccount across all backends
GustavoStingelin Jun 3, 2026
153c8d8
wallet: move GetAccount across all backends
GustavoStingelin Jun 3, 2026
4c14465
wallet: move ListAccounts across all backends
GustavoStingelin Jun 3, 2026
e306142
wallet: move RenameAccount across all backends
GustavoStingelin Jun 3, 2026
231916f
wallet: rename shared account backend helpers
GustavoStingelin Jun 3, 2026
2beda78
wallet: split itest CreateAccount invariants tests
GustavoStingelin Jun 3, 2026
1b92e44
wallet: split itest CreateDerivedAccount tests
GustavoStingelin Jun 3, 2026
f00a825
wallet: split itest CreateImportedAccount tests
GustavoStingelin Jun 3, 2026
9794b22
wallet: split itest GetAccount tests
GustavoStingelin Jun 3, 2026
a4c7676
wallet: split itest ListAccounts tests
GustavoStingelin Jun 3, 2026
ce72f11
wallet: split itest RenameAccount tests
GustavoStingelin Jun 3, 2026
a10c0f4
wallet: split itest account helpers
GustavoStingelin Jun 3, 2026
a3ae7f5
wallet: extract EnsureKeyScope shared workflow
GustavoStingelin Jun 3, 2026
0c475e9
wallet: move EnsureKeyScope across all backends
GustavoStingelin Jun 3, 2026
d4bcd4f
wallet: rename account_common to accountinfo
GustavoStingelin Jun 3, 2026
06a4bfb
wallet: readd create max account number itest
GustavoStingelin Jun 4, 2026
cadef59
Makefile: pin sqlfluff docker image
GustavoStingelin Jun 4, 2026
281d402
wallet: plumb SQL account row IDs into AccountInfo
GustavoStingelin Jun 5, 2026
5cd127b
wallet: add get account ops workflow
GustavoStingelin Jun 5, 2026
84cf8ec
wallet: implement get account ops adapters
GustavoStingelin Jun 5, 2026
58487cf
wallet: add list accounts ops workflow
GustavoStingelin Jun 5, 2026
375c09b
wallet: implement list accounts ops adapters
GustavoStingelin Jun 5, 2026
f52cc13
wallet: add ensure key scope ops workflow
GustavoStingelin Jun 5, 2026
d67cd4e
wallet: implement ensure key scope ops adapters
GustavoStingelin Jun 5, 2026
1701d76
wallet: add imported account ops workflow
GustavoStingelin Jun 5, 2026
c5e8615
wallet: implement imported account ops adapters
GustavoStingelin Jun 5, 2026
cdac90b
wallet: add rename account ops workflow
GustavoStingelin Jun 5, 2026
6c09fa3
wallet: implement rename account ops adapters
GustavoStingelin Jun 5, 2026
7c879bd
db: add account secret lookup contract
yyforyongyu May 27, 2026
8f40c97
wallet: expose store account secrets through cache
yyforyongyu May 27, 2026
b0f6271
wallet: derive SQL-only private keys via keyVault
yyforyongyu May 27, 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
  •  
  •  
  •  
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