Fix signature verify address issue

This commit is contained in:
ChronosX88 2020-12-02 18:24:48 +04:00
parent 5a94f6d67a
commit 56b8f311f3
Signed by: ChronosXYZ
GPG Key ID: 085A69A82C8C511A
2 changed files with 4 additions and 2 deletions

View File

@ -4,6 +4,8 @@ import (
"bytes"
"fmt"
rtypes "github.com/Secured-Finance/dione/rpc/types"
ftypes "github.com/Secured-Finance/dione/rpc/filecoin/types"
oracleEmitter "github.com/Secured-Finance/dione/contracts/oracleemitter"
@ -166,7 +168,7 @@ func (ppp *PrePreparePool) IsValidPrePrepare(prePrepare *types2.Message) bool {
//////////////////////////////////////
// === 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
if err := msg.UnmarshalCBOR(bytes.NewReader(consensusMsg.Task.Payload)); err != nil {
if err := msg.Message.UnmarshalCBOR(bytes.NewReader(consensusMsg.Task.Payload)); err != nil {

View File

@ -16,7 +16,7 @@ func verifyTaskSignature(msg types.ConsensusMessage) error {
}
err = sigs.Verify(
&types2.Signature{Type: types2.SigTypeEd25519, Data: msg.Signature},
[]byte(msg.Task.Miner.String()),
[]byte(msg.Task.Miner),
[]byte(fmt.Sprintf("%v", cHash)),
)
if err != nil {