diff --git a/chain/chain.go b/chain/chain.go index e686acf..f00f1be 100644 --- a/chain/chain.go +++ b/chain/chain.go @@ -93,10 +93,5 @@ func BatchCall(ctx context.Context, chain schema.Chain, inputs []schema.ChainVal return nil, err } - select { - case <-ctx.Done(): - return nil, ctx.Err() - default: - return chainValues, nil - } + return chainValues, nil } diff --git a/chain/chain_test.go b/chain/chain_test.go index e6d0068..bbf1c33 100644 --- a/chain/chain_test.go +++ b/chain/chain_test.go @@ -123,25 +123,6 @@ func TestBatchCall(t *testing.T) { expected: nil, expectedError: errors.New("error occurred during chain.Call"), }, - { - name: "Context Cancellation", - ctx: func() context.Context { - ctx, cancel := context.WithCancel(context.Background()) - // Cancel the context immediately to simulate cancellation - cancel() - return ctx - }(), - chain: MockChain{ - CallFunc: func(ctx context.Context, inputs schema.ChainValues) (schema.ChainValues, error) { - // Mocked implementation of the chain.Call function - // This function should not be called as the context is already cancelled - return schema.ChainValues{}, nil - }, - }, - inputs: []schema.ChainValues{}, - expected: nil, - expectedError: context.Canceled, - }, } for _, tc := range testCases {