Skip to content

Commit

Permalink
Register call requests with contract id
Browse files Browse the repository at this point in the history
  • Loading branch information
kompotkot committed Aug 16, 2024
1 parent f7eab5d commit 1eaec43
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ func (server *Server) signDropperRoute(w http.ResponseWriter, r *http.Request, s

// Run check of existing call_requests in database
if !req.NoMetatx && !req.NoCheckMetatx {
checkStatusCode, existingRequests, checkStatus := server.MoonstreamEngineAPIClient.checkCallRequests(authorizationToken, "", req.Dropper, callRequestSpecifications)
checkStatusCode, existingRequests, checkStatus := server.MoonstreamEngineAPIClient.checkCallRequests(authorizationToken, req.RegisteredContractId, req.Dropper, callRequestSpecifications)

if checkStatusCode == 0 {
http.Error(w, "Internal server error", http.StatusInternalServerError)
Expand Down Expand Up @@ -594,9 +594,13 @@ func (server *Server) signDropperRoute(w http.ResponseWriter, r *http.Request, s
go func() {
for i, batchSpecs := range callRequestBatches {
requestBody := CreateCallRequestsRequest{
TTLDays: req.TtlDays,
Specifications: batchSpecs,
ContractAddress: req.Dropper,
TTLDays: req.TtlDays,
Specifications: batchSpecs,
}
if req.RegisteredContractId != "" {
requestBody.ContractID = req.RegisteredContractId
} else {
requestBody.ContractAddress = req.Dropper
}

requestBodyBytes, requestBodyBytesErr := json.Marshal(requestBody)
Expand Down

0 comments on commit 1eaec43

Please sign in to comment.