Skip to content
This repository has been archived by the owner on Jun 22, 2023. It is now read-only.

dc4bc_cli read_operation_result now returns error if provided operation is not "result" operation #131

Merged
merged 1 commit into from
May 26, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,10 @@ func (c *BaseClient) GetOperationQRPath(operationID string) (string, error) {
// It checks that the operation exists in an operation pool, signs the operation, sends it to an append-only log and
// deletes it from the pool.
func (c *BaseClient) handleProcessedOperation(operation types.Operation) error {
if len(operation.ResultMsgs) == 0 {
return errors.New("operation is request operation, provide result operation instead")
}

storedOperation, err := c.state.GetOperationByID(operation.ID)
if err != nil {
return fmt.Errorf("failed to find matching operation: %w", err)
Expand Down