From ecc04ac1ca606a3f5b563ab6e257e296057118fb Mon Sep 17 00:00:00 2001 From: jholdstock Date: Wed, 7 Aug 2024 09:37:22 +0100 Subject: [PATCH] multi: Make pool package internal. --- .gitignore | 2 +- cmd/miner/client.go | 2 +- cmd/miner/cpuminer.go | 2 +- config.go | 2 +- dcrpool.go | 2 +- internal/gui/account.go | 4 ++-- internal/gui/admin.go | 4 ++-- internal/gui/cache.go | 4 ++-- internal/gui/gui.go | 4 ++-- internal/gui/middleware.go | 4 ++-- internal/gui/pagination.go | 4 ++-- {pool => internal/pool}/acceptedwork.go | 0 {pool => internal/pool}/acceptedwork_test.go | 0 {pool => internal/pool}/account.go | 0 {pool => internal/pool}/account_test.go | 0 {pool => internal/pool}/boltdb.go | 0 {pool => internal/pool}/boltupgrades.go | 0 {pool => internal/pool}/boltupgrades_test.go | 0 {pool => internal/pool}/chainstate.go | 0 {pool => internal/pool}/chainstate_test.go | 0 {pool => internal/pool}/client.go | 0 {pool => internal/pool}/client_test.go | 0 {pool => internal/pool}/database.go | 0 {pool => internal/pool}/db_test.go | 0 {pool => internal/pool}/difficulty.go | 0 {pool => internal/pool}/difficulty_test.go | 0 {pool => internal/pool}/endpoint.go | 0 {pool => internal/pool}/endpoint_test.go | 0 {pool => internal/pool}/hashdata.go | 0 {pool => internal/pool}/hashdata_test.go | 0 {pool => internal/pool}/hub.go | 0 {pool => internal/pool}/hub_test.go | 0 {pool => internal/pool}/job.go | 0 {pool => internal/pool}/job_test.go | 0 {pool => internal/pool}/limiter.go | 0 {pool => internal/pool}/limiter_test.go | 0 {pool => internal/pool}/log.go | 0 {pool => internal/pool}/message.go | 0 {pool => internal/pool}/message_test.go | 0 {pool => internal/pool}/minerid.go | 0 {pool => internal/pool}/minerid_test.go | 0 {pool => internal/pool}/payment.go | 0 {pool => internal/pool}/payment_test.go | 0 {pool => internal/pool}/paymentmgr.go | 0 {pool => internal/pool}/paymentmgr_test.go | 0 {pool => internal/pool}/pool_test.go | 0 {pool => internal/pool}/postgres.go | 0 {pool => internal/pool}/share.go | 0 {pool => internal/pool}/share_test.go | 0 {pool => internal/pool}/sql_queries.go | 0 log.go | 2 +- 51 files changed, 18 insertions(+), 18 deletions(-) rename {pool => internal/pool}/acceptedwork.go (100%) rename {pool => internal/pool}/acceptedwork_test.go (100%) rename {pool => internal/pool}/account.go (100%) rename {pool => internal/pool}/account_test.go (100%) rename {pool => internal/pool}/boltdb.go (100%) rename {pool => internal/pool}/boltupgrades.go (100%) rename {pool => internal/pool}/boltupgrades_test.go (100%) rename {pool => internal/pool}/chainstate.go (100%) rename {pool => internal/pool}/chainstate_test.go (100%) rename {pool => internal/pool}/client.go (100%) rename {pool => internal/pool}/client_test.go (100%) rename {pool => internal/pool}/database.go (100%) rename {pool => internal/pool}/db_test.go (100%) rename {pool => internal/pool}/difficulty.go (100%) rename {pool => internal/pool}/difficulty_test.go (100%) rename {pool => internal/pool}/endpoint.go (100%) rename {pool => internal/pool}/endpoint_test.go (100%) rename {pool => internal/pool}/hashdata.go (100%) rename {pool => internal/pool}/hashdata_test.go (100%) rename {pool => internal/pool}/hub.go (100%) rename {pool => internal/pool}/hub_test.go (100%) rename {pool => internal/pool}/job.go (100%) rename {pool => internal/pool}/job_test.go (100%) rename {pool => internal/pool}/limiter.go (100%) rename {pool => internal/pool}/limiter_test.go (100%) rename {pool => internal/pool}/log.go (100%) rename {pool => internal/pool}/message.go (100%) rename {pool => internal/pool}/message_test.go (100%) rename {pool => internal/pool}/minerid.go (100%) rename {pool => internal/pool}/minerid_test.go (100%) rename {pool => internal/pool}/payment.go (100%) rename {pool => internal/pool}/payment_test.go (100%) rename {pool => internal/pool}/paymentmgr.go (100%) rename {pool => internal/pool}/paymentmgr_test.go (100%) rename {pool => internal/pool}/pool_test.go (100%) rename {pool => internal/pool}/postgres.go (100%) rename {pool => internal/pool}/share.go (100%) rename {pool => internal/pool}/share_test.go (100%) rename {pool => internal/pool}/sql_queries.go (100%) diff --git a/.gitignore b/.gitignore index d7298cc8..65e51dba 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ tmp logs *.log *.conf -/pool/testdb +/internal/pool/testdb /certs/* # Testing, profiling, and benchmarking artifacts diff --git a/cmd/miner/client.go b/cmd/miner/client.go index fe32d064..2a49c81c 100644 --- a/cmd/miner/client.go +++ b/cmd/miner/client.go @@ -16,7 +16,7 @@ import ( "sync/atomic" "time" - "github.com/decred/dcrpool/pool" + "github.com/decred/dcrpool/internal/pool" ) // work represents the data received from a work notification. It comprises of diff --git a/cmd/miner/cpuminer.go b/cmd/miner/cpuminer.go index 67a89c0e..540565ce 100644 --- a/cmd/miner/cpuminer.go +++ b/cmd/miner/cpuminer.go @@ -18,7 +18,7 @@ import ( "github.com/decred/dcrd/blockchain/standalone/v2" "github.com/decred/dcrd/wire" - "github.com/decred/dcrpool/pool" + "github.com/decred/dcrpool/internal/pool" ) const ( diff --git a/config.go b/config.go index bdf1363b..531ebe8f 100644 --- a/config.go +++ b/config.go @@ -23,7 +23,7 @@ import ( "github.com/decred/dcrd/certgen" "github.com/decred/dcrd/dcrutil/v4" "github.com/decred/dcrd/txscript/v4/stdaddr" - "github.com/decred/dcrpool/pool" + "github.com/decred/dcrpool/internal/pool" "github.com/decred/slog" ) diff --git a/dcrpool.go b/dcrpool.go index 73c45ce7..8c1dfe03 100644 --- a/dcrpool.go +++ b/dcrpool.go @@ -19,7 +19,7 @@ import ( "github.com/decred/dcrd/rpcclient/v8" "github.com/decred/dcrpool/internal/gui" - "github.com/decred/dcrpool/pool" + "github.com/decred/dcrpool/internal/pool" ) // newHub returns a new pool hub configured with the provided details that is diff --git a/internal/gui/account.go b/internal/gui/account.go index c530c826..573d2370 100644 --- a/internal/gui/account.go +++ b/internal/gui/account.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2021 The Decred developers +// Copyright (c) 2020-2024 The Decred developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. @@ -7,7 +7,7 @@ package gui import ( "net/http" - "github.com/decred/dcrpool/pool" + "github.com/decred/dcrpool/internal/pool" "github.com/gorilla/csrf" ) diff --git a/internal/gui/admin.go b/internal/gui/admin.go index 514a13ea..b15dc22f 100644 --- a/internal/gui/admin.go +++ b/internal/gui/admin.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2021 The Decred developers +// Copyright (c) 2020-2024 The Decred developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. @@ -7,7 +7,7 @@ package gui import ( "net/http" - "github.com/decred/dcrpool/pool" + "github.com/decred/dcrpool/internal/pool" "github.com/gorilla/csrf" "github.com/gorilla/sessions" ) diff --git a/internal/gui/cache.go b/internal/gui/cache.go index 955f21eb..b7857b50 100644 --- a/internal/gui/cache.go +++ b/internal/gui/cache.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2021 The Decred developers +// Copyright (c) 2020-2024 The Decred developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. @@ -11,7 +11,7 @@ import ( "sync" "github.com/decred/dcrd/dcrutil/v4" - "github.com/decred/dcrpool/pool" + "github.com/decred/dcrpool/internal/pool" ) // client represents a mining client. It is json annotated so it can easily be diff --git a/internal/gui/gui.go b/internal/gui/gui.go index 59ff2e9e..29ea348b 100644 --- a/internal/gui/gui.go +++ b/internal/gui/gui.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 The Decred developers +// Copyright (c) 2020-2024 The Decred developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. @@ -24,7 +24,7 @@ import ( "github.com/gorilla/mux" "github.com/gorilla/sessions" - "github.com/decred/dcrpool/pool" + "github.com/decred/dcrpool/internal/pool" ) // Config contains all of the required configuration values for the GUI diff --git a/internal/gui/middleware.go b/internal/gui/middleware.go index c481cee5..2d46e844 100644 --- a/internal/gui/middleware.go +++ b/internal/gui/middleware.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2021 The Decred developers +// Copyright (c) 2020-2024 The Decred developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. @@ -9,7 +9,7 @@ import ( "net/http" "strings" - "github.com/decred/dcrpool/pool" + "github.com/decred/dcrpool/internal/pool" "github.com/gorilla/sessions" ) diff --git a/internal/gui/pagination.go b/internal/gui/pagination.go index c1f9fc15..66ba27de 100644 --- a/internal/gui/pagination.go +++ b/internal/gui/pagination.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2021 The Decred developers +// Copyright (c) 2020-2024 The Decred developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. @@ -10,7 +10,7 @@ import ( "net/http" "strconv" - "github.com/decred/dcrpool/pool" + "github.com/decred/dcrpool/internal/pool" "github.com/gorilla/mux" "github.com/gorilla/sessions" ) diff --git a/pool/acceptedwork.go b/internal/pool/acceptedwork.go similarity index 100% rename from pool/acceptedwork.go rename to internal/pool/acceptedwork.go diff --git a/pool/acceptedwork_test.go b/internal/pool/acceptedwork_test.go similarity index 100% rename from pool/acceptedwork_test.go rename to internal/pool/acceptedwork_test.go diff --git a/pool/account.go b/internal/pool/account.go similarity index 100% rename from pool/account.go rename to internal/pool/account.go diff --git a/pool/account_test.go b/internal/pool/account_test.go similarity index 100% rename from pool/account_test.go rename to internal/pool/account_test.go diff --git a/pool/boltdb.go b/internal/pool/boltdb.go similarity index 100% rename from pool/boltdb.go rename to internal/pool/boltdb.go diff --git a/pool/boltupgrades.go b/internal/pool/boltupgrades.go similarity index 100% rename from pool/boltupgrades.go rename to internal/pool/boltupgrades.go diff --git a/pool/boltupgrades_test.go b/internal/pool/boltupgrades_test.go similarity index 100% rename from pool/boltupgrades_test.go rename to internal/pool/boltupgrades_test.go diff --git a/pool/chainstate.go b/internal/pool/chainstate.go similarity index 100% rename from pool/chainstate.go rename to internal/pool/chainstate.go diff --git a/pool/chainstate_test.go b/internal/pool/chainstate_test.go similarity index 100% rename from pool/chainstate_test.go rename to internal/pool/chainstate_test.go diff --git a/pool/client.go b/internal/pool/client.go similarity index 100% rename from pool/client.go rename to internal/pool/client.go diff --git a/pool/client_test.go b/internal/pool/client_test.go similarity index 100% rename from pool/client_test.go rename to internal/pool/client_test.go diff --git a/pool/database.go b/internal/pool/database.go similarity index 100% rename from pool/database.go rename to internal/pool/database.go diff --git a/pool/db_test.go b/internal/pool/db_test.go similarity index 100% rename from pool/db_test.go rename to internal/pool/db_test.go diff --git a/pool/difficulty.go b/internal/pool/difficulty.go similarity index 100% rename from pool/difficulty.go rename to internal/pool/difficulty.go diff --git a/pool/difficulty_test.go b/internal/pool/difficulty_test.go similarity index 100% rename from pool/difficulty_test.go rename to internal/pool/difficulty_test.go diff --git a/pool/endpoint.go b/internal/pool/endpoint.go similarity index 100% rename from pool/endpoint.go rename to internal/pool/endpoint.go diff --git a/pool/endpoint_test.go b/internal/pool/endpoint_test.go similarity index 100% rename from pool/endpoint_test.go rename to internal/pool/endpoint_test.go diff --git a/pool/hashdata.go b/internal/pool/hashdata.go similarity index 100% rename from pool/hashdata.go rename to internal/pool/hashdata.go diff --git a/pool/hashdata_test.go b/internal/pool/hashdata_test.go similarity index 100% rename from pool/hashdata_test.go rename to internal/pool/hashdata_test.go diff --git a/pool/hub.go b/internal/pool/hub.go similarity index 100% rename from pool/hub.go rename to internal/pool/hub.go diff --git a/pool/hub_test.go b/internal/pool/hub_test.go similarity index 100% rename from pool/hub_test.go rename to internal/pool/hub_test.go diff --git a/pool/job.go b/internal/pool/job.go similarity index 100% rename from pool/job.go rename to internal/pool/job.go diff --git a/pool/job_test.go b/internal/pool/job_test.go similarity index 100% rename from pool/job_test.go rename to internal/pool/job_test.go diff --git a/pool/limiter.go b/internal/pool/limiter.go similarity index 100% rename from pool/limiter.go rename to internal/pool/limiter.go diff --git a/pool/limiter_test.go b/internal/pool/limiter_test.go similarity index 100% rename from pool/limiter_test.go rename to internal/pool/limiter_test.go diff --git a/pool/log.go b/internal/pool/log.go similarity index 100% rename from pool/log.go rename to internal/pool/log.go diff --git a/pool/message.go b/internal/pool/message.go similarity index 100% rename from pool/message.go rename to internal/pool/message.go diff --git a/pool/message_test.go b/internal/pool/message_test.go similarity index 100% rename from pool/message_test.go rename to internal/pool/message_test.go diff --git a/pool/minerid.go b/internal/pool/minerid.go similarity index 100% rename from pool/minerid.go rename to internal/pool/minerid.go diff --git a/pool/minerid_test.go b/internal/pool/minerid_test.go similarity index 100% rename from pool/minerid_test.go rename to internal/pool/minerid_test.go diff --git a/pool/payment.go b/internal/pool/payment.go similarity index 100% rename from pool/payment.go rename to internal/pool/payment.go diff --git a/pool/payment_test.go b/internal/pool/payment_test.go similarity index 100% rename from pool/payment_test.go rename to internal/pool/payment_test.go diff --git a/pool/paymentmgr.go b/internal/pool/paymentmgr.go similarity index 100% rename from pool/paymentmgr.go rename to internal/pool/paymentmgr.go diff --git a/pool/paymentmgr_test.go b/internal/pool/paymentmgr_test.go similarity index 100% rename from pool/paymentmgr_test.go rename to internal/pool/paymentmgr_test.go diff --git a/pool/pool_test.go b/internal/pool/pool_test.go similarity index 100% rename from pool/pool_test.go rename to internal/pool/pool_test.go diff --git a/pool/postgres.go b/internal/pool/postgres.go similarity index 100% rename from pool/postgres.go rename to internal/pool/postgres.go diff --git a/pool/share.go b/internal/pool/share.go similarity index 100% rename from pool/share.go rename to internal/pool/share.go diff --git a/pool/share_test.go b/internal/pool/share_test.go similarity index 100% rename from pool/share_test.go rename to internal/pool/share_test.go diff --git a/pool/sql_queries.go b/internal/pool/sql_queries.go similarity index 100% rename from pool/sql_queries.go rename to internal/pool/sql_queries.go diff --git a/log.go b/log.go index f1e67f5f..188e94c1 100644 --- a/log.go +++ b/log.go @@ -14,7 +14,7 @@ import ( "github.com/jrick/logrotate/rotator" "github.com/decred/dcrpool/internal/gui" - "github.com/decred/dcrpool/pool" + "github.com/decred/dcrpool/internal/pool" ) // logWriter implements an io.Writer that outputs to both standard output and