Skip to content
Snippets Groups Projects
Commit d66e7529 authored by Jake Taylor's avatar Jake Taylor :lips:
Browse files

Merge branch 'hotfix/factListJson' into 'release'

Use json fact list instead of stringified for e2eAuth request

See merge request !293
parents 9068bb70 421ffea7
No related branches found
No related tags found
2 merge requests!510Release,!293Use json fact list instead of stringified for e2eAuth request
......@@ -8,6 +8,7 @@
package bindings
import (
"encoding/json"
"gitlab.com/elixxir/client/xxdk"
"gitlab.com/elixxir/crypto/contact"
"gitlab.com/elixxir/primitives/fact"
......@@ -38,17 +39,26 @@ import (
//
// Returns:
// - int64 - ID of the round (convert to uint64)
func (e *E2e) Request(partnerContact []byte, myFactsString string) (int64, error) {
partner, err := contact.Unmarshal(partnerContact)
func (e *E2e) Request(partnerContact, factsListJson []byte) (int64, error) {
var factsList []Fact
err := json.Unmarshal(factsListJson, &factsList)
if err != nil {
return 0, err
}
myFacts, _, err := fact.UnstringifyFactList(myFactsString)
partner, err := contact.Unmarshal(partnerContact)
if err != nil {
return 0, err
}
myFacts := fact.FactList{}
for _, f := range factsList {
myFacts = append(myFacts, fact.Fact{
Fact: f.Fact,
T: fact.FactType(f.Type),
})
}
roundID, err := e.api.GetAuth().Request(partner, myFacts)
return int64(roundID), err
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment