Commit b834c03c authored by suyanlong's avatar suyanlong

Fixed bug and update dep

parent 97649fce
......@@ -195,4 +195,5 @@ require (
)
replace github.com/libp2p/go-libp2p-core => github.com/libp2p/go-libp2p-core v0.5.6
replace github.com/meshplus/bitxhub-kit => github.com/suyanlong/bitxhub-kit v1.2.1-0.20211118095742-332b6c4e4b9f
replace github.com/meshplus/bitxhub-kit => github.com/suyanlong/bitxhub-kit v1.2.1-0.20211119060656-70eb89a9b03d
......@@ -927,8 +927,8 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/suyanlong/bitxhub-kit v1.2.1-0.20211118095742-332b6c4e4b9f h1:X8yS+C9VjzzrPUwoxagOebfZl6kRI/+GRw8k4jVfyeo=
github.com/suyanlong/bitxhub-kit v1.2.1-0.20211118095742-332b6c4e4b9f/go.mod h1:yp/KN421RU3uYvn7PVQj/ru+CsnJkN6PfE2g4d9YDVQ=
github.com/suyanlong/bitxhub-kit v1.2.1-0.20211119060656-70eb89a9b03d h1:ZZ7t5/MPISe2FdnUbIqlafbhSe0mPUktN0o2g7duwq8=
github.com/suyanlong/bitxhub-kit v1.2.1-0.20211119060656-70eb89a9b03d/go.mod h1:yp/KN421RU3uYvn7PVQj/ru+CsnJkN6PfE2g4d9YDVQ=
github.com/sykesm/zap-logfmt v0.0.3 h1:3Wrhf7+I9JEUD8B6KPtDAr9j2jrS0/EPLy7GCE1t/+U=
github.com/sykesm/zap-logfmt v0.0.3/go.mod h1:AuBd9xQjAe3URrWT1BBDk2v2onAZHkZkWRMiYZXiZWA=
github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ=
......
......@@ -11,6 +11,12 @@ import (
)
func init() {
if err := bls.Init(bls.BLS12_381); err != nil {
panic(err)
}
if err := bls.SetETHmode(bls.EthModeDraft07); err != nil {
panic(err)
}
asym.RegisterCrypto1(
BlsEth,
"BlsEth",
......
......@@ -387,3 +387,14 @@ func TestZero(t *testing.T) {
t.Fatal("sig is not zero")
}
}
func TestAddress(t *testing.T) {
pk := PublicKey{
curve: BlsEth,
PublicKey: &bls.PublicKey{},
}
address, err := pk.Address()
assert.Nil(t, err)
assert.NotNil(t, address)
t.Log(address)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment