Commit 0049c1ca authored by jiangpeng's avatar jiangpeng Committed by vipwzw

adapt with chain33 crypto

parent 63d102c0
......@@ -272,7 +272,7 @@ func (b *blsClient) checkCommitTx(txs []*types.Transaction) ([]*pt.ParacrossComm
var commits []*pt.ParacrossCommitAction
for _, tx := range txs {
//验签
if !tx.CheckSign() {
if !tx.CheckSign(b.paraClient.GetCurrentHeight()) {
return nil, errors.Wrapf(types.ErrSign, "hash=%s", common.ToHex(tx.Hash()))
}
var act pt.ParacrossAction
......
......@@ -309,5 +309,5 @@ const Name = "bls"
const ID = 259
func init() {
crypto.Register(Name, &Driver{}, crypto.WithOptionTypeID(ID))
crypto.Register(Name, &Driver{}, crypto.WithRegOptionTypeID(ID))
}
......@@ -125,7 +125,7 @@ func TestChckSign(t *testing.T) {
}
cfg.SetMinFee(0)
assert.Equal(t, true, tx1.CheckSign())
assert.Equal(t, true, tx1.CheckSign(0))
}
/**
......@@ -140,7 +140,7 @@ func TestChckSigns(t *testing.T) {
cfg.SetMinFee(0)
for i, tx := range txs {
if !tx.CheckSign() {
if !tx.CheckSign(0) {
t.Error(fmt.Sprintf("error check tx[%d]", i+1))
return
}
......@@ -178,7 +178,7 @@ func TestChckSignWithNoneAuth(t *testing.T) {
cfg.SetMinFee(0)
tx14.Sign(types.SECP256K1, privKey)
if !tx14.CheckSign() {
if !tx14.CheckSign(0) {
t.Error("check signature failed")
return
}
......@@ -203,7 +203,7 @@ func TestChckSignWithSm2(t *testing.T) {
cfg.SetMinFee(0)
tx15.Sign(ct.AuthSM2, privKeysm2)
if !tx15.CheckSign() {
if !tx15.CheckSign(0) {
t.Error("check signature failed")
return
}
......@@ -227,7 +227,7 @@ func TestChckSignWithEcdsa(t *testing.T) {
cfg.SetMinFee(0)
tx16.Sign(ct.AuthECDSA, privKeyecdsa)
if !tx16.CheckSign() {
if !tx16.CheckSign(0) {
t.Error("check signature failed")
return
}
......
......@@ -21,7 +21,7 @@ import (
)
func init() {
crypto.Register(privacytypes.SignNameRing, &RingSignED25519{}, crypto.WithOptionTypeID(privacytypes.RingBaseonED25519))
crypto.Register(privacytypes.SignNameRing, &RingSignED25519{}, crypto.WithRegOptionTypeID(privacytypes.RingBaseonED25519))
}
// RingSignature 环签名中对于crypto.Signature接口实现
......
......@@ -166,7 +166,7 @@ func checkTxSignBySpecificAddr(tx *types.Transaction, addrs []string) error {
return x2eTy.ErrInvalidAdminAddress
}
if !tx.CheckSign() {
if !tx.CheckSign(0) {
return types.ErrSign
}
return nil
......
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