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

Commit

Permalink
chore(BUX-417): remove incoming tx
Browse files Browse the repository at this point in the history
  • Loading branch information
pawellewandowski98 committed Jan 12, 2024
1 parent 0d62456 commit c564ccc
Show file tree
Hide file tree
Showing 18 changed files with 101 additions and 593 deletions.
24 changes: 12 additions & 12 deletions action_destination_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func (ts *EmbeddedDBTestSuite) TestClient_NewDestination() {

var destination *Destination
destination, err = tc.client.NewDestination(
ctx, testXPub, utils.ChainExternal, utils.ScriptTypePubKeyHash, false, opts...,
ctx, testXPub, utils.ChainExternal, utils.ScriptTypePubKeyHash, opts...,
)
assert.NoError(t, err)
assert.Equal(t, "fc1e635d98151c6008f29908ee2928c60c745266f9853e945c917b1baa05973e", destination.ID)
Expand All @@ -42,7 +42,7 @@ func (ts *EmbeddedDBTestSuite) TestClient_NewDestination() {
assert.Equal(t, "test-value", destination.Metadata["test-key"])

destination2, err2 := tc.client.NewDestination(
ctx, testXPub, utils.ChainExternal, utils.ScriptTypePubKeyHash, false, opts...,
ctx, testXPub, utils.ChainExternal, utils.ScriptTypePubKeyHash, opts...,
)
assert.NoError(t, err2)
assert.Equal(t, testXPubID, destination2.XpubID)
Expand All @@ -65,7 +65,7 @@ func (ts *EmbeddedDBTestSuite) TestClient_NewDestination() {

destination, err := tc.client.NewDestination(
context.Background(), testXPub, utils.ChainExternal,
utils.ScriptTypePubKeyHash, false, opts...,
utils.ScriptTypePubKeyHash, opts...,
)
require.Error(t, err)
require.Nil(t, destination)
Expand Down Expand Up @@ -99,7 +99,7 @@ func (ts *EmbeddedDBTestSuite) TestClient_NewDestinationForLockingScript() {

var destination *Destination
destination, err = tc.client.NewDestinationForLockingScript(
tc.ctx, testXPubID, lockingScript, false, opts...,
tc.ctx, testXPubID, lockingScript, opts...,
)
assert.NoError(t, err)
assert.Equal(t, "a64c7aca7110c7cde92245252a58bb18a4317381fc31fc293f6aafa3fcc7019f", destination.ID)
Expand All @@ -118,7 +118,7 @@ func (ts *EmbeddedDBTestSuite) TestClient_NewDestinationForLockingScript() {
opts := append(tc.client.DefaultModelOptions(), WithMetadatas(metadata))

destination, err := tc.client.NewDestinationForLockingScript(
tc.ctx, testXPubID, "", false,
tc.ctx, testXPubID, "",
opts...,
)
require.Error(t, err)
Expand Down Expand Up @@ -147,7 +147,7 @@ func (ts *EmbeddedDBTestSuite) TestClient_GetDestinations() {

// Create a new destination
destination, err := tc.client.NewDestination(
tc.ctx, rawKey, utils.ChainExternal, utils.ScriptTypePubKeyHash, false,
tc.ctx, rawKey, utils.ChainExternal, utils.ScriptTypePubKeyHash,
opts...,
)
require.NoError(t, err)
Expand Down Expand Up @@ -176,7 +176,7 @@ func (ts *EmbeddedDBTestSuite) TestClient_GetDestinations() {

// Create a new destination
destination, err := tc.client.NewDestination(
tc.ctx, rawKey, utils.ChainExternal, utils.ScriptTypePubKeyHash, false,
tc.ctx, rawKey, utils.ChainExternal, utils.ScriptTypePubKeyHash,
opts...,
)
require.NoError(t, err)
Expand Down Expand Up @@ -212,7 +212,7 @@ func (ts *EmbeddedDBTestSuite) TestClient_GetDestinationByAddress() {

// Create a new destination
destination, err := tc.client.NewDestination(
tc.ctx, rawKey, utils.ChainExternal, utils.ScriptTypePubKeyHash, false,
tc.ctx, rawKey, utils.ChainExternal, utils.ScriptTypePubKeyHash,
opts...,
)
require.NoError(t, err)
Expand Down Expand Up @@ -240,7 +240,7 @@ func (ts *EmbeddedDBTestSuite) TestClient_GetDestinationByAddress() {

// Create a new destination
destination, err := tc.client.NewDestination(
tc.ctx, rawKey, utils.ChainExternal, utils.ScriptTypePubKeyHash, false,
tc.ctx, rawKey, utils.ChainExternal, utils.ScriptTypePubKeyHash,
opts...,
)
require.NoError(t, err)
Expand Down Expand Up @@ -276,7 +276,7 @@ func (ts *EmbeddedDBTestSuite) TestClient_GetDestinationByLockingScript() {

// Create a new destination
destination, err := tc.client.NewDestination(
tc.ctx, rawKey, utils.ChainExternal, utils.ScriptTypePubKeyHash, false,
tc.ctx, rawKey, utils.ChainExternal, utils.ScriptTypePubKeyHash,
opts...,
)
require.NoError(t, err)
Expand Down Expand Up @@ -305,7 +305,7 @@ func (ts *EmbeddedDBTestSuite) TestClient_GetDestinationByLockingScript() {

// Create a new destination
destination, err := tc.client.NewDestination(
tc.ctx, rawKey, utils.ChainExternal, utils.ScriptTypePubKeyHash, false,
tc.ctx, rawKey, utils.ChainExternal, utils.ScriptTypePubKeyHash,
opts...,
)
require.NoError(t, err)
Expand Down Expand Up @@ -340,7 +340,7 @@ func (ts *EmbeddedDBTestSuite) TestClient_UpdateDestinationMetadata() {
opts := tc.client.DefaultModelOptions()
opts = append(opts, WithMetadatas(metadata))
destination, err := tc.client.NewDestination(
tc.ctx, rawKey, utils.ChainExternal, utils.ScriptTypePubKeyHash, false,
tc.ctx, rawKey, utils.ChainExternal, utils.ScriptTypePubKeyHash,
opts...,
)
require.NoError(t, err)
Expand Down
4 changes: 2 additions & 2 deletions bux_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package bux
import (
"context"
"fmt"
"github.com/rs/zerolog"
"sync"
"testing"
"time"

"github.com/BuxOrg/bux/chainstate"
"github.com/BuxOrg/bux/logging"
"github.com/BuxOrg/bux/taskmanager"
"github.com/BuxOrg/bux/tester"
"github.com/DATA-DOG/go-sqlmock"
Expand Down Expand Up @@ -68,7 +68,7 @@ type EmbeddedDBTestSuite struct {
func (ts *EmbeddedDBTestSuite) serveMySQL() {
defer ts.wg.Done()

logger := logging.GetDefaultLogger()
logger := zerolog.Nop()

for {
err := ts.MySQLServer.Start()
Expand Down
1 change: 0 additions & 1 deletion chainstate/definitions.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const (
defaultFalsePositiveRate = 0.01
defaultFeeLastCheckIgnore = 2 * time.Minute
defaultMaxNumberOfDestinations = 100000
defaultMonitorDays = 7
defaultQueryTimeOut = 15 * time.Second
whatsOnChainRateLimitWithKey = 20
)
Expand Down
3 changes: 0 additions & 3 deletions chainstate/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,3 @@ var ErrMissingBroadcastMiners = errors.New("missing: broadcasting miners")

// ErrMissingQueryMiners is when query miners are missing
var ErrMissingQueryMiners = errors.New("missing: query miners")

// ErrMonitorNotAvailable is when the monitor processor is not available
var ErrMonitorNotAvailable = errors.New("monitor processor not available")
Loading

0 comments on commit c564ccc

Please sign in to comment.