Commit ac94fe0f authored by jiangpeng's avatar jiangpeng

udpate chain33 crypto register

parent 4b5cd0a0
...@@ -223,7 +223,7 @@ const Name = "auth_ecdsa" ...@@ -223,7 +223,7 @@ const Name = "auth_ecdsa"
const ID = 257 const ID = 257
func init() { func init() {
crypto.Register(Name, &Driver{}) crypto.Register(Name, &Driver{}, false)
crypto.RegisterType(Name, ID) crypto.RegisterType(Name, ID)
} }
......
...@@ -17,6 +17,6 @@ const name = "auth_sm2" ...@@ -17,6 +17,6 @@ const name = "auth_sm2"
const id = 258 const id = 258
func init() { func init() {
crypto.Register(name, &sm2Driver{}) crypto.Register(name, &sm2Driver{}, false)
crypto.RegisterType(name, id) crypto.RegisterType(name, id)
} }
...@@ -16,7 +16,7 @@ import ( ...@@ -16,7 +16,7 @@ import (
type oneTimeEd25519 struct{} type oneTimeEd25519 struct{}
func init() { func init() {
crypto.Register(privacytypes.SignNameOnetimeED25519, &oneTimeEd25519{}) crypto.Register(privacytypes.SignNameOnetimeED25519, &oneTimeEd25519{}, false)
} }
func (onetime *oneTimeEd25519) GenKey() (crypto.PrivKey, error) { func (onetime *oneTimeEd25519) GenKey() (crypto.PrivKey, error) {
......
...@@ -21,7 +21,7 @@ import ( ...@@ -21,7 +21,7 @@ import (
) )
func init() { func init() {
crypto.Register(privacytypes.SignNameRing, &RingSignED25519{}) crypto.Register(privacytypes.SignNameRing, &RingSignED25519{}, false)
crypto.RegisterType(privacytypes.SignNameRing, privacytypes.RingBaseonED25519) crypto.RegisterType(privacytypes.SignNameRing, privacytypes.RingBaseonED25519)
} }
......
...@@ -149,11 +149,11 @@ func (mock *testDataMock) importPrivateKey(PrivKey *types.ReqWalletImportPrivkey ...@@ -149,11 +149,11 @@ func (mock *testDataMock) importPrivateKey(PrivKey *types.ReqWalletImportPrivkey
return return
} }
pub, err := bipwallet.PrivkeyToPub(cointype, privkeybyte) pub, err := bipwallet.PrivkeyToPub(cointype, uint32(signType), privkeybyte)
if err != nil { if err != nil {
return return
} }
addr, err := bipwallet.PubToAddress(cointype, pub) addr, err := bipwallet.PubToAddress(pub)
if err != nil { if err != nil {
return return
} }
......
...@@ -278,3 +278,8 @@ func (_m *walletOperateMock) WaitTx(hash []byte) *types.TransactionDetail { ...@@ -278,3 +278,8 @@ func (_m *walletOperateMock) WaitTx(hash []byte) *types.TransactionDetail {
func (_m *walletOperateMock) WaitTxs(hashes [][]byte) []*types.TransactionDetail { func (_m *walletOperateMock) WaitTxs(hashes [][]byte) []*types.TransactionDetail {
return nil return nil
} }
// GetCoinType provides a mock function with given fields:
func (_m *walletOperateMock) GetCoinType() uint32 {
return 0
}
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