diff --git a/transactions.go b/transactions.go index 3c4bebc..063b997 100644 --- a/transactions.go +++ b/transactions.go @@ -75,8 +75,3 @@ func (b *BuxClient) SendToRecipients(ctx context.Context, recipients []*transpor return b.RecordTransaction(ctx, hex, draft.ID, metadata) } - -// UnreserveUtxos unreserves utxos from draft transaction -func (b *BuxClient) UnreserveUtxos(ctx context.Context, referenceID string) transports.ResponseError { - return b.transport.UnreserveUtxos(ctx, referenceID) -} diff --git a/transactions_test.go b/transactions_test.go index e2a85df..5042410 100644 --- a/transactions_test.go +++ b/transactions_test.go @@ -264,18 +264,19 @@ func TestTransactions(t *testing.T) { assert.Len(t, txDraft.Outputs, len(fixtures.DraftTx.Configuration.Outputs)) }) - t.Run("UnreserveUtxos", func(t *testing.T) { + t.Run("CountUtxos", func(t *testing.T) { // given transportHandler := testTransportHandler{ Type: fixtures.RequestType, - Path: "/utxo/unreserve", + Path: "/utxo/count", ClientURL: fixtures.ServerURL, + Result: "0", Client: WithHTTPClient, } client := getTestBuxClient(transportHandler, false) // when - err := client.UnreserveUtxos(context.Background(), fixtures.DraftTx.Configuration.Outputs[0].PaymailP4.ReferenceID) + _, err := client.GetUtxosCount(context.Background(), map[string]interface{}{}, fixtures.TestMetadata) // then assert.NoError(t, err) diff --git a/transports/http.go b/transports/http.go index 9a8778b..71615fd 100644 --- a/transports/http.go +++ b/transports/http.go @@ -581,18 +581,6 @@ func (h *TransportHTTP) GetUtxosCount(ctx context.Context, conditions map[string return count, nil } -// UnreserveUtxos will unreserve utxos from draft transaction -func (h *TransportHTTP) UnreserveUtxos(ctx context.Context, referenceID string) ResponseError { - jsonStr, err := json.Marshal(map[string]interface{}{ - FieldReferenceID: referenceID, - }) - if err != nil { - return WrapError(err) - } - - return h.doHTTPRequest(ctx, http.MethodPatch, "/utxo/unreserve", jsonStr, h.xPriv, h.signRequest, nil) -} - // createSignatureAccessKey will create a signature for the given access key & body contents func createSignatureAccessKey(privateKeyHex, bodyString string) (payload *buxmodels.AuthPayload, err error) { // No key? diff --git a/transports/interface.go b/transports/interface.go index 1426627..a1f0136 100644 --- a/transports/interface.go +++ b/transports/interface.go @@ -49,7 +49,6 @@ type TransactionService interface { GetUtxo(ctx context.Context, txID string, outputIndex uint32) (*buxmodels.Utxo, ResponseError) GetUtxos(ctx context.Context, conditions map[string]interface{}, metadata *buxmodels.Metadata, queryParams *QueryParams) ([]*buxmodels.Utxo, ResponseError) GetUtxosCount(ctx context.Context, conditions map[string]interface{}, metadata *buxmodels.Metadata) (int64, ResponseError) - UnreserveUtxos(ctx context.Context, referenceID string) ResponseError } // PaymailService is the paymail related requests