2020-12-07 15:03:18 +01:00
|
|
|
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{
|
2022-05-18 13:42:51 +03:00
|
|
|
Type: AccountTypeWatch,
|
2020-12-07 15:03:18 +01:00
|
|
|
}
|
|
|
|
require.False(t, account.IsOwnAccount())
|
|
|
|
|
|
|
|
account = Account{}
|
|
|
|
require.False(t, account.IsOwnAccount())
|
|
|
|
}
|