Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
fix(spv-642): return failure object
Browse files Browse the repository at this point in the history
  • Loading branch information
arkadiuszos4chain committed Apr 19, 2024
1 parent 72eaf40 commit 1e0b082
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 50 deletions.
2 changes: 1 addition & 1 deletion broadcast/broadcast-client-mock/mock_client_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type builder struct {
factories []composite.BroadcastFactory
}

// Builder is used to prepare the mock broadcast client. It is recommended
// Builder is used to prepare the mock broadcast client. It is recommended
// to use that builder for creating the mock broadcast client.
func Builder() *builder {
return &builder{}
Expand Down
10 changes: 5 additions & 5 deletions broadcast/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ func (err ArcError) Error() string {
return sb.String()
}

type SubmitFailure struct {
type FailureResponse struct {
Description string
ArcErrorResponse *ArcError
}

func (failure SubmitFailure) Error() string {
func (failure FailureResponse) Error() string {
sb := strings.Builder{}
sb.WriteString(failure.Description)

Expand All @@ -97,13 +97,13 @@ func (failure SubmitFailure) Error() string {
return sb.String()
}

func Failure(description string, err error) *SubmitFailure {
func Failure(description string, err error) *FailureResponse {
if arcErr, ok := err.(ArcError); ok {
return &SubmitFailure{
return &FailureResponse{
Description: description,
ArcErrorResponse: &arcErr,
}
}

return &SubmitFailure{Description: utils.WithCause(errors.New(description), err).Error()}
return &FailureResponse{Description: utils.WithCause(errors.New(description), err).Error()}
}
10 changes: 5 additions & 5 deletions broadcast/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,35 @@ import (
// FeeQuoter it the interface that wraps GetFeeQuote method.
// It retrieves the Fee Quote from the configured miners.
type FeeQuoter interface {
GetFeeQuote(ctx context.Context) ([]*FeeQuote, *SubmitFailure)
GetFeeQuote(ctx context.Context) ([]*FeeQuote, *FailureResponse)
}

// PolicyQuoter it the interface that wraps GetPolicyQuote method.
// It retrieves the Policy Quote from the configured miners.
type PolicyQuoter interface {
GetPolicyQuote(ctx context.Context) ([]*PolicyQuoteResponse, *SubmitFailure)
GetPolicyQuote(ctx context.Context) ([]*PolicyQuoteResponse, *FailureResponse)
}

// TransactionQuerier is the interface that wraps the QueryTransaction method.
// It takes a transaction ID and returns the transaction details, like it's status, hash, height etc.
// Everything is wrapped in the QueryTxResponse struct.
type TransactionQuerier interface {
QueryTransaction(ctx context.Context, txID string) (*QueryTxResponse, *SubmitFailure)
QueryTransaction(ctx context.Context, txID string) (*QueryTxResponse, *FailureResponse)
}

// TransactionSubmitter is the interface that wraps the SubmitTransaction method.
// It takes a transaction and tries to broadcast it to the P2P network.
// Transaction object needs RawTx to be set. All other fields are optional and used to append headers related to status callbacks.
// As a result it returns a SubmitTxResponse object.
type TransactionSubmitter interface {
SubmitTransaction(ctx context.Context, tx *Transaction, opts ...TransactionOptFunc) (*SubmitTxResponse, *SubmitFailure)
SubmitTransaction(ctx context.Context, tx *Transaction, opts ...TransactionOptFunc) (*SubmitTxResponse, *FailureResponse)
}

// TransactionsSubmitter is the interface that wraps the SubmitBatchTransactions method.
// It is the same as TransactionSubmitter but it takes a slice of transactions and tries to broadcast them to the P2P network.
// As a result it returns a SubmitBatchTxResponse, which includes a slice of SubmitTxResponse objects.
type TransactionsSubmitter interface {
SubmitBatchTransactions(ctx context.Context, tx []*Transaction, opts ...TransactionOptFunc) (*SubmitBatchTxResponse, *SubmitFailure)
SubmitBatchTransactions(ctx context.Context, tx []*Transaction, opts ...TransactionOptFunc) (*SubmitBatchTxResponse, *FailureResponse)
}

// Client is a grouping interface that represents the entire exposed functionality of the broadcast client.
Expand Down
2 changes: 1 addition & 1 deletion broadcast/internal/arc/arc_fee_quote.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/bitcoin-sv/go-broadcast-client/broadcast"
)

func (a *ArcClient) GetFeeQuote(ctx context.Context) ([]*broadcast.FeeQuote, *broadcast.SubmitFailure) {
func (a *ArcClient) GetFeeQuote(ctx context.Context) ([]*broadcast.FeeQuote, *broadcast.FailureResponse) {
if a == nil {
return nil, broadcast.Failure("GetFeeQuote:", broadcast.ErrClientUndefined)
}
Expand Down
2 changes: 1 addition & 1 deletion broadcast/internal/arc/arc_policy_quote.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/bitcoin-sv/go-broadcast-client/httpclient"
)

func (a *ArcClient) GetPolicyQuote(ctx context.Context) ([]*broadcast.PolicyQuoteResponse, *broadcast.SubmitFailure) {
func (a *ArcClient) GetPolicyQuote(ctx context.Context) ([]*broadcast.PolicyQuoteResponse, *broadcast.FailureResponse) {
if a == nil {
return nil, broadcast.Failure("GetPolicyQuote:", broadcast.ErrClientUndefined)
}
Expand Down
2 changes: 1 addition & 1 deletion broadcast/internal/arc/arc_query_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

var ErrMissingTxID = errors.New("missing tx id")

func (a *ArcClient) QueryTransaction(ctx context.Context, txID string) (*broadcast.QueryTxResponse, *broadcast.SubmitFailure) {
func (a *ArcClient) QueryTransaction(ctx context.Context, txID string) (*broadcast.QueryTxResponse, *broadcast.FailureResponse) {
if a == nil {
return nil, broadcast.Failure("QueryTransaction:", broadcast.ErrClientUndefined)
}
Expand Down
4 changes: 2 additions & 2 deletions broadcast/internal/arc/arc_submit_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type SubmitTxRequest struct {

var ErrSubmitTxMarshal = errors.New("error while marshalling submit tx body")

func (a *ArcClient) SubmitTransaction(ctx context.Context, tx *broadcast.Transaction, opts ...broadcast.TransactionOptFunc) (*broadcast.SubmitTxResponse, *broadcast.SubmitFailure) {
func (a *ArcClient) SubmitTransaction(ctx context.Context, tx *broadcast.Transaction, opts ...broadcast.TransactionOptFunc) (*broadcast.SubmitTxResponse, *broadcast.FailureResponse) {
if a == nil {
return nil, broadcast.Failure("SubmitTransaction:", broadcast.ErrClientUndefined)
}
Expand Down Expand Up @@ -50,7 +50,7 @@ func (a *ArcClient) SubmitTransaction(ctx context.Context, tx *broadcast.Transac
return response, nil
}

func (a *ArcClient) SubmitBatchTransactions(ctx context.Context, txs []*broadcast.Transaction, opts ...broadcast.TransactionOptFunc) (*broadcast.SubmitBatchTxResponse, *broadcast.SubmitFailure) {
func (a *ArcClient) SubmitBatchTransactions(ctx context.Context, txs []*broadcast.Transaction, opts ...broadcast.TransactionOptFunc) (*broadcast.SubmitBatchTxResponse, *broadcast.FailureResponse) {
if a == nil {
return nil, broadcast.Failure("SubmitBatchTransactions:", broadcast.ErrClientUndefined)
}
Expand Down
21 changes: 10 additions & 11 deletions broadcast/internal/arc/mocks/arc_client_mock_no_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,34 @@ package mocks
import (
"context"

"github.com/bitcoin-sv/go-broadcast-client/broadcast"
broadcast_api "github.com/bitcoin-sv/go-broadcast-client/broadcast"
)

type ArcClientMockFailure struct{}

// GetFeeQuote returns an error.
func (*ArcClientMockFailure) GetFeeQuote(ctx context.Context) ([]*broadcast_api.FeeQuote, *broadcast_api.SubmitFailure) {
return nil, broadcast.Failure("", broadcast.ErrNoMinerResponse)
func (*ArcClientMockFailure) GetFeeQuote(ctx context.Context) ([]*broadcast_api.FeeQuote, *broadcast_api.FailureResponse) {
return nil, broadcast_api.Failure("", broadcast_api.ErrNoMinerResponse)
}

// GetPolicyQuote returns an error.
func (*ArcClientMockFailure) GetPolicyQuote(ctx context.Context) ([]*broadcast_api.PolicyQuoteResponse, *broadcast_api.SubmitFailure) {
return nil, broadcast.Failure("", broadcast.ErrNoMinerResponse)
func (*ArcClientMockFailure) GetPolicyQuote(ctx context.Context) ([]*broadcast_api.PolicyQuoteResponse, *broadcast_api.FailureResponse) {
return nil, broadcast_api.Failure("", broadcast_api.ErrNoMinerResponse)
}

// QueryTransaction returns an error.
func (*ArcClientMockFailure) QueryTransaction(ctx context.Context, txID string) (*broadcast_api.QueryTxResponse, *broadcast_api.SubmitFailure) {
return nil, broadcast.Failure("", broadcast.ErrNoMinerResponse)
func (*ArcClientMockFailure) QueryTransaction(ctx context.Context, txID string) (*broadcast_api.QueryTxResponse, *broadcast_api.FailureResponse) {
return nil, broadcast_api.Failure("", broadcast_api.ErrNoMinerResponse)
}

// SubmitBatchTransactions returns an error.
func (*ArcClientMockFailure) SubmitBatchTransactions(ctx context.Context, tx []*broadcast_api.Transaction, opts ...broadcast_api.TransactionOptFunc) (*broadcast_api.SubmitBatchTxResponse, *broadcast_api.SubmitFailure) {
return nil, broadcast.Failure("", broadcast.ErrAllBroadcastersFailed)
func (*ArcClientMockFailure) SubmitBatchTransactions(ctx context.Context, tx []*broadcast_api.Transaction, opts ...broadcast_api.TransactionOptFunc) (*broadcast_api.SubmitBatchTxResponse, *broadcast_api.FailureResponse) {
return nil, broadcast_api.Failure("", broadcast_api.ErrAllBroadcastersFailed)
}

// SubmitTransaction returns an error.
func (*ArcClientMockFailure) SubmitTransaction(ctx context.Context, tx *broadcast_api.Transaction, opts ...broadcast_api.TransactionOptFunc) (*broadcast_api.SubmitTxResponse, *broadcast_api.SubmitFailure) {
return nil, broadcast.Failure("", broadcast.ErrAllBroadcastersFailed)
func (*ArcClientMockFailure) SubmitTransaction(ctx context.Context, tx *broadcast_api.Transaction, opts ...broadcast_api.TransactionOptFunc) (*broadcast_api.SubmitTxResponse, *broadcast_api.FailureResponse) {
return nil, broadcast_api.Failure("", broadcast_api.ErrAllBroadcastersFailed)
}

// NewArcClientMockFailure creates a new mock arc client that returns an error from all its methods.
Expand Down
10 changes: 5 additions & 5 deletions broadcast/internal/arc/mocks/arc_client_mock_success.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
type ArcClientMock struct{}

// GetFeeQuote returns a successful FeeQuote response.
func (*ArcClientMock) GetFeeQuote(ctx context.Context) ([]*broadcast_api.FeeQuote, *broadcast_api.SubmitFailure) {
func (*ArcClientMock) GetFeeQuote(ctx context.Context) ([]*broadcast_api.FeeQuote, *broadcast_api.FailureResponse) {
quotes := make([]*broadcast_api.FeeQuote, 0)
quotes = append(quotes, Fee1)
quotes = append(quotes, Fee2)
Expand All @@ -19,7 +19,7 @@ func (*ArcClientMock) GetFeeQuote(ctx context.Context) ([]*broadcast_api.FeeQuot
}

// GetPolicyQuote return a successful PolicyQuoteResponse.
func (*ArcClientMock) GetPolicyQuote(ctx context.Context) ([]*broadcast_api.PolicyQuoteResponse, *broadcast_api.SubmitFailure) {
func (*ArcClientMock) GetPolicyQuote(ctx context.Context) ([]*broadcast_api.PolicyQuoteResponse, *broadcast_api.FailureResponse) {
policies := make([]*broadcast_api.PolicyQuoteResponse, 0)
policies = append(policies, Policy1)
policies = append(policies, Policy2)
Expand All @@ -28,20 +28,20 @@ func (*ArcClientMock) GetPolicyQuote(ctx context.Context) ([]*broadcast_api.Poli
}

// QueryTransaction returns a successful QueryTxResponse.
func (*ArcClientMock) QueryTransaction(ctx context.Context, txID string) (*broadcast_api.QueryTxResponse, *broadcast_api.SubmitFailure) {
func (*ArcClientMock) QueryTransaction(ctx context.Context, txID string) (*broadcast_api.QueryTxResponse, *broadcast_api.FailureResponse) {
return QueryTx(txID), nil
}

// SubmitTransaction returns a successful SubmitTxResponse.
func (*ArcClientMock) SubmitTransaction(ctx context.Context, tx *broadcast_api.Transaction, opts ...broadcast_api.TransactionOptFunc) (*broadcast_api.SubmitTxResponse, *broadcast_api.SubmitFailure) {
func (*ArcClientMock) SubmitTransaction(ctx context.Context, tx *broadcast_api.Transaction, opts ...broadcast_api.TransactionOptFunc) (*broadcast_api.SubmitTxResponse, *broadcast_api.FailureResponse) {
return &broadcast_api.SubmitTxResponse{
BaseResponse: broadcast_api.BaseResponse{Miner: fixtures.ProviderMain},
SubmittedTx: SubmittedTx,
}, nil
}

// SubmitBatchTransactions returns a successful SubmitBatchTxResponse.
func (*ArcClientMock) SubmitBatchTransactions(ctx context.Context, tx []*broadcast_api.Transaction, opts ...broadcast_api.TransactionOptFunc) (*broadcast_api.SubmitBatchTxResponse, *broadcast_api.SubmitFailure) {
func (*ArcClientMock) SubmitBatchTransactions(ctx context.Context, tx []*broadcast_api.Transaction, opts ...broadcast_api.TransactionOptFunc) (*broadcast_api.SubmitBatchTxResponse, *broadcast_api.FailureResponse) {
return &broadcast_api.SubmitBatchTxResponse{
BaseResponse: broadcast_api.BaseResponse{Miner: fixtures.ProviderMain},
Transactions: []*broadcast_api.SubmittedTx{
Expand Down
10 changes: 5 additions & 5 deletions broadcast/internal/arc/mocks/arc_client_mock_timeout.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
type ArcClientMockTimeout struct{}

// GetFeeQuote returns a successful FeeQuote response.
func (*ArcClientMockTimeout) GetFeeQuote(ctx context.Context) ([]*broadcast_api.FeeQuote, *broadcast_api.SubmitFailure) {
func (*ArcClientMockTimeout) GetFeeQuote(ctx context.Context) ([]*broadcast_api.FeeQuote, *broadcast_api.FailureResponse) {
if deadline, ok := ctx.Deadline(); ok {
time.Sleep(time.Until(deadline) + 10*time.Millisecond)
}
Expand All @@ -24,7 +24,7 @@ func (*ArcClientMockTimeout) GetFeeQuote(ctx context.Context) ([]*broadcast_api.
}

// GetPolicyQuote return a successful PolicyQuoteResponse.
func (*ArcClientMockTimeout) GetPolicyQuote(ctx context.Context) ([]*broadcast_api.PolicyQuoteResponse, *broadcast_api.SubmitFailure) {
func (*ArcClientMockTimeout) GetPolicyQuote(ctx context.Context) ([]*broadcast_api.PolicyQuoteResponse, *broadcast_api.FailureResponse) {
if deadline, ok := ctx.Deadline(); ok {
time.Sleep(time.Until(deadline) + 10*time.Millisecond)
}
Expand All @@ -37,7 +37,7 @@ func (*ArcClientMockTimeout) GetPolicyQuote(ctx context.Context) ([]*broadcast_a
}

// QueryTransaction returns a successful QueryTxResponse.
func (*ArcClientMockTimeout) QueryTransaction(ctx context.Context, txID string) (*broadcast_api.QueryTxResponse, *broadcast_api.SubmitFailure) {
func (*ArcClientMockTimeout) QueryTransaction(ctx context.Context, txID string) (*broadcast_api.QueryTxResponse, *broadcast_api.FailureResponse) {
if deadline, ok := ctx.Deadline(); ok {
time.Sleep(time.Until(deadline) + 10*time.Millisecond)
}
Expand All @@ -46,7 +46,7 @@ func (*ArcClientMockTimeout) QueryTransaction(ctx context.Context, txID string)
}

// SubmitTransaction returns a successful SubmitTxResponse.
func (*ArcClientMockTimeout) SubmitTransaction(ctx context.Context, tx *broadcast_api.Transaction, opts ...broadcast_api.TransactionOptFunc) (*broadcast_api.SubmitTxResponse, *broadcast_api.SubmitFailure) {
func (*ArcClientMockTimeout) SubmitTransaction(ctx context.Context, tx *broadcast_api.Transaction, opts ...broadcast_api.TransactionOptFunc) (*broadcast_api.SubmitTxResponse, *broadcast_api.FailureResponse) {
if deadline, ok := ctx.Deadline(); ok {
time.Sleep(time.Until(deadline) + 10*time.Millisecond)
}
Expand All @@ -58,7 +58,7 @@ func (*ArcClientMockTimeout) SubmitTransaction(ctx context.Context, tx *broadcas
}

// SubmitBatchTransactions returns a successful SubmitBatchTxResponse.
func (*ArcClientMockTimeout) SubmitBatchTransactions(ctx context.Context, tx []*broadcast_api.Transaction, opts ...broadcast_api.TransactionOptFunc) (*broadcast_api.SubmitBatchTxResponse, *broadcast_api.SubmitFailure) {
func (*ArcClientMockTimeout) SubmitBatchTransactions(ctx context.Context, tx []*broadcast_api.Transaction, opts ...broadcast_api.TransactionOptFunc) (*broadcast_api.SubmitBatchTxResponse, *broadcast_api.FailureResponse) {
if deadline, ok := ctx.Deadline(); ok {
time.Sleep(time.Until(deadline) + 10*time.Millisecond)
}
Expand Down
16 changes: 8 additions & 8 deletions broadcast/internal/composite/broadcaster.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func NewBroadcaster(strategy Strategy, factories ...BroadcastFactory) broadcast.

func (c *compositeBroadcaster) GetPolicyQuote(
ctx context.Context,
) ([]*broadcast.PolicyQuoteResponse, *broadcast.SubmitFailure) {
) ([]*broadcast.PolicyQuoteResponse, *broadcast.FailureResponse) {
var policyQuotes []*broadcast.PolicyQuoteResponse

for _, broadcaster := range c.broadcasters {
Expand All @@ -50,7 +50,7 @@ func (c *compositeBroadcaster) GetPolicyQuote(
return policyQuotes, nil
}

func (c *compositeBroadcaster) GetFeeQuote(ctx context.Context) ([]*broadcast.FeeQuote, *broadcast.SubmitFailure) {
func (c *compositeBroadcaster) GetFeeQuote(ctx context.Context) ([]*broadcast.FeeQuote, *broadcast.FailureResponse) {
var feeQuotes []*broadcast.FeeQuote

for _, broadcaster := range c.broadcasters {
Expand All @@ -70,11 +70,11 @@ func (c *compositeBroadcaster) GetFeeQuote(ctx context.Context) ([]*broadcast.Fe
func (c *compositeBroadcaster) QueryTransaction(
ctx context.Context,
txID string,
) (*broadcast.QueryTxResponse, *broadcast.SubmitFailure) {
) (*broadcast.QueryTxResponse, *broadcast.FailureResponse) {
executionFuncs := make([]executionFunc, len(c.broadcasters))
for i, broadcaster := range c.broadcasters {
currentBroadcaster := broadcaster
executionFuncs[i] = func(ctx context.Context) (Result, *broadcast.SubmitFailure) {
executionFuncs[i] = func(ctx context.Context) (Result, *broadcast.FailureResponse) {
return currentBroadcaster.QueryTransaction(ctx, txID)
}
}
Expand All @@ -96,11 +96,11 @@ func (c *compositeBroadcaster) SubmitTransaction(
ctx context.Context,
tx *broadcast.Transaction,
opts ...broadcast.TransactionOptFunc,
) (*broadcast.SubmitTxResponse, *broadcast.SubmitFailure) {
) (*broadcast.SubmitTxResponse, *broadcast.FailureResponse) {
executionFuncs := make([]executionFunc, len(c.broadcasters))
for i, broadcaster := range c.broadcasters {
currentBroadcaster := broadcaster
executionFuncs[i] = func(ctx context.Context) (Result, *broadcast.SubmitFailure) {
executionFuncs[i] = func(ctx context.Context) (Result, *broadcast.FailureResponse) {
return currentBroadcaster.SubmitTransaction(ctx, tx)
}
}
Expand All @@ -122,11 +122,11 @@ func (c *compositeBroadcaster) SubmitBatchTransactions(
ctx context.Context,
txs []*broadcast.Transaction,
opts ...broadcast.TransactionOptFunc,
) (*broadcast.SubmitBatchTxResponse, *broadcast.SubmitFailure) {
) (*broadcast.SubmitBatchTxResponse, *broadcast.FailureResponse) {
executionFuncs := make([]executionFunc, len(c.broadcasters))
for i, broadcaster := range c.broadcasters {
currentBroadcaster := broadcaster
executionFuncs[i] = func(ctx context.Context) (Result, *broadcast.SubmitFailure) {
executionFuncs[i] = func(ctx context.Context) (Result, *broadcast.FailureResponse) {
return currentBroadcaster.SubmitBatchTransactions(ctx, txs)
}
}
Expand Down
8 changes: 4 additions & 4 deletions broadcast/internal/composite/strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ const (

type Result interface{}

type executionFunc func(context.Context) (Result, *broadcast.SubmitFailure)
type executionFunc func(context.Context) (Result, *broadcast.FailureResponse)

type StrategyExecutionFunc func(context.Context, []executionFunc) (Result, *broadcast.SubmitFailure)
type StrategyExecutionFunc func(context.Context, []executionFunc) (Result, *broadcast.FailureResponse)

// Strategy is a component designed to offer flexibility in selecting a communication approach
// for interacting with multiple broadcasting services, such as multiple Arc services.
Expand All @@ -37,12 +37,12 @@ func New(name StrategyName) (*Strategy, error) {
}
}

func (s *Strategy) Execute(ctx context.Context, executionFuncs []executionFunc) (Result, *broadcast.SubmitFailure) {
func (s *Strategy) Execute(ctx context.Context, executionFuncs []executionFunc) (Result, *broadcast.FailureResponse) {
return s.executionFunc(ctx, executionFuncs)
}

var (
OneByOne = &Strategy{name: OneByOneStrategy, executionFunc: func(ctx context.Context, executionFuncs []executionFunc) (Result, *broadcast.SubmitFailure) {
OneByOne = &Strategy{name: OneByOneStrategy, executionFunc: func(ctx context.Context, executionFuncs []executionFunc) (Result, *broadcast.FailureResponse) {
for _, executionFunc := range executionFuncs {
result, err := executionFunc(ctx)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion broadcast/internal/composite/strategy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type mockExecutionFunc struct {
err error
}

func (m mockExecutionFunc) Execute(_ context.Context) (Result, *broadcast.SubmitFailure) {
func (m mockExecutionFunc) Execute(_ context.Context) (Result, *broadcast.FailureResponse) {
if m.err != nil {
return m.result, broadcast.Failure("", m.err)
}
Expand Down

0 comments on commit 1e0b082

Please sign in to comment.