Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

httphandler: tss api endpoints #54

Merged
merged 145 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
145 commits
Select commit Hold shift + click to select a range
a58d519
tables and interfaces for TSS
gouthamp-stellar Aug 30, 2024
9920f48
TSS tables and the channel interface
gouthamp-stellar Aug 30, 2024
3f9f9f0
remove empty lines
gouthamp-stellar Aug 30, 2024
373c71a
update
gouthamp-stellar Aug 30, 2024
2de9898
adding semicolons
gouthamp-stellar Aug 30, 2024
c0f9d32
moving all migrations to one file
gouthamp-stellar Aug 30, 2024
a9cf4e3
make hash primary key instead of xdr
gouthamp-stellar Sep 3, 2024
6fc0dc2
missing ,
gouthamp-stellar Sep 3, 2024
fb807aa
remove the index on try_transaction_xdr and add column/index on try_t…
gouthamp-stellar Sep 3, 2024
f8c261b
Squashed commit of the following:
gouthamp-stellar Sep 4, 2024
d774f2a
commit #2
gouthamp-stellar Sep 5, 2024
6b04d62
changing from RpcIngestTxResponse -> RpcGetIngestTxResponse
gouthamp-stellar Sep 5, 2024
f2fefef
Merge branch 'tss_tables_interfaces' into transaction_module
gouthamp-stellar Sep 5, 2024
b441a31
latest changes
gouthamp-stellar Sep 7, 2024
02c7de3
add tests for ValidateOptions
gouthamp-stellar Sep 8, 2024
f9a5611
changes based on comments
gouthamp-stellar Sep 10, 2024
32bd6ce
Merge branch 'main' into tss_tables_interfaces
gouthamp-stellar Sep 10, 2024
5c7db27
Merge branch 'tss_tables_interfaces' into transaction_module
gouthamp-stellar Sep 10, 2024
c3e8de9
latest changes based on changes to interface
gouthamp-stellar Sep 10, 2024
82b12fb
string -> RPCTXStatus
gouthamp-stellar Sep 10, 2024
9a9c9be
Merge branch 'tss_tables_interfaces' into transaction_module
gouthamp-stellar Sep 10, 2024
0662da9
adding a transaction_builder.go which takes a list of operation xdrs …
gouthamp-stellar Sep 11, 2024
8f76d61
moving transaction_service to the utils dir
gouthamp-stellar Sep 11, 2024
456b71f
upper case Channel methods
gouthamp-stellar Sep 11, 2024
7974aa9
Merge branch 'tss_tables_interfaces' into transaction_module
gouthamp-stellar Sep 11, 2024
5bdf8f2
latest changes
gouthamp-stellar Sep 12, 2024
3890bfe
p.txService.NetworkPassPhrase()
gouthamp-stellar Sep 12, 2024
e87c6d6
last commit before writing unit tests
gouthamp-stellar Sep 13, 2024
c1d3786
Making the transaction service more injectible and adding fields to t…
gouthamp-stellar Sep 13, 2024
01ed3eb
typo
gouthamp-stellar Sep 13, 2024
3ddd2bd
typo
gouthamp-stellar Sep 13, 2024
5776cb1
Update 2024-08-28.0-tss_transactions.sql
gouthamp-stellar Sep 13, 2024
2c6db84
Merge branch 'main' into transaction_module
gouthamp-stellar Sep 13, 2024
77a6e4b
lint errors
gouthamp-stellar Sep 13, 2024
01109ab
go mod tidy
gouthamp-stellar Sep 13, 2024
c005a06
Merge branch 'main' into transaction_module
gouthamp-stellar Sep 13, 2024
f560a05
Merge branch 'transaction_module' into rpc_caller_service
gouthamp-stellar Sep 13, 2024
38ba21b
test cases + other changes
gouthamp-stellar Sep 15, 2024
8ddb961
remoce unused mocks
gouthamp-stellar Sep 15, 2024
d32adb1
error handler service returns errorHandlerService
gouthamp-stellar Sep 15, 2024
e0727b5
changes based on comments
gouthamp-stellar Sep 18, 2024
968a6b7
lint deadcode error - suppress for now
gouthamp-stellar Sep 18, 2024
096c7bd
removed deadcode
gouthamp-stellar Sep 18, 2024
6cfc3fd
changes after comments on transaction service pr
gouthamp-stellar Sep 18, 2024
c195365
TSS Error Handler Service
gouthamp-stellar Sep 19, 2024
da2b40b
removing print statements
gouthamp-stellar Sep 19, 2024
b71e342
Update transaction_service.go
gouthamp-stellar Sep 19, 2024
ccf27f1
responding to comments
gouthamp-stellar Sep 20, 2024
8045d8d
remove commented code
gouthamp-stellar Sep 20, 2024
d062a11
tx service changes
gouthamp-stellar Sep 20, 2024
1a3c17c
remove comment
gouthamp-stellar Sep 20, 2024
174ed45
remove comment
gouthamp-stellar Sep 20, 2024
9492d71
latest tx service changes
gouthamp-stellar Sep 20, 2024
5d31b01
adding a router + utils file
gouthamp-stellar Sep 20, 2024
a6dc954
removing println
gouthamp-stellar Sep 20, 2024
e28ff02
changed function name
gouthamp-stellar Sep 20, 2024
3d69601
commit #1
gouthamp-stellar Sep 21, 2024
43fcf10
Code() helper function on RPCTXCode
gouthamp-stellar Sep 21, 2024
4793f90
Code()
gouthamp-stellar Sep 21, 2024
a401c30
Merge branch 'error_handler_service' into webhook_handler_service
gouthamp-stellar Sep 21, 2024
b5d46da
Delete .env.swp
gouthamp-stellar Sep 21, 2024
b4ab5de
adding a helpers file
gouthamp-stellar Sep 21, 2024
f10d239
removing BuildTestFeeBumpTransaction
gouthamp-stellar Sep 21, 2024
d679abd
adding to serve.go etc
gouthamp-stellar Sep 22, 2024
db8714d
casing
gouthamp-stellar Sep 22, 2024
2c0d060
better test for Send
gouthamp-stellar Sep 23, 2024
b82a25a
Merge branch 'transaction_module' into rpc_caller_service
gouthamp-stellar Sep 23, 2024
97da8d6
Merge branch 'rpc_caller_service' into error_handler_service
gouthamp-stellar Sep 23, 2024
9d1266b
resolving merge conflicts
gouthamp-stellar Sep 23, 2024
ea229bb
Merge branch 'error_handler_service' into webhook_handler_service
gouthamp-stellar Sep 23, 2024
a196677
removing mockSleep
gouthamp-stellar Sep 23, 2024
875b1dd
delete channels/mocks.go
gouthamp-stellar Sep 23, 2024
d1eee64
Merge branch 'error_handler_service' into webhook_handler_service
gouthamp-stellar Sep 23, 2024
aff5ed4
sleep -> time.Sleep
gouthamp-stellar Sep 23, 2024
101bd43
Merge branch 'main' into rpc_caller_service
gouthamp-stellar Sep 25, 2024
637aeaf
incorporating Daniel's changes + comments
gouthamp-stellar Sep 26, 2024
0fb94e3
delete files
gouthamp-stellar Sep 26, 2024
df7ae05
remove unused code
gouthamp-stellar Sep 26, 2024
cf2dc18
name change
gouthamp-stellar Sep 26, 2024
16581fd
remove commented code
gouthamp-stellar Sep 26, 2024
ab7c0d7
moving the mocks file inside servicesmocks dir
gouthamp-stellar Sep 26, 2024
5fe5d0b
name changes
gouthamp-stellar Sep 26, 2024
76df04b
refactor
gouthamp-stellar Sep 26, 2024
49ec16b
Merge branch 'rpc_caller_service' into error_handler_service
gouthamp-stellar Sep 26, 2024
3b174b8
changes to serve.go
gouthamp-stellar Sep 26, 2024
22ed801
checking error on route.Route
gouthamp-stellar Sep 26, 2024
9cb0145
check error
gouthamp-stellar Sep 26, 2024
78042c9
Merge branch 'main' into rpc_caller_service
gouthamp-stellar Sep 26, 2024
9118a06
merging main
gouthamp-stellar Sep 26, 2024
12425f9
fixing parsesendresp tests
gouthamp-stellar Sep 26, 2024
897a218
Merge branch 'rpc_caller_service' into error_handler_service
gouthamp-stellar Sep 26, 2024
6e93627
commit changes
gouthamp-stellar Sep 26, 2024
56f8e5a
Merge branch 'error_handler_service' into webhook_handler_service
gouthamp-stellar Sep 26, 2024
4e324a6
merging in changes from eror_handler_service
gouthamp-stellar Sep 26, 2024
4fff039
delete file
gouthamp-stellar Sep 26, 2024
f4aaf93
commit current changes before merging branch
gouthamp-stellar Sep 27, 2024
d9283bf
Merge branch 'webhook_handler_service' into rpc_ingestor
gouthamp-stellar Sep 27, 2024
f139f7a
rpc ingestor
gouthamp-stellar Sep 30, 2024
edcd0e7
delete file
gouthamp-stellar Sep 30, 2024
cd321ae
fix lint errors
gouthamp-stellar Sep 30, 2024
43711ca
remove dead code
gouthamp-stellar Sep 30, 2024
757e6d5
fix broken test + delete unused code
gouthamp-stellar Sep 30, 2024
42edf1f
tidy mod
gouthamp-stellar Sep 30, 2024
5ff3984
remove commented code
gouthamp-stellar Sep 30, 2024
715ae3f
delete file
gouthamp-stellar Sep 30, 2024
6b2a6f7
changes based on comments
gouthamp-stellar Sep 30, 2024
b4f6052
removing test case that is not relevant anymore
gouthamp-stellar Sep 30, 2024
3d6746e
Merge branch 'rpc_caller_service' into error_handler_service
gouthamp-stellar Sep 30, 2024
9be1beb
changes based on prev pr comments
gouthamp-stellar Sep 30, 2024
0df3537
remove fmt.Println
gouthamp-stellar Sep 30, 2024
dc9a363
Merge branch 'error_handler_service' into webhook_handler_service
gouthamp-stellar Oct 1, 2024
8c445f4
merge latest error_handler_service branch + small changes
gouthamp-stellar Oct 1, 2024
2caf65b
%s -> %w
gouthamp-stellar Oct 1, 2024
ab2a546
U -> u
gouthamp-stellar Oct 1, 2024
277b970
Merge branch 'error_handler_service' into webhook_handler_service
gouthamp-stellar Oct 1, 2024
d576a25
variable for channel name
gouthamp-stellar Oct 1, 2024
b2a1cd8
Merge branch 'webhook_handler_service' into rpc_ingestor
gouthamp-stellar Oct 1, 2024
5de4041
account for NewStore returning an error
gouthamp-stellar Oct 1, 2024
a788011
fix build
gouthamp-stellar Oct 1, 2024
22b0438
commit #1
gouthamp-stellar Oct 1, 2024
ef1c7be
tss pool populator
gouthamp-stellar Oct 3, 2024
2f4ae28
typo
gouthamp-stellar Oct 3, 2024
450fd41
typo
gouthamp-stellar Oct 3, 2024
1c2fbeb
tss api endpoints
gouthamp-stellar Oct 7, 2024
55727b6
spaces
gouthamp-stellar Oct 7, 2024
0a05485
changing the tss api endpoint paths
gouthamp-stellar Oct 8, 2024
d0fa39d
Merge branch 'main' into webhook_handler_service
gouthamp-stellar Oct 9, 2024
44cb3ec
merge main
gouthamp-stellar Oct 9, 2024
afebef4
Merge branch 'webhook_handler_service' into rpc_ingestor
gouthamp-stellar Oct 9, 2024
61cf2db
merged latest
gouthamp-stellar Oct 10, 2024
9e5d6e9
Merge branch 'rpc_ingestor' into populate_pools
gouthamp-stellar Oct 10, 2024
acd8e7c
Merge branch 'populate_pools' into tss_api_endpoints
gouthamp-stellar Oct 10, 2024
ad392d8
typo in desc string
gouthamp-stellar Oct 15, 2024
dbe9629
millisecond wait time
gouthamp-stellar Oct 15, 2024
f63304b
Merge branch 'webhook_handler_service' into rpc_ingestor
gouthamp-stellar Oct 15, 2024
0957985
changes based on comments
gouthamp-stellar Oct 15, 2024
39895ad
Merge branch 'rpc_ingestor' into populate_pools
gouthamp-stellar Oct 15, 2024
c889a86
typo
gouthamp-stellar Oct 15, 2024
eb49994
changes based on comments
gouthamp-stellar Oct 16, 2024
f50ba23
fixing migrations
gouthamp-stellar Oct 16, 2024
01f2d49
compare types directly on route
gouthamp-stellar Oct 16, 2024
666d642
Merge branch 'populate_pools' into tss_api_endpoints
gouthamp-stellar Oct 16, 2024
8bb310a
Merge branch 'main' into tss_api_endpoints
gouthamp-stellar Oct 29, 2024
70deac5
changes based on comments
gouthamp-stellar Oct 29, 2024
bf2bebc
remove unused funcs in tss_options.go
gouthamp-stellar Oct 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ func (c *serveCmd) Command() *cobra.Command {
utils.WebhookHandlerChannelMaxWorkersOptions(&cfg.WebhookHandlerServiceChannelMaxWorkers),
utils.WebhookHandlerChannelMaxRetriesOption(&cfg.WebhookHandlerServiceChannelMaxRetries),
utils.WebhookHandlerChannelMinWaitBtwnRetriesMSOption(&cfg.WebhookHandlerServiceChannelMinWaitBtwnRetriesMS),

{
Name: "port",
Usage: "Port to listen and serve on",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ ALTER TABLE tss_transaction_submission_tries
DROP COLUMN result_xdr;

ALTER TABLE tss_transaction_submission_tries
RENAME COLUMN code TO status;
RENAME COLUMN code TO status;
122 changes: 122 additions & 0 deletions internal/serve/httphandler/tss_handler.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
package httphandler

import (
"net/http"

"github.com/stellar/go/support/log"
"github.com/stellar/go/support/render/httpjson"
"github.com/stellar/wallet-backend/internal/apptracker"
"github.com/stellar/wallet-backend/internal/serve/httperror"
"github.com/stellar/wallet-backend/internal/tss"
"github.com/stellar/wallet-backend/internal/tss/router"
"github.com/stellar/wallet-backend/internal/tss/store"
"github.com/stellar/wallet-backend/internal/tss/utils"
)

type TSSHandler struct {
Router router.Router
Store store.Store
AppTracker apptracker.AppTracker
NetworkPassphrase string
}

type Transaction struct {
Operations []string `json:"operations" validate:"required"`
}

type TransactionSubmissionRequest struct {
WebhookURL string `json:"webhook" validate:"required"`
Transactions []Transaction `json:"transactions" validate:"required,gt=0"`
}

type TransactionSubmissionResponse struct {
TransactionHashes []string `json:"transactionhashes"`
}

func (t *TSSHandler) SubmitTransactions(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()

var reqParams TransactionSubmissionRequest
httpErr := DecodeJSONAndValidate(ctx, r, &reqParams, t.AppTracker)
if httpErr != nil {
httpErr.Render(w)
return
}
var transactionHashes []string
var payloads []tss.Payload
for _, transaction := range reqParams.Transactions {
tx, err := utils.BuildOriginalTransaction(transaction.Operations)
if err != nil {
httperror.BadRequest("bad operation xdr", nil).Render(w)
return
}
txHash, err := tx.HashHex(t.NetworkPassphrase)
if err != nil {
httperror.InternalServerError(ctx, "unable to hashhex transaction", err, nil, t.AppTracker).Render(w)
return
}

txXDR, err := tx.Base64()
if err != nil {
httperror.InternalServerError(ctx, "unable to base64 transaction", err, nil, t.AppTracker).Render(w)
return
}

payload := tss.Payload{
TransactionHash: txHash,
TransactionXDR: txXDR,
WebhookURL: reqParams.WebhookURL,
}

payloads = append(payloads, payload)
transactionHashes = append(transactionHashes, txHash)
}
httpjson.Render(w, TransactionSubmissionResponse{
TransactionHashes: transactionHashes,
}, httpjson.JSON)

for _, payload := range payloads {
err := t.Router.Route(payload)
if err != nil {
log.Errorf("unable to route payload: %v", err)
}

}

}

type GetTransactionRequest struct {
TransactionHash string `json:"transactionhash" validate:"required"`
}

type GetTransactionResponse struct {
Hash string `json:"transactionhash"`
XDR string `json:"transactionxdr"`
Status string `json:"status"`
}

func (t *TSSHandler) GetTransaction(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()

var reqParams GetTransactionRequest
httpErr := DecodePathAndValidate(ctx, r, &reqParams, t.AppTracker)
if httpErr != nil {
httpErr.Render(w)
return
}
tx, err := t.Store.GetTransaction(ctx, reqParams.TransactionHash)
if err != nil {
httperror.InternalServerError(ctx, "unable to get transaction "+reqParams.TransactionHash, err, nil, t.AppTracker).Render(w)
return
}

if tx == (store.Transaction{}) {
httperror.NotFound.Render(w)
}

httpjson.Render(w, GetTransactionResponse{
Hash: tx.Hash,
XDR: tx.XDR,
Status: tx.Status,
}, httpjson.JSON)
}
212 changes: 212 additions & 0 deletions internal/serve/httphandler/tss_handler_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
package httphandler

import (
"context"
"encoding/base64"
"encoding/json"
"fmt"
"io"
"net/http"
"net/http/httptest"
"path"
"strings"
"testing"

"github.com/go-chi/chi"
xdr3 "github.com/stellar/go-xdr/xdr3"
"github.com/stellar/go/keypair"
"github.com/stellar/go/txnbuild"
"github.com/stellar/wallet-backend/internal/apptracker"
"github.com/stellar/wallet-backend/internal/db"
"github.com/stellar/wallet-backend/internal/db/dbtest"
"github.com/stellar/wallet-backend/internal/tss"
"github.com/stellar/wallet-backend/internal/tss/router"
"github.com/stellar/wallet-backend/internal/tss/store"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
)

func TestSubmitTransactions(t *testing.T) {
dbt := dbtest.Open(t)
defer dbt.Close()

dbConnectionPool, err := db.OpenDBConnectionPool(dbt.DSN)
require.NoError(t, err)
defer dbConnectionPool.Close()
store, _ := store.NewStore(dbConnectionPool)
mockRouter := router.MockRouter{}
mockAppTracker := apptracker.MockAppTracker{}

handler := &TSSHandler{
Router: &mockRouter,
Store: store,
AppTracker: &mockAppTracker,
NetworkPassphrase: "testnet passphrase",
}

const endpoint = "/tss/transactions"

t.Run("invalid_request_bodies", func(t *testing.T) {
reqBody := `{}`
rw := httptest.NewRecorder()
req := httptest.NewRequest(http.MethodPost, endpoint, strings.NewReader(reqBody))

http.HandlerFunc(handler.SubmitTransactions).ServeHTTP(rw, req)

resp := rw.Result()
respBody, err := io.ReadAll(resp.Body)
require.NoError(t, err)

expectedRespBody := `
{
"error": "Validation error.",
"extras": {
"transactions": "This field is required",
"webhookURL": "This field is required"
}
}`

assert.Equal(t, http.StatusBadRequest, resp.StatusCode)
assert.JSONEq(t, expectedRespBody, string(respBody))

reqBody = fmt.Sprintf(`{
"webhook": "localhost:8080",
"transactions": [{"operations": [%q]}]
}`, "ABCD")
rw = httptest.NewRecorder()
req = httptest.NewRequest(http.MethodPost, endpoint, strings.NewReader(reqBody))

http.HandlerFunc(handler.SubmitTransactions).ServeHTTP(rw, req)

resp = rw.Result()
respBody, err = io.ReadAll(resp.Body)
require.NoError(t, err)

expectedRespBody = `{"error": "bad operation xdr"}`
assert.Equal(t, http.StatusBadRequest, resp.StatusCode)
assert.JSONEq(t, expectedRespBody, string(respBody))

})

t.Run("happy_path", func(t *testing.T) {
srcAccount := keypair.MustRandom().Address()
p := txnbuild.Payment{
Destination: keypair.MustRandom().Address(),
Amount: "10",
Asset: txnbuild.NativeAsset{},
SourceAccount: srcAccount,
}
op, _ := p.BuildXDR()

var buf strings.Builder
enc := xdr3.NewEncoder(&buf)
_ = op.EncodeTo(enc)

opXDR := buf.String()
opXDRBase64 := base64.StdEncoding.EncodeToString([]byte(opXDR))
reqBody := fmt.Sprintf(`{
"webhook": "localhost:8080",
"transactions": [{"operations": [%q]}]
}`, opXDRBase64)

rw := httptest.NewRecorder()
req := httptest.NewRequest(http.MethodPost, endpoint, strings.NewReader(reqBody))

mockRouter.
On("Route", mock.Anything).
Return(nil).
Once()

http.HandlerFunc(handler.SubmitTransactions).ServeHTTP(rw, req)
resp := rw.Result()
respBody, err := io.ReadAll(resp.Body)
require.NoError(t, err)

assert.Equal(t, http.StatusOK, resp.StatusCode)

var txSubmissionResp TransactionSubmissionResponse
_ = json.Unmarshal(respBody, &txSubmissionResp)

assert.Equal(t, 1, len(txSubmissionResp.TransactionHashes))

mockRouter.AssertNumberOfCalls(t, "Route", 1)
})
}

func TestGetTransaction(t *testing.T) {
dbt := dbtest.Open(t)
defer dbt.Close()

dbConnectionPool, err := db.OpenDBConnectionPool(dbt.DSN)
require.NoError(t, err)
defer dbConnectionPool.Close()
store, _ := store.NewStore(dbConnectionPool)
mockRouter := router.MockRouter{}
mockAppTracker := apptracker.MockAppTracker{}

handler := &TSSHandler{
Router: &mockRouter,
Store: store,
AppTracker: &mockAppTracker,
NetworkPassphrase: "testnet passphrase",
}

endpoint := "/tss/transactions"

r := chi.NewRouter()
r.Route(endpoint, func(r chi.Router) {
r.Get("/{transactionhash}", handler.GetTransaction)
})

clearTransactions := func(ctx context.Context) {
_, err = dbConnectionPool.ExecContext(ctx, "TRUNCATE tss_transactions")
require.NoError(t, err)
}

t.Run("returns_transaction", func(t *testing.T) {
txHash := "hash"
ctx := context.Background()
_ = store.UpsertTransaction(ctx, "localhost:8080/webhook", txHash, "xdr", tss.RPCTXStatus{OtherStatus: tss.NewStatus})
req, err := http.NewRequest(http.MethodGet, path.Join(endpoint, txHash), nil)
require.NoError(t, err)

// Serve request
rw := httptest.NewRecorder()
r.ServeHTTP(rw, req)
resp := rw.Result()
respBody, err := io.ReadAll(resp.Body)
require.NoError(t, err)
var getTxResp GetTransactionResponse
_ = json.Unmarshal(respBody, &getTxResp)

assert.Equal(t, http.StatusOK, resp.StatusCode)
assert.Equal(t, "hash", getTxResp.Hash)
assert.Equal(t, "xdr", getTxResp.XDR)
assert.Equal(t, "NEW", getTxResp.Status)

clearTransactions(ctx)
})

t.Run("return_empty_transaction", func(t *testing.T) {
txHash := "hash"
req, err := http.NewRequest(http.MethodGet, path.Join(endpoint, txHash), nil)
require.NoError(t, err)

// Serve request
rw := httptest.NewRecorder()
r.ServeHTTP(rw, req)
resp := rw.Result()
respBody, err := io.ReadAll(resp.Body)
require.NoError(t, err)
var getTxResp GetTransactionResponse
_ = json.Unmarshal(respBody, &getTxResp)

assert.Equal(t, http.StatusNotFound, resp.StatusCode)
assert.Empty(t, getTxResp.Hash)
assert.Empty(t, getTxResp.XDR)
assert.Empty(t, getTxResp.Status)

})

}
Loading