mirror of
https://github.com/status-im/status-go.git
synced 2025-01-09 14:16:21 +00:00
d65946e9c0
There was an issue in using the `Wallet` flag when checking accounts to watch for transactions. `Wallet` indicates that it's the default wallet, not whether is a wallet account. That can only be checked by looking at the type (and the `Wallet` flag). If the type is `generated`, `key` or `seed` it should be watched for transactions.
36 lines
626 B
Go
36 lines
626 B
Go
package accounts
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestIsOwnAccount(t *testing.T) {
|
|
account := Account{Wallet: true}
|
|
require.True(t, account.IsOwnAccount())
|
|
|
|
account = Account{
|
|
Type: accountTypeGenerated,
|
|
}
|
|
require.True(t, account.IsOwnAccount())
|
|
|
|
account = Account{
|
|
Type: accountTypeKey,
|
|
}
|
|
require.True(t, account.IsOwnAccount())
|
|
|
|
account = Account{
|
|
Type: accountTypeSeed,
|
|
}
|
|
require.True(t, account.IsOwnAccount())
|
|
|
|
account = Account{
|
|
Type: accountTypeWatch,
|
|
}
|
|
require.False(t, account.IsOwnAccount())
|
|
|
|
account = Account{}
|
|
require.False(t, account.IsOwnAccount())
|
|
}
|