Post-merge fixes

This commit is contained in:
Andrej Zavgorodnij 2020-10-05 18:08:55 +03:00
parent 32fde1b880
commit 953f570e02
2 changed files with 9 additions and 10 deletions

View File

@ -6,12 +6,13 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/depools/dc4bc/fsm/types/responses"
"log"
"path/filepath"
"sync"
"time"
"github.com/depools/dc4bc/fsm/types/responses"
sipf "github.com/depools/dc4bc/fsm/state_machines/signing_proposal_fsm"
"github.com/depools/dc4bc/client/types"
@ -137,7 +138,7 @@ func (c *BaseClient) SendMessage(message storage.Message) error {
}
// processSignature saves a broadcasted reconstructed signature to a LevelDB
func (c *Client) processSignature(message storage.Message) error {
func (c *BaseClient) processSignature(message storage.Message) error {
var (
signature types.ReconstructedSignature
err error
@ -288,12 +289,12 @@ func (c *BaseClient) GetOperations() (map[string]*types.Operation, error) {
//GetSignatures returns all signatures for the given DKG round that were reconstructed on the airgapped machine and
// broadcasted by users
func (c *Client) GetSignatures(dkgID string) (map[string][]types.ReconstructedSignature, error) {
func (c *BaseClient) GetSignatures(dkgID string) (map[string][]types.ReconstructedSignature, error) {
return c.state.GetSignatures(dkgID)
}
//GetSignatureByDataHash returns a list of reconstructed signatures of the signed data broadcasted by users
func (c *Client) GetSignatureByDataHash(dkgID, sigID string) ([]types.ReconstructedSignature, error) {
func (c *BaseClient) GetSignatureByDataHash(dkgID, sigID string) ([]types.ReconstructedSignature, error) {
return c.state.GetSignatureByDataHash(dkgID, sigID)
}

View File

@ -9,16 +9,14 @@ import (
"log"
"net/http"
"time"
"github.com/depools/dc4bc/client/types"
"github.com/depools/dc4bc/fsm/fsm"
spf "github.com/depools/dc4bc/fsm/state_machines/signature_proposal_fsm"
sif "github.com/depools/dc4bc/fsm/state_machines/signing_proposal_fsm"
"github.com/depools/dc4bc/fsm/types/requests"
"github.com/google/uuid"
"io/ioutil"
"log"
"net/http"
"time"
"github.com/depools/dc4bc/qr"
"github.com/depools/dc4bc/storage"
@ -143,7 +141,7 @@ func (c *BaseClient) getOperationsHandler(w http.ResponseWriter, r *http.Request
successResponse(w, operations)
}
func (c *Client) getSignaturesHandler(w http.ResponseWriter, r *http.Request) {
func (c *BaseClient) getSignaturesHandler(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodGet {
errorResponse(w, http.StatusBadRequest, "Wrong HTTP method")
return
@ -158,7 +156,7 @@ func (c *Client) getSignaturesHandler(w http.ResponseWriter, r *http.Request) {
successResponse(w, signatures)
}
func (c *Client) getSignatureByDataHashHandler(w http.ResponseWriter, r *http.Request) {
func (c *BaseClient) getSignatureByDataHashHandler(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodGet {
errorResponse(w, http.StatusBadRequest, "Wrong HTTP method")
return