OSDN Git Service

new repo
[bytom/vapor.git] / vendor / github.com / tendermint / go-crypto / hd / address_test.go
1 package hd
2
3 /*
4
5 import (
6         "encoding/hex"
7         "fmt"
8         "testing"
9 )
10
11 func TestManual(t *testing.T) {
12         bytes, _ := hex.DecodeString("dfac699f1618c9be4df2befe94dc5f313946ebafa386756bd4926a1ecfd7cf2438426ede521d1ee6512391bc200b7910bcbea593e68d52b874c29bdc5a308ed1")
13         fmt.Println(bytes)
14         puk, prk, ch, se := ComputeMastersFromSeed(string(bytes))
15         fmt.Println(puk, ch, se)
16
17         pubBytes2 := DerivePublicKeyForPath(
18                 HexDecode(puk),
19                 HexDecode(ch),
20                 //"44'/118'/0'/0/0",
21                 "0/0",
22         )
23         fmt.Printf("PUB2 %X\n", pubBytes2)
24
25         privBytes := DerivePrivateKeyForPath(
26                 HexDecode(prk),
27                 HexDecode(ch),
28                 //"44'/118'/0'/0/0",
29                 //"0/0",
30                 "44'/118'/0'/0/0",
31         )
32         fmt.Printf("PRIV %X\n", privBytes)
33         pubBytes := PubKeyBytesFromPrivKeyBytes(privBytes, true)
34         fmt.Printf("PUB  %X\n", pubBytes)
35 }
36
37 */