Skip to content

Commit

Permalink
Fix integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
2opremio committed Jan 30, 2025
1 parent 5589471 commit 8b68c6b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package integrationtest

import (
"context"
"errors"
"testing"

"github.com/creachadair/jrpc2"
Expand Down Expand Up @@ -60,9 +59,8 @@ func TestGetLedgerEntriesInvalidParams(t *testing.T) {
}

_, err := client.GetLedgerEntries(context.Background(), request)
require.ErrorAs(t, err, &jrpc2.Error{})
var jsonRPCErr *jrpc2.Error
errors.As(err, &jsonRPCErr)
require.ErrorAs(t, err, &jsonRPCErr)
assert.Contains(t, jsonRPCErr.Message, "cannot unmarshal key value")
assert.Equal(t, jrpc2.InvalidParams, jsonRPCErr.Code)
}
Expand Down
4 changes: 1 addition & 3 deletions cmd/stellar-rpc/internal/integrationtest/transaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package integrationtest

import (
"context"
"errors"
"testing"

"github.com/creachadair/jrpc2"
Expand Down Expand Up @@ -196,9 +195,8 @@ func TestSendTransactionFailedInvalidXDR(t *testing.T) {

request := protocol.SendTransactionRequest{Transaction: "abcdef"}
_, err := client.SendTransaction(context.Background(), request)
require.ErrorAs(t, err, &jrpc2.Error{})
var jsonRPCErr *jrpc2.Error
errors.As(err, &jsonRPCErr)
require.ErrorAs(t, err, &jsonRPCErr)
require.Equal(t, "invalid_xdr", jsonRPCErr.Message)
require.Equal(t, jrpc2.InvalidParams, jsonRPCErr.Code)
}
Expand Down

0 comments on commit 8b68c6b

Please sign in to comment.