Skip to content

Commit

Permalink
Fix sessionId type for Fulfillment message in dac module (#69)
Browse files Browse the repository at this point in the history
* Fix sessionId type for Fulfillment message in dac module
  • Loading branch information
idmitriev authored Oct 4, 2023
1 parent eb06f81 commit 18f9a99
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions dac/pkg/collection_point.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package dac
import (
"bytes"
"context"
"encoding/base64"
"encoding/json"
"fmt"
"github.com/cerebellum-network/cere-ddc-sdk-go/core/pkg/crypto"
Expand All @@ -25,7 +24,7 @@ type (
}

Fulfillment struct {
SessionId []byte `json:"sessionId"`
SessionId string `json:"sessionId"`
RequestId string `json:"requestId"`
Cid string `json:"cid"`
OpCode uint8 `json:"opCode"`
Expand Down Expand Up @@ -81,7 +80,7 @@ func (d dacCollectionPoint) SaveFulfillment(fulfillment Fulfillment) error {
}

func SignFulfillment(fulfillment *Fulfillment, scheme crypto.Scheme) error {
signature, err := scheme.Sign([]byte(fulfillment.Cid + base64.StdEncoding.EncodeToString(fulfillment.SessionId) + fulfillment.RequestId + strconv.FormatUint(fulfillment.FulfilledTimestamp, 10)))
signature, err := scheme.Sign([]byte(fulfillment.Cid + fulfillment.SessionId + fulfillment.RequestId + strconv.FormatUint(fulfillment.FulfilledTimestamp, 10)))
if err != nil {
return err
}
Expand Down

0 comments on commit 18f9a99

Please sign in to comment.