key_test.go 429 B

1234567891011121314151617181920212223242526
  1. package key
  2. import (
  3. "key-manager/hd"
  4. "testing"
  5. )
  6. func TestNewAccount(t *testing.T) {
  7. mnemonic, err := GenerateMnemonic(hd.Mnemonic12)
  8. if err != nil {
  9. t.Fatal(err)
  10. }
  11. t.Log(mnemonic)
  12. account, err := NewEthAccount(mnemonic, 0)
  13. if err != nil {
  14. t.Fatal(err)
  15. }
  16. t.Log(account.Address.String())
  17. tronAccount, err := NewTronAccount(mnemonic, 0)
  18. if err != nil {
  19. t.Fatal(err)
  20. }
  21. t.Log(tronAccount.Address.String())
  22. }