Skip to content
Snippets Groups Projects
Commit ee25dacf authored by Jonah Husson's avatar Jonah Husson
Browse files

Fix use of older idfs

parent aa18a613
No related branches found
No related tags found
1 merge request!5validate contract
...@@ -24,6 +24,7 @@ import ( ...@@ -24,6 +24,7 @@ import (
jww "github.com/spf13/jwalterweatherman" jww "github.com/spf13/jwalterweatherman"
"github.com/xx-labs/sleeve/wallet" "github.com/xx-labs/sleeve/wallet"
"gitlab.com/xx_network/crypto/signature/rsa" "gitlab.com/xx_network/crypto/signature/rsa"
"gitlab.com/xx_network/primitives/id"
"gitlab.com/xx_network/primitives/id/idf" "gitlab.com/xx_network/primitives/id/idf"
"net/http" "net/http"
"testing" "testing"
...@@ -133,6 +134,17 @@ func (i *Impl) Verify(_ context.Context, msg messages.Commitment) error { ...@@ -133,6 +134,17 @@ func (i *Impl) Verify(_ context.Context, msg messages.Commitment) error {
return err return err
} }
if idfStruct.HexNodeID == "" {
nid, err := id.Unmarshal(idfStruct.IdBytes[:])
if err != nil {
err = errors.WithMessage(err, "Failed to unmarshal ID")
jww.ERROR.Println(err)
return err
}
idfStruct.HexNodeID = nid.HexEncode()
}
// Get member info from database // Get member info from database
hexId := "\\" + idfStruct.HexNodeID[1:] hexId := "\\" + idfStruct.HexNodeID[1:]
m, err := i.s.GetMember(hexId) m, err := i.s.GetMember(hexId)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment