first commit

This commit is contained in:
2022-03-17 15:59:24 +08:00
commit 2b0debb847
592 changed files with 73946 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
package address
import (
"encoding/hex"
"testing"
)
func Test_Encoding(t *testing.T) {
in, err := hex.DecodeString("02cec0b297406fc5298e9fe829c9f6f96fa176a1bd1a7c55fa0d345a6f49b09d25")
if err != nil {
t.Error(err)
return
}
addr := PublicKeyToAddress(NormalVer, in)
t.Log(addr)
if err := CheckAddress(NormalVer, addr); err != nil {
t.Error(err)
return
}
t.Log("check success")
}
func Test_CheckAddress(t *testing.T) {
addr := "1JoFzozbxvst22c2K7MBYwQGjCaMZbC5Qm"
if err := CheckAddress(NormalVer, addr); err != nil {
t.Error(err)
return
}
t.Log("check success")
}