Skip to content
Snippets Groups Projects
Commit 7ce5e8cc authored by Richard T. Carback III's avatar Richard T. Carback III
Browse files

Fix parsing of E2E Params JSON when calling SendE2E in bindings

parent 05dbec16
No related branches found
No related tags found
2 merge requests!510Release,!353Figure out why bindings is not passing parameters correctly
......@@ -16,7 +16,6 @@ import (
"gitlab.com/elixxir/client/catalog"
"gitlab.com/elixxir/client/cmix/identity/receptionID"
"gitlab.com/elixxir/client/cmix/rounds"
"gitlab.com/elixxir/client/e2e"
"gitlab.com/elixxir/primitives/format"
"gitlab.com/xx_network/primitives/id"
)
......@@ -124,15 +123,15 @@ func (e *E2e) RemoveService(tag string) error {
// - []byte - the JSON marshalled bytes of the E2ESendReport object, which can
// be passed into Cmix.WaitForRoundResult to see if the send succeeded.
func (e *E2e) SendE2E(messageType int, recipientId, payload,
e2eParams []byte) ([]byte, error) {
// Note that specifically these are the Base params from xxdk.E2EParams
params := e2e.GetDefaultParams()
err := params.UnmarshalJSON(e2eParams)
e2eParamsJSON []byte) ([]byte, error) {
if len(e2eParamsJSON) == 0 {
jww.WARN.Printf("e2e params not specified, using defaults...")
e2eParamsJSON = GetDefaultE2EParams()
}
params, err := parseE2EParams(e2eParamsJSON)
if err != nil {
return nil, err
}
jww.DEBUG.Printf("SendE2E Parameters Received: %s, Parsed: %s",
e2eParams, params.String())
recipient, err := id.Unmarshal(recipientId)
if err != nil {
......@@ -140,7 +139,8 @@ func (e *E2e) SendE2E(messageType int, recipientId, payload,
}
sendReport, err := e.api.GetE2E().SendE2E(
catalog.MessageType(messageType), recipient, payload, params)
catalog.MessageType(messageType), recipient, payload,
params.Base)
if err != nil {
return nil, 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