Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
d1826a6
frontend: refactor dialog to use state instead of refs for class togg…
thisconnect Sep 3, 2025
3b4edd7
android: fix ndk version
benma Sep 9, 2025
e62a627
ios: fix app flickers on start
shonsirsha Aug 18, 2025
fb2b495
Merge branch 'ios-add-launch-screen'
shonsirsha Sep 9, 2025
b12687a
Merge branch 'frontend-refactor-dialog'
thisconnect Sep 9, 2025
bc23dc6
ios/android: fix screen lock bugs
Beerosagos Sep 1, 2025
c691686
Merge branch 'screen-lock-fix'
Beerosagos Sep 9, 2025
e31674e
readme: update testing section
thisconnect Sep 9, 2025
812c235
readme: document how to do remote webengine debbuging on windows
thisconnect Sep 9, 2025
7ce3537
frontend: remove old unused mock file
thisconnect Sep 9, 2025
1751898
Merge branch 'ndk'
benma Sep 10, 2025
1030e4a
vendor: update bitbox02-api-go
benma Sep 10, 2025
4d5ff67
backend: remove account names from log to preserve privacy
strmci Sep 10, 2025
8e72446
Merge branch 'remove_account_names_log'
strmci Sep 10, 2025
e1c8182
Merge branch 'bb02-go'
benma Sep 10, 2025
3fb6f71
Merge branch 'frontend-cleanup'
thisconnect Sep 10, 2025
167ca41
frontend: fix btcdirect sell currencies
thisconnect Sep 12, 2025
452a642
Merge branch 'update-readme'
thisconnect Sep 12, 2025
248e718
Merge branch 'frontend-fix-btcdirect-currency'
thisconnect Sep 15, 2025
e96ba7b
backend: fix format for rootFingerprint in log
strmci Sep 15, 2025
e8b8b90
backend/frontend: add option to configure bitcoin gap limit
strmci Sep 15, 2025
b44ccda
Merge commit 'refs/pull/3555/head' of https://github.com/BitBoxSwiss/…
benma Sep 15, 2025
4939f1b
Merge branch 'add_gap_limit_setting'
strmci Sep 16, 2025
bc98b61
backend/aopp: fix potential panic on uninitialized accounts
benma Sep 15, 2025
c626593
Merge branch 'aopp'
benma Sep 16, 2025
6ef672b
frontend: refactor and simplify set-device-name popup in settings
thisconnect Sep 10, 2025
5d9e3de
frontend: refactor and simplify reset-device popup
thisconnect Sep 10, 2025
7071b3e
frontend: use dropdown component in feetargets
thisconnect Sep 9, 2025
b7b6bca
Merge branch 'frontend-remove-outdated-markup'
thisconnect Sep 16, 2025
654deac
frontend: send payment message to pocket widget
thisconnect Sep 10, 2025
a16d5e9
Merge branch 'frontend-use-react-select'
thisconnect Sep 16, 2025
8aae84c
Merge branch 'frontend-new-payment-messages'
thisconnect Sep 16, 2025
9af67fe
scripts: add util script to update bitbox02-api-go
benma Sep 16, 2025
424a21f
vendor: update bitbox02-api-go
benma Sep 16, 2025
ac4581d
backend: fetch multiple xpubs for unified btc accounts at once
benma Sep 15, 2025
3e1f6c3
android: automate creating and signing release builds
benma Sep 10, 2025
9b4f397
Merge branch 'xpubs'
benma Sep 17, 2025
c9b4882
Merge branch 'sign-android'
benma Sep 17, 2025
d5bb078
frontend: refactor dialog
thisconnect Sep 16, 2025
3773342
frontend: refactor focustrap into its own hook
thisconnect Sep 16, 2025
efe330c
frontend: fix drag click outside of the component
thisconnect Sep 16, 2025
de38013
Merge branch 'frontend-update-dialog'
thisconnect Sep 18, 2025
874c73e
maintenance: make BBApp able to talk to simulator.
bznein Sep 11, 2025
c1d4ce2
chore: upgrade bitbox02-api-go version.
bznein Sep 18, 2025
c476bae
Merge branch 'bbapp_simulator'
bznein Sep 22, 2025
8b46a93
ios: fix timezone
benma Sep 12, 2025
d58dda7
backend/btc: use PSBT as the internal format for passing unsigned tx
benma Feb 18, 2025
d94fcde
backend/btc: remove unused sameAccount in getAddressCallback
benma Sep 10, 2025
5f29479
backend/btc: remove SendingAccount
benma Sep 10, 2025
2ea4ded
backend/btc: move unused SignatureScript()
benma Sep 10, 2025
bda09e7
Merge branch 'timezone'
benma Sep 24, 2025
e5162c8
Merge branch 'psbt'
benma Sep 24, 2025
f4379ab
tests: add CI playwright integration and first test.
bznein Sep 16, 2025
7d540b4
Merge branch 'playwrightTest1'
bznein Sep 25, 2025
ccc462a
frontend: fix input element looses focus when typing
thisconnect Sep 29, 2025
dc1a215
chore: increase servewallet timeout.
bznein Sep 29, 2025
ffd7b86
Merge branch 'servewalletTimeout'
bznein Sep 29, 2025
0a0378a
Merge branch 'frontend-fix-focustrap-hook'
thisconnect Sep 29, 2025
636e169
frontend: use btcdirect address from payment-request
thisconnect Sep 24, 2025
c67675f
backend/btcdirect: remove hardcoded sell addresses
Beerosagos Sep 30, 2025
b4806ad
Merge branch 'btcdirect-address'
Beerosagos Sep 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Playwright Tests

