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

Commit

Permalink
fix: failed tests on local machine
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalibalashka authored and witalij-4chain committed Oct 20, 2023
1 parent e05ecbf commit 513f915
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
7 changes: 5 additions & 2 deletions chainstate/broadcast_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ func TestClient_Broadcast(t *testing.T) {

t.Run("error - missing tx id", func(t *testing.T) {
// given
c := NewTestClient(context.Background(), t)
c := NewTestClient(context.Background(), t,
WithMinercraft(&MinerCraftBase{}))

// when
provider, err := c.Broadcast(
Expand All @@ -50,7 +51,8 @@ func TestClient_Broadcast(t *testing.T) {

t.Run("error - missing tx hex", func(t *testing.T) {
// given
c := NewTestClient(context.Background(), t)
c := NewTestClient(context.Background(), t,
WithMinercraft(&MinerCraftBase{}))

// when
provider, err := c.Broadcast(
Expand Down Expand Up @@ -105,6 +107,7 @@ func TestClient_Broadcast_BroadcastClient(t *testing.T) {
Build()
c := NewTestClient(
context.Background(), t,
WithMinercraft(&MinerCraftBase{}),
WithBroadcastClient(bc),
)

Expand Down
3 changes: 2 additions & 1 deletion chainstate/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func TestNewClient(t *testing.T) {
require.NotNil(t, customClient)
c, err := NewClient(
context.Background(),
WithMinercraft(&MinerCraftBase{}),
WithBroadcastClient(customClient),
)
require.NoError(t, err)
Expand All @@ -61,7 +62,7 @@ func TestNewClient(t *testing.T) {

t.Run("custom minercraft client", func(t *testing.T) {
customClient, err := minercraft.NewClient(
minercraft.DefaultClientOptions(), nil, "", nil, nil,
minercraft.DefaultClientOptions(), &http.Client{}, minercraft.Arc, nil, nil,
)
require.NoError(t, err)
require.NotNil(t, customClient)
Expand Down
10 changes: 7 additions & 3 deletions chainstate/transaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ func TestClient_Transaction_MAPI(t *testing.T) {
assert.Equal(t, minerTaal.Name, info.Provider)
assert.Equal(t, minerTaal.MinerID, info.MinerID)
})

}

func TestClient_Transaction_BroadcastClient(t *testing.T) {
Expand All @@ -110,6 +109,7 @@ func TestClient_Transaction_BroadcastClient(t *testing.T) {
Build()
c := NewTestClient(
context.Background(), t,
WithMinercraft(&MinerCraftBase{}),
WithBroadcastClient(bc),
)

Expand All @@ -135,6 +135,7 @@ func TestClient_Transaction_BroadcastClient(t *testing.T) {
Build()
c := NewTestClient(
context.Background(), t,
WithMinercraft(&MinerCraftBase{}),
WithBroadcastClient(bc),
WithNetwork(StressTestNet),
)
Expand All @@ -161,6 +162,7 @@ func TestClient_Transaction_BroadcastClient(t *testing.T) {
Build()
c := NewTestClient(
context.Background(), t,
WithMinercraft(&MinerCraftBase{}),
WithBroadcastClient(bc),
WithNetwork(TestNet),
)
Expand Down Expand Up @@ -296,7 +298,8 @@ func TestClient_Transaction_MultipleClients_Fastest(t *testing.T) {

t.Run("error - missing id", func(t *testing.T) {
// given
c := NewTestClient(context.Background(), t)
c := NewTestClient(context.Background(), t,
WithMinercraft(&MinerCraftBase{}))

// when
info, err := c.QueryTransactionFastest(
Expand All @@ -311,7 +314,8 @@ func TestClient_Transaction_MultipleClients_Fastest(t *testing.T) {

t.Run("error - missing requirements", func(t *testing.T) {
// given
c := NewTestClient(context.Background(), t)
c := NewTestClient(context.Background(), t,
WithMinercraft(&MinerCraftBase{}))

// when
info, err := c.QueryTransactionFastest(
Expand Down

0 comments on commit 513f915

Please sign in to comment.