diff --git a/chainstate/chainstate_test.go b/chainstate/chainstate_test.go index 9c1bf827..2e367f51 100644 --- a/chainstate/chainstate_test.go +++ b/chainstate/chainstate_test.go @@ -25,20 +25,18 @@ func NewTestClient(ctx context.Context, t *testing.T, opts ...ClientOps) ClientI func TestQueryTransactionFastest(t *testing.T) { t.Run("no tx ID", func(t *testing.T) { ctx := context.Background() - c, err := NewClient(ctx, WithMinercraft(&MinerCraftBase{})) - require.NoError(t, err) + c := NewTestClient(ctx, t, WithMinercraft(&minerCraftTxOnChain{})) - _, err = c.QueryTransactionFastest(ctx, "", RequiredInMempool, 5*time.Second) + _, err := c.QueryTransactionFastest(ctx, "", RequiredInMempool, 5*time.Second) require.Error(t, err) }) t.Run("fastest query", func(t *testing.T) { ctx := context.Background() - c, err := NewClient(ctx, WithMinercraft(&MinerCraftBase{})) - require.NoError(t, err) + c := NewTestClient(ctx, t, WithMinercraft(&minerCraftTxOnChain{})) var txInfo *TransactionInfo - txInfo, err = c.QueryTransactionFastest(ctx, testTransactionID, RequiredInMempool, 5*time.Second) + txInfo, err := c.QueryTransactionFastest(ctx, onChainExample1TxID, RequiredInMempool, 5*time.Second) require.NoError(t, err) assert.NotNil(t, txInfo) }) diff --git a/chainstate/client_options.go b/chainstate/client_options.go index 38801f0c..5a974b53 100644 --- a/chainstate/client_options.go +++ b/chainstate/client_options.go @@ -143,15 +143,6 @@ func WithWhatsOnChain(client whatsonchain.ClientInterface) ClientOps { } } -// WithWhatsOnChainAPIKey will set a custom WhatsOnChain API key -func WithWhatsOnChainAPIKey(apiKey string) ClientOps { - return func(c *clientOptions) { - if len(apiKey) > 0 { - c.config.whatsOnChainAPIKey = apiKey - } - } -} - // WithBroadcastMiners will set a list of miners for broadcasting func WithBroadcastMiners(miners []*Miner) ClientOps { return func(c *clientOptions) { diff --git a/chainstate/client_options_test.go b/chainstate/client_options_test.go index faafee78..c6767691 100644 --- a/chainstate/client_options_test.go +++ b/chainstate/client_options_test.go @@ -116,7 +116,7 @@ func TestWithWhatsOnChain(t *testing.T) { t.Parallel() t.Run("check type", func(t *testing.T) { - opt := WithWhatsOnChain(nil) + opt := WithMinercraft(nil) assert.IsType(t, *new(ClientOps), opt) }) @@ -124,48 +124,10 @@ func TestWithWhatsOnChain(t *testing.T) { options := &clientOptions{ config: &syncConfig{}, } - opt := WithWhatsOnChain(nil) + opt := WithMinercraft(nil) opt(options) assert.Nil(t, options.config.whatsOnChain) }) - - t.Run("test applying option", func(t *testing.T) { - options := &clientOptions{ - config: &syncConfig{}, - } - customClient := &whatsOnChainTxOnChain{} - opt := WithWhatsOnChain(customClient) - opt(options) - assert.Equal(t, customClient, options.config.whatsOnChain) - }) -} - -// TestWithWhatsOnChainAPIKey will test the method WithWhatsOnChainAPIKey() -func TestWithWhatsOnChainAPIKey(t *testing.T) { - t.Parallel() - - t.Run("check type", func(t *testing.T) { - opt := WithWhatsOnChainAPIKey("") - assert.IsType(t, *new(ClientOps), opt) - }) - - t.Run("test applying empty string", func(t *testing.T) { - options := &clientOptions{ - config: &syncConfig{}, - } - opt := WithWhatsOnChainAPIKey("") - opt(options) - assert.Equal(t, "", options.config.whatsOnChainAPIKey) - }) - - t.Run("test applying option", func(t *testing.T) { - options := &clientOptions{ - config: &syncConfig{}, - } - opt := WithWhatsOnChainAPIKey(testDummyKey) - opt(options) - assert.Equal(t, testDummyKey, options.config.whatsOnChainAPIKey) - }) } // TestWithBroadcastMiners will test the method WithBroadcastMiners() diff --git a/chainstate/client_test.go b/chainstate/client_test.go index 2b8e261c..ec6d48a3 100644 --- a/chainstate/client_test.go +++ b/chainstate/client_test.go @@ -59,17 +59,6 @@ func TestNewClient(t *testing.T) { assert.Equal(t, customClient, c.WhatsOnChain()) }) - t.Run("custom whats on chain api key", func(t *testing.T) { - c, err := NewClient( - context.Background(), - WithWhatsOnChainAPIKey(testDummyKey), - WithMinercraft(&MinerCraftBase{}), - ) - require.NoError(t, err) - require.NotNil(t, c) - assert.NotNil(t, c.WhatsOnChain()) - }) - t.Run("custom minercraft client", func(t *testing.T) { customClient, err := minercraft.NewClient( minercraft.DefaultClientOptions(), nil, "", nil, nil, diff --git a/chainstate/mock_whatsonchain_test.go b/chainstate/mock_whatsonchain_test.go deleted file mode 100644 index 1ad3c257..00000000 --- a/chainstate/mock_whatsonchain_test.go +++ /dev/null @@ -1,270 +0,0 @@ -package chainstate - -import ( - "context" - "errors" - "time" - - "github.com/centrifugal/centrifuge-go" - "github.com/libsv/go-bt/v2" - "github.com/mrz1836/go-whatsonchain" -) - -type whatsOnChainBase struct{} - -func (w *whatsOnChainBase) AddressBalance(context.Context, string) (balance *whatsonchain.AddressBalance, err error) { - return -} - -func (w *whatsOnChainBase) AddressHistory(context.Context, string) (history whatsonchain.AddressHistory, err error) { - return -} - -func (w *whatsOnChainBase) AddressInfo(context.Context, string) (addressInfo *whatsonchain.AddressInfo, err error) { - return -} - -func (w *whatsOnChainBase) AddressUnspentTransactionDetails(context.Context, string, int) (history whatsonchain.AddressHistory, err error) { - return -} - -func (w *whatsOnChainBase) AddressUnspentTransactions(context.Context, string) (history whatsonchain.AddressHistory, err error) { - return -} - -func (w *whatsOnChainBase) BroadcastTx(context.Context, string) (txID string, err error) { - return -} - -func (w *whatsOnChainBase) BulkBalance(context.Context, *whatsonchain.AddressList) (balances whatsonchain.AddressBalances, err error) { - return -} - -func (w *whatsOnChainBase) BulkBroadcastTx(context.Context, []string, bool) (response *whatsonchain.BulkBroadcastResponse, err error) { - return -} - -func (w *whatsOnChainBase) BulkScriptUnspentTransactions(context.Context, *whatsonchain.ScriptsList) (response whatsonchain.BulkScriptUnspentResponse, err error) { - return -} - -func (w *whatsOnChainBase) BulkTransactionDetails(context.Context, *whatsonchain.TxHashes) (txList whatsonchain.TxList, err error) { - return -} - -func (w *whatsOnChainBase) BulkTransactionDetailsProcessor(context.Context, *whatsonchain.TxHashes) (txList whatsonchain.TxList, err error) { - return -} - -func (w *whatsOnChainBase) BulkUnspentTransactions(context.Context, *whatsonchain.AddressList) (response whatsonchain.BulkUnspentResponse, err error) { - return -} - -func (w *whatsOnChainBase) BulkUnspentTransactionsProcessor(context.Context, *whatsonchain.AddressList) (response whatsonchain.BulkUnspentResponse, err error) { - return -} - -func (w *whatsOnChainBase) DecodeTransaction(context.Context, string) (txInfo *whatsonchain.TxInfo, err error) { - return -} - -func (w *whatsOnChainBase) DownloadReceipt(context.Context, string) (string, error) { - return "", nil -} - -func (w *whatsOnChainBase) DownloadStatement(context.Context, string) (string, error) { - return "", nil -} - -func (w *whatsOnChainBase) GetBlockByHash(context.Context, string) (blockInfo *whatsonchain.BlockInfo, err error) { - return -} - -func (w *whatsOnChainBase) GetBlockByHeight(context.Context, int64) (blockInfo *whatsonchain.BlockInfo, err error) { - return -} - -func (w *whatsOnChainBase) GetBlockPages(context.Context, string, int) (txList whatsonchain.BlockPagesInfo, err error) { - return -} - -func (w *whatsOnChainBase) GetChainInfo(context.Context) (chainInfo *whatsonchain.ChainInfo, err error) { - return -} - -func (w *whatsOnChainBase) GetCirculatingSupply(context.Context) (supply float64, err error) { - return -} - -func (w *whatsOnChainBase) GetExchangeRate(context.Context) (rate *whatsonchain.ExchangeRate, err error) { - return -} - -func (w *whatsOnChainBase) GetExplorerLinks(context.Context, string) (results whatsonchain.SearchResults, err error) { - return -} - -func (w *whatsOnChainBase) GetHeaderByHash(context.Context, string) (headerInfo *whatsonchain.BlockInfo, err error) { - return -} - -func (w *whatsOnChainBase) GetHeaders(context.Context) (blockHeaders []*whatsonchain.BlockInfo, err error) { - return -} - -func (w *whatsOnChainBase) GetHealth(context.Context) (string, error) { - return "", nil -} - -func (w *whatsOnChainBase) GetMempoolInfo(context.Context) (info *whatsonchain.MempoolInfo, err error) { - return -} - -func (w *whatsOnChainBase) GetMempoolTransactions(context.Context) (transactions []string, err error) { - return -} - -func (w *whatsOnChainBase) GetMerkleProof(context.Context, string) (merkleResults whatsonchain.MerkleResults, err error) { - return -} - -func (w *whatsOnChainBase) GetMerkleProofTSC(context.Context, string) (merkleResults whatsonchain.MerkleTSCResults, err error) { - return -} - -func (w *whatsOnChainBase) GetRawTransactionData(context.Context, string) (string, error) { - return "", nil -} - -func (w *whatsOnChainBase) BulkRawTransactionDataProcessor(context.Context, *whatsonchain.TxHashes) (whatsonchain.TxList, error) { - return nil, nil -} - -func (w *whatsOnChainBase) GetRawTransactionOutputData(context.Context, string, int) (string, error) { - return "", nil -} - -func (w *whatsOnChainBase) GetScriptHistory(context.Context, string) (history whatsonchain.ScriptList, err error) { - return -} - -func (w *whatsOnChainBase) GetScriptUnspentTransactions(context.Context, string) (scriptList whatsonchain.ScriptList, err error) { - return -} - -func (w *whatsOnChainBase) GetTxByHash(context.Context, string) (txInfo *whatsonchain.TxInfo, err error) { - return -} - -func (w *whatsOnChainBase) NewMempoolWebsocket(whatsonchain.SocketHandler) *centrifuge.Client { - return nil -} - -func (w *whatsOnChainBase) NewBlockHeadersWebsocket(whatsonchain.SocketHandler) *centrifuge.Client { - return nil -} - -func (w *whatsOnChainBase) HTTPClient() whatsonchain.HTTPInterface { - return nil -} - -func (w *whatsOnChainBase) LastRequest() *whatsonchain.LastRequest { - return nil -} - -func (w *whatsOnChainBase) Network() whatsonchain.NetworkType { - return whatsonchain.NetworkMain -} - -func (w *whatsOnChainBase) UserAgent() string { - return "default-user-agent" -} - -func (w *whatsOnChainBase) RateLimit() int { - return 3 -} - -type whatsOnChainTxOnChain struct { - whatsOnChainBase -} - -func (w *whatsOnChainTxOnChain) BroadcastTx(context.Context, string) (string, error) { - return "", errors.New("unexpected response code 500: 257: txn-already-known") -} - -func (w *whatsOnChainTxOnChain) GetTxByHash(_ context.Context, hash string) (txInfo *whatsonchain.TxInfo, err error) { - if hash == onChainExample1TxID { - txInfo = &whatsonchain.TxInfo{ - BlockHash: onChainExample1BlockHash, - BlockHeight: onChainExample1BlockHeight, - BlockTime: 1642777896, - Confirmations: onChainExample1Confirmations, - Hash: onChainExample1TxID, - Hex: "01000000025b7439a0c9effa3f19d0e441d2eea596e44a8c49240b6e389c29498285f92ad3010000006a4730440" + - "220482c1c896678d7307e1de35cef2aae4907f2684617a26d8abd24c444d527c80d02204c550f8f9d69b9cf65780e2e0660417" + - "50261702639d02605a2eb694ade4ca1d64121029ce7958b2aa3c627334f50bb810c678e2b284db0ef6f7d067f7fccfa05d0f09" + - "5ffffffff1998b0e4955e1d8ba976d943c43f32e143ba90e805f0e882d3b8edc0f7473b77020000006a47304402204beb486e5" + - "d99a15d4d2267e328abb5466a05fdc20d64903d0ace1c4fabb71a34022024803ae9e18b3c11683b2ff2b5fb4ca973a22fdd390" + - "f6ab1f99396604a3f06af4121038ea0f258fb838b5193e9739ddd808bb97aaab52a60ba8a83958b13109ab183ccffffffff030" + - "000000000000000fd8901006a0372756e0105004d7d017b22696e223a312c22726566223a5b226538643931343037646434616" + - "461643633663337393530323038613835326535623063343830373335636562353461336533343335393461633138396163316" + - "25f6f31222c2237613534646232616230303030616130303531613438323034316233613565376163623938633336313536386" + - "3623334393063666564623066653161356438385f6f33225d2c226f7574223a5b2233356463303036313539393333623438353" + - "433343565663663633363366261663165666462353263343837313933386632366539313034343632313562343036225d2c226" + - "4656c223a5b5d2c22637265223a5b5d2c2265786563223a5b7b226f70223a2243414c4c222c2264617461223a5b7b22246a696" + - "7223a307d2c22757064617465222c5b7b22246a6967223a317d2c7b2267726164756174696f6e506f736974696f6e223a6e756" + - "c6c2c226c6576656c223a382c226e616d65223a22e38395e383abe38380222c227870223a373030307d5d5d7d5d7d110100000" + - "00000001976a914058cae340a2ef8fd2b43a074b75fb6b38cb2765788acd4020000000000001976a914160381a3811b474ff77" + - "f31f64f4e57a5bb5ebf1788ac00000000", - LockTime: 0, - Size: 776, - Time: 1642777896, - TxID: onChainExample1TxID, - Version: 1, - // NOTE: no vin / vout since they are not being used - } - } - return -} - -type whatsOnChainBroadcastSuccess struct { - whatsOnChainBase -} - -func (w *whatsOnChainBroadcastSuccess) BroadcastTx(_ context.Context, hex string) (string, error) { - tx, err := bt.NewTxFromString(hex) - if err != nil { - return "", err - } - - return tx.TxID(), nil -} - -type whatsOnChainInMempool struct { - whatsOnChainBase -} - -func (w *whatsOnChainInMempool) BroadcastTx(_ context.Context, _ string) (string, error) { - return "", errors.New("unexpected response code 500: 257: txn-already-known") -} - -type whatsOnChainTxNotFound struct { - whatsOnChainBase -} - -func (w *whatsOnChainTxNotFound) GetTxByHash(context.Context, string) (txInfo *whatsonchain.TxInfo, err error) { - return nil, whatsonchain.ErrTransactionNotFound -} - -func (w *whatsOnChainTxNotFound) BroadcastTx(context.Context, string) (string, error) { - return "", errors.New("unexpected response code 500: mempool conflict") -} - -type whatsOnChainBroadcastTimeout struct { - whatsOnChainBase -} - -func (w *whatsOnChainBroadcastTimeout) BroadcastTx(_ context.Context, _ string) (string, error) { - time.Sleep(defaultBroadcastTimeOut * 2) - return "", errors.New("unexpected response code 500: 257: txn-already-known") -} diff --git a/chainstate/transaction.go b/chainstate/transaction.go index f19f34b1..5edac2a8 100644 --- a/chainstate/transaction.go +++ b/chainstate/transaction.go @@ -33,15 +33,6 @@ func (c *Client) query(ctx context.Context, id string, requiredIn RequiredIn, } } - // Next: try WhatsOnChain - if !utils.StringInSlice(ProviderWhatsOnChain, c.options.config.excludedProviders) { - if resp, err := queryWhatsOnChain( - ctxWithCancel, c, id, - ); err == nil && checkRequirement(requiredIn, id, resp) { - return resp - } - } - // Next: try with BroadcastClient (if loaded) if !utils.StringInSlice(ProviderBroadcastClient, c.options.config.excludedProviders) { if c.BroadcastClient() != nil { @@ -93,19 +84,6 @@ func (c *Client) fastestQuery(ctx context.Context, id string, requiredIn Require } } - // Backup: WhatsOnChain - if !utils.StringInSlice(ProviderWhatsOnChain, c.options.config.excludedProviders) { - wg.Add(1) - go func(ctx context.Context, client *Client, id string, requiredIn RequiredIn) { - defer wg.Done() - if resp, err := queryWhatsOnChain( - ctx, client, id, - ); err == nil && checkRequirement(requiredIn, id, resp) { - resultsChannel <- resp - } - }(ctxWithCancel, c, id, requiredIn) - } - if !utils.StringInSlice(ProviderBroadcastClient, c.options.config.excludedProviders) { if c.BroadcastClient() != nil { wg.Add(1) @@ -149,25 +127,6 @@ func queryMinercraft(ctx context.Context, client ClientInterface, miner *minercr return nil, ErrTransactionIDMismatch } -// queryWhatsOnChain will request WhatsOnChain for transaction information -func queryWhatsOnChain(ctx context.Context, client ClientInterface, id string) (*TransactionInfo, error) { - client.DebugLog("executing request in whatsonchain") - if resp, err := client.WhatsOnChain().GetTxByHash(ctx, id); err != nil { - client.DebugLog("error executing request in whatsonchain: " + err.Error()) - return nil, err - } else if resp != nil && strings.EqualFold(resp.TxID, id) { - return &TransactionInfo{ - BlockHash: resp.BlockHash, - BlockHeight: resp.BlockHeight, - Confirmations: resp.Confirmations, - ID: resp.TxID, - Provider: ProviderWhatsOnChain, - MinerID: "", - }, nil - } - return nil, ErrTransactionIDMismatch -} - // queryBroadcastClient will submit a query transaction request to a go-broadcast-client func queryBroadcastClient(ctx context.Context, client ClientInterface, id string) (*TransactionInfo, error) { client.DebugLog("executing request in minercraft using " + ProviderBroadcastClient) diff --git a/chainstate/transaction_test.go b/chainstate/transaction_test.go index cc8af955..36671f1e 100644 --- a/chainstate/transaction_test.go +++ b/chainstate/transaction_test.go @@ -35,11 +35,10 @@ func TestClient_Transaction(t *testing.T) { assert.ErrorIs(t, err, ErrInvalidRequirements) }) - t.Run("valid - all three", func(t *testing.T) { + t.Run("valid", func(t *testing.T) { c := NewTestClient( context.Background(), t, WithMinercraft(&minerCraftTxOnChain{}), - WithWhatsOnChain(&whatsOnChainTxOnChain{}), ) info, err := c.QueryTransaction( @@ -56,31 +55,10 @@ func TestClient_Transaction(t *testing.T) { assert.Equal(t, "030d1fe5c1b560efe196ba40540ce9017c20daa9504c4c4cec6184fc702d9f274e", info.MinerID) }) - t.Run("mAPI not found - woc", func(t *testing.T) { - c := NewTestClient( - context.Background(), t, - WithMinercraft(&minerCraftTxNotFound{}), // NOT going to find the TX - WithWhatsOnChain(&whatsOnChainTxOnChain{}), - ) - - info, err := c.QueryTransaction( - context.Background(), onChainExample1TxID, - RequiredOnChain, defaultQueryTimeOut, - ) - require.NoError(t, err) - require.NotNil(t, info) - assert.Equal(t, onChainExample1TxID, info.ID) - assert.Equal(t, onChainExample1BlockHash, info.BlockHash) - assert.Equal(t, onChainExample1BlockHeight, info.BlockHeight) - assert.Equal(t, onChainExample1Confirmations, info.Confirmations) - assert.Equal(t, ProviderWhatsOnChain, info.Provider) - }) - t.Run("error - all not found", func(t *testing.T) { c := NewTestClient( context.Background(), t, - WithMinercraft(&minerCraftTxNotFound{}), // NOT going to find the TX - WithWhatsOnChain(&whatsOnChainTxNotFound{}), // NOT going to find the TX + WithMinercraft(&minerCraftTxNotFound{}), // NOT going to find the TX ) info, err := c.QueryTransaction( @@ -92,32 +70,10 @@ func TestClient_Transaction(t *testing.T) { assert.ErrorIs(t, err, ErrTransactionNotFound) }) - t.Run("valid - stn network", func(t *testing.T) { - c := NewTestClient( - context.Background(), t, - WithMinercraft(&minerCraftTxOnChain{}), - WithWhatsOnChain(&whatsOnChainTxOnChain{}), - WithNetwork(StressTestNet), - ) - - info, err := c.QueryTransaction( - context.Background(), onChainExample1TxID, - RequiredOnChain, defaultQueryTimeOut, - ) - require.NoError(t, err) - require.NotNil(t, info) - assert.Equal(t, onChainExample1TxID, info.ID) - assert.Equal(t, onChainExample1BlockHash, info.BlockHash) - assert.Equal(t, onChainExample1BlockHeight, info.BlockHeight) - assert.Equal(t, onChainExample1Confirmations, info.Confirmations) - assert.Contains(t, []string{ProviderWhatsOnChain}, info.Provider) - }) - t.Run("valid - test network", func(t *testing.T) { c := NewTestClient( context.Background(), t, WithMinercraft(&minerCraftTxOnChain{}), - WithWhatsOnChain(&whatsOnChainTxOnChain{}), WithNetwork(TestNet), ) @@ -161,30 +117,10 @@ func TestClient_TransactionFastest(t *testing.T) { assert.ErrorIs(t, err, ErrInvalidRequirements) }) - t.Run("valid - all three", func(t *testing.T) { + t.Run("valid", func(t *testing.T) { c := NewTestClient( context.Background(), t, WithMinercraft(&minerCraftTxOnChain{}), - WithWhatsOnChain(&whatsOnChainTxOnChain{}), - ) - - info, err := c.QueryTransactionFastest( - context.Background(), onChainExample1TxID, - RequiredOnChain, defaultQueryTimeOut, - ) - require.NoError(t, err) - require.NotNil(t, info) - assert.Equal(t, onChainExample1TxID, info.ID) - assert.Equal(t, onChainExample1BlockHash, info.BlockHash) - assert.Equal(t, onChainExample1BlockHeight, info.BlockHeight) - assert.Equal(t, onChainExample1Confirmations, info.Confirmations) - }) - - t.Run("mAPI not found - woc", func(t *testing.T) { - c := NewTestClient( - context.Background(), t, - WithMinercraft(&minerCraftTxNotFound{}), // NOT going to find the TX - WithWhatsOnChain(&whatsOnChainTxOnChain{}), ) info, err := c.QueryTransactionFastest( @@ -202,8 +138,7 @@ func TestClient_TransactionFastest(t *testing.T) { t.Run("error - all not found", func(t *testing.T) { c := NewTestClient( context.Background(), t, - WithMinercraft(&minerCraftTxNotFound{}), // NOT going to find the TX - WithWhatsOnChain(&whatsOnChainTxNotFound{}), // NOT going to find the TX + WithMinercraft(&minerCraftTxNotFound{}), // NOT going to find the TX ) info, err := c.QueryTransactionFastest( @@ -214,25 +149,4 @@ func TestClient_TransactionFastest(t *testing.T) { require.Nil(t, info) assert.ErrorIs(t, err, ErrTransactionNotFound) }) - - t.Run("valid - stn network", func(t *testing.T) { - c := NewTestClient( - context.Background(), t, - WithMinercraft(&minerCraftTxOnChain{}), - WithWhatsOnChain(&whatsOnChainTxOnChain{}), - WithNetwork(StressTestNet), - ) - - info, err := c.QueryTransactionFastest( - context.Background(), onChainExample1TxID, - RequiredOnChain, defaultQueryTimeOut, - ) - require.NoError(t, err) - require.NotNil(t, info) - assert.Equal(t, onChainExample1TxID, info.ID) - assert.Equal(t, onChainExample1BlockHash, info.BlockHash) - assert.Equal(t, onChainExample1BlockHeight, info.BlockHeight) - assert.Equal(t, onChainExample1Confirmations, info.Confirmations) - assert.Contains(t, []string{ProviderWhatsOnChain}, info.Provider) - }) } diff --git a/client_options.go b/client_options.go index 05fe69b0..5b5342a2 100644 --- a/client_options.go +++ b/client_options.go @@ -650,15 +650,6 @@ func WithQueryMiners(miners []*chainstate.Miner) ClientOps { } } -// WithWhatsOnChainAPIKey will set the API key -func WithWhatsOnChainAPIKey(apiKey string) ClientOps { - return func(c *clientOptions) { - if len(apiKey) > 0 { - c.chainstate.options = append(c.chainstate.options, chainstate.WithWhatsOnChainAPIKey(apiKey)) - } - } -} - // WithExcludedProviders will set a list of excluded providers func WithExcludedProviders(providers []string) ClientOps { return func(c *clientOptions) {