on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
workflow_dispatch:

jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20

- name: Install dependencies
run: |
cd frontends/web
npm install

- name: Install Playwright browsers
run: |
cd frontends/web
npx playwright install --with-deps

- name: Run Playwright tests
run: make webe2etest

- name: Upload Playwright artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-artifacts
path: frontends/web/test-results/*
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,8 @@ tags
!/frontends/web/src/locales/sl/
!/frontends/web/src/locales/tr/
!/frontends/web/src/locales/zh/
!/frontends/web/src/locales/cs/
!/frontends/web/src/locales/cs/

# Playwright files
/frontends/web/playwright-report/
/frontends/web/test-results/
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ linters:
- predeclared
- tenv
- recvcheck
- godot
disable-all: false

issues:
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
- Allow up to 6 unused BTC/LTC accounts (previously 5)
- Add support for New Zealand Dollar (NZD)
- Fix empty suggested name for BTC account when only BTC is supported by the BitBox.
- iOS: add launch screen and smooth transition upon opening the app for the first time.
- Android: fix screen lock authentication loop bug
- Android/iOS: fix screen lock bug when no authentication is configured on the device
- Add expert setting to configure gap limit for bitcoin transaction discovery
- Fix potential crash in the AOPP workflow
- Windows: fix send/feetarget dropdown UI rendering bug
- More efficient account initialization by fetching all account Bitcoin xpubs at once
- iOS: fix wrong timezone when confirming time on BitBox02 (it would always show the time in UTC)

## v4.48.4
- macOS: fix potential USB communication issue with BitBox02 bootloaders <v1.1.2 and firmwares <v9.23.1
Expand Down
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ webtestwatch:
cd ${WEBROOT} && $(MAKE) jstest-watch
webserve:
cd ${WEBROOT} && $(MAKE) serve
webe2etest:
cd ${WEBROOT} && $(MAKE) test-e2e
qt-linux: # run inside dockerdev
$(MAKE) buildweb
cd frontends/qt && $(MAKE) linux
Expand All @@ -66,8 +68,10 @@ qt-windows:
$(MAKE) buildweb
cd frontends/qt && $(MAKE) windows
android:
$(MAKE) buildweb
cd frontends/android && ${MAKE} apk-debug
# Create signed .apk and .aab.
android-assemble-release:
cd frontends/android && ${MAKE} assemble-release
ios:
cd frontends/ios && ${MAKE} build
osx-sec-check:
Expand Down Expand Up @@ -98,3 +102,5 @@ locize-fix:
locize format ${WEBROOT}/src/locales --format json
go-vendor:
go mod vendor
update-bitbox02-api-go:
./scripts/update-bitbox02-api-go.sh
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,23 +92,16 @@ code in `frontends/web/src` are automatically detected and rebuilt.

#### UI testing

The tests are run using [jest](https://jestjs.io)
and [ts-jest](https://www.npmjs.com/package/ts-jest) preprocessor.

Because the app is based on [preact](https://preactjs.com),
we use [preact-render-spy](https://www.npmjs.com/package/preact-render-spy) package
instead of [enzyme](https://airbnb.io/enzyme/) to test app components rendering
and their state.
The frontend tests are run using [vitest](https://vitest.dev/) and [@testing-library/react](https://testing-library.com/).

To run all test suites, execute `make webtest`.
If you plan on spending a lot of time in `frontends/web/src` space
or just keen on doing TDD, use jest's tests watcher:

cd frontends/web/
make jstest-watch
#### E2E testing

Playwright is used to perform automatic test on some use cases on the webdev version.

To generate coverage report, execute `make jstest-cover` from `frontends/web` dir
and open `coverage/lcov-report/index.html` in a browser.
Tests are located under [`frontends/web/tests`](/frontends/web/tests) and can be run with
`make webe2etest`

#### Run the HTTP API

Expand Down Expand Up @@ -145,7 +138,14 @@ use a port_number of your choice, launch the following command and go to `http:/
QTWEBENGINE_REMOTE_DEBUGGING=<port_number> ./frontends/qt/build/osx/BitBox.app/Contents/MacOS/BitBox
```

see also https://doc.qt.io/qt-5/qtwebengine-debugging.html
Or on Windows using PowerShell

```
$env:QTWEBENGINE_REMOTE_DEBUGGING=<port_number>
Start-Process .\BitBox.exe
```

see also https://doc.qt.io/qt-6/qtwebengine-debugging.html

### CI

Expand Down
54 changes: 38 additions & 16 deletions backend/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"github.com/BitBoxSwiss/bitbox-wallet-app/backend/coins/btc"
"github.com/BitBoxSwiss/bitbox-wallet-app/backend/coins/btc/addresses"
"github.com/BitBoxSwiss/bitbox-wallet-app/backend/coins/btc/blockchain"
btctypes "github.com/BitBoxSwiss/bitbox-wallet-app/backend/coins/btc/types"
coinpkg "github.com/BitBoxSwiss/bitbox-wallet-app/backend/coins/coin"
"github.com/BitBoxSwiss/bitbox-wallet-app/backend/coins/eth"
"github.com/BitBoxSwiss/bitbox-wallet-app/backend/config"
Expand Down Expand Up @@ -1016,6 +1017,24 @@ outerLoop:
return ks, err
}

// gapLimits returns the gap limits to use, with arguments having priority over config settings.
func (backend *Backend) gapLimits() *btctypes.GapLimits {
gapLimits := backend.arguments.GapLimits()

if gapLimits == nil {
configReceive := uint16(backend.config.AppConfig().Backend.GapLimitReceive)
configChange := uint16(backend.config.AppConfig().Backend.GapLimitChange)
if configReceive > 0 && configChange > 0 {
gapLimits = &btctypes.GapLimits{
Receive: configReceive,
Change: configChange,
}
}
}

return gapLimits
}

// The accountsAndKeystoreLock must be held when calling this function.
func (backend *Backend) createAndAddAccount(coin coinpkg.Coin, persistedConfig *config.Account) {
if backend.accounts.lookup(persistedConfig.Code) != nil {
Expand Down Expand Up @@ -1044,14 +1063,14 @@ func (backend *Backend) createAndAddAccount(coin coinpkg.Coin, persistedConfig *

// This function is passed as a callback to the BTC account constructor. It is called when the
// keystore needs to determine whether an address belongs to an account on its same keystore.
getAddressCallback := func(askingAccount *btc.Account, scriptHashHex blockchain.ScriptHashHex) (*addresses.AccountAddress, bool, error) {
getAddressCallback := func(coinCode coinpkg.Code, scriptHashHex blockchain.ScriptHashHex) (*addresses.AccountAddress, error) {
accountsByKeystore, err := backend.AccountsByKeystore()
if err != nil {
return nil, false, err
return nil, err
}
rootFingerprint, err := backend.keystore.RootFingerprint()
if err != nil {
return nil, false, err
return nil, err
}
for _, account := range accountsByKeystore[hex.EncodeToString(rootFingerprint)] {
// This only makes sense for BTC accounts.
Expand All @@ -1060,22 +1079,22 @@ func (backend *Backend) createAndAddAccount(coin coinpkg.Coin, persistedConfig *
continue
}
// Only return an address if the coin codes match.
if btcAccount.Coin().Code() != askingAccount.Coin().Code() {
if btcAccount.Coin().Code() != coinCode {
continue
}
if address := btcAccount.GetAddress(scriptHashHex); address != nil {
return address, askingAccount == btcAccount, nil
return address, nil
}
}
return nil, false, nil
return nil, nil
}

switch specificCoin := coin.(type) {
case *btc.Coin:
account = backend.makeBtcAccount(
accountConfig,
specificCoin,
backend.arguments.GapLimits(),
backend.gapLimits(),
getAddressCallback,
backend.log,
)
Expand Down Expand Up @@ -1203,20 +1222,23 @@ func (backend *Backend) persistBTCAccountConfig(
accountWatch = &t
}

var signingConfigurations signing.Configurations
for _, cfg := range supportedConfigs {
extendedPublicKey, err := keystore.ExtendedPublicKey(coin, cfg.keypath)
if err != nil {
log.WithError(err).Errorf(
"Could not derive xpub at keypath %s", cfg.keypath.Encode())
return err
}
keypaths := make([]signing.AbsoluteKeypath, len(supportedConfigs))
for i, cfg := range supportedConfigs {
keypaths[i] = cfg.keypath
}
xpubs, err := keystore.BTCXPubs(coin, keypaths)
if err != nil {
log.WithError(err).Errorf("Could not derive xpubs at keypaths")
return err
}

var signingConfigurations signing.Configurations
for i, cfg := range supportedConfigs {
signingConfiguration := signing.NewBitcoinConfiguration(
cfg.scriptType,
rootFingerprint,
cfg.keypath,
extendedPublicKey,
xpubs[i],
)
signingConfigurations = append(signingConfigurations, signingConfiguration)
}
Expand Down
5 changes: 3 additions & 2 deletions backend/accounts/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ type Interface interface {
TxProposal(*TxProposalArgs) (coin.Amount, coin.Amount, coin.Amount, error)
// GetUnusedReceiveAddresses gets a list of list of receive addresses. The result can be one
// list of addresses, or if there are multiple types of addresses (e.g. `bc1...` vs `3...`), a
// list of lists.
GetUnusedReceiveAddresses() []AddressList
// list of lists. Returns `ErrSyncInProgress` if the account is not synced yet. Returns an error
// if the account is not initialized yet.
GetUnusedReceiveAddresses() ([]AddressList, error)
CanVerifyAddresses() (bool, bool, error)
VerifyAddress(addressID string) (bool, error)

Expand Down
6 changes: 3 additions & 3 deletions backend/accounts/mocks/account.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading