status-go/account/onboarding_test.go
Andrea Franz dcb0fa5262
add multi-account support (#1500)
* add multiaccount support

add multi account ImportPrivateKey and StoreAccount

test derivation from normal keys

* add multiaccount to mobile pkg

* use multiaccount params structs from the mobile pkg

* move multiaccount tests together with the other lib tests

* fix codeclimate warning and temporarily increase methods threshold

* split library_test_utils.go to avoid linter warnings
2019-07-24 20:59:15 +02:00

31 lines
661 B
Go

package account
import (
"strings"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestOnboarding(t *testing.T) {
count := 2
wordsCount := 24
o, _ := NewOnboarding(count, wordsCount)
assert.Equal(t, count, len(o.accounts))
for id, a := range o.accounts {
words := strings.Split(a.mnemonic, " ")
assert.Equal(t, wordsCount, len(words))
assert.NotEmpty(t, a.Info.WalletAddress)
assert.NotEmpty(t, a.Info.WalletPubKey)
assert.NotEmpty(t, a.Info.ChatAddress)
assert.NotEmpty(t, a.Info.ChatPubKey)
retrieved, err := o.Account(id)
require.NoError(t, err)
assert.Equal(t, a, retrieved)
}
}