Fix signature verify address issue
This commit is contained in:
parent
5a94f6d67a
commit
56b8f311f3
@ -4,6 +4,8 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
rtypes "github.com/Secured-Finance/dione/rpc/types"
|
||||||
|
|
||||||
ftypes "github.com/Secured-Finance/dione/rpc/filecoin/types"
|
ftypes "github.com/Secured-Finance/dione/rpc/filecoin/types"
|
||||||
|
|
||||||
oracleEmitter "github.com/Secured-Finance/dione/contracts/oracleemitter"
|
oracleEmitter "github.com/Secured-Finance/dione/contracts/oracleemitter"
|
||||||
@ -166,7 +168,7 @@ func (ppp *PrePreparePool) IsValidPrePrepare(prePrepare *types2.Message) bool {
|
|||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
|
|
||||||
// === verify filecoin message signature ===
|
// === verify filecoin message signature ===
|
||||||
if consensusMsg.Task.RequestType == "GetTransaction" && consensusMsg.Task.OriginChain == 1 {
|
if consensusMsg.Task.OriginChain == rtypes.RPCTypeFilecoin && consensusMsg.Task.RequestType == "getTransaction" {
|
||||||
var msg ftypes.SignedMessage
|
var msg ftypes.SignedMessage
|
||||||
if err := msg.UnmarshalCBOR(bytes.NewReader(consensusMsg.Task.Payload)); err != nil {
|
if err := msg.UnmarshalCBOR(bytes.NewReader(consensusMsg.Task.Payload)); err != nil {
|
||||||
if err := msg.Message.UnmarshalCBOR(bytes.NewReader(consensusMsg.Task.Payload)); err != nil {
|
if err := msg.Message.UnmarshalCBOR(bytes.NewReader(consensusMsg.Task.Payload)); err != nil {
|
||||||
|
@ -16,7 +16,7 @@ func verifyTaskSignature(msg types.ConsensusMessage) error {
|
|||||||
}
|
}
|
||||||
err = sigs.Verify(
|
err = sigs.Verify(
|
||||||
&types2.Signature{Type: types2.SigTypeEd25519, Data: msg.Signature},
|
&types2.Signature{Type: types2.SigTypeEd25519, Data: msg.Signature},
|
||||||
[]byte(msg.Task.Miner.String()),
|
[]byte(msg.Task.Miner),
|
||||||
[]byte(fmt.Sprintf("%v", cHash)),
|
[]byte(fmt.Sprintf("%v", cHash)),
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user