Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,9 @@ jobs:
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: "1.25.10"
# /usr/bin/true replaces test-binary execution, so live integration tests are compiled but never run.
- name: Compile integration-tagged Go tests without running them
run: make test-integration-compile
# The go-ethereum and celo-blockchain packages both implement secp256k1 using the exact same header, but that causes duplicate symbols.
- name: Run golang tests with coverage
run: make test-coverage
Expand Down
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ test-coverage:
@set -o pipefail && (cd node && go test -count=1 -v -timeout 5m -race -cover ./...) 2>&1 | tee coverage.txt
@set -o pipefail && (cd sdk && go test -count=1 -v -timeout 5m -race -cover ./...) 2>&1 | tee -a coverage.txt

.PHONY: test-integration-compile
## Compile integration-tagged Go tests without running live integration tests
# /usr/bin/true replaces test-binary execution, while go test still compiles every selected package and test.
test-integration-compile:
@cd node && go test -tags integration -exec /usr/bin/true ./...
@cd sdk && go test -tags integration -exec /usr/bin/true ./...

.PHONY: test-fast
## Run fast tests for node and sdk, skipping tests gated by testing.Short() and fuzz smoke tests
test-fast:
Expand Down
5 changes: 3 additions & 2 deletions node/pkg/suiclient/suigrpc_live_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,10 @@ func TestGrpcClientGetTransaction(t *testing.T) {
})

require.NoError(t, err)
require.NotNil(t, tx.Digest)
require.NotNil(t, tx.TxDigest)
require.Equal(t, transactionDigest, *tx.TxDigest)

fmt.Println("[+] Transaction Digest: ", *tx.Digest)
fmt.Println("[+] Transaction Digest: ", *tx.TxDigest)
for _, ev := range tx.Events {
fmt.Printf("\tEventType=%s\n", ev.EventType)
fmt.Println("\t\tPackageID:", ev.PackageID)
Expand Down
38 changes: 1 addition & 37 deletions node/pkg/watchers/xrpl/parse_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,13 @@ func TestValidateTransactionResult_Integration(t *testing.T) {
// Verify the transaction is validated
require.True(t, txResp.Validated, "transaction should be validated")

// Create a parser and test validateTransactionResult
parser := NewParser("", nil, nil)

// Create a GenericTx with the transaction result from the response
tx := GenericTx{
Transaction: txResp.TxJSON,
MetaTransactionResult: txResp.Meta.TransactionResult,
}

// Test validateTransactionResult - should succeed for a successful transaction
err = parser.validateTransactionResult(tx)
err = validateTransactionResult(tx)
require.NoError(t, err, "validateTransactionResult should succeed for tesSUCCESS transaction")

// Log some details about the fetched transaction
Expand All @@ -68,38 +64,6 @@ func TestValidateTransactionResult_Integration(t *testing.T) {
t.Logf("Validated: %t", txResp.Validated)
}

// TestValidateTransactionResult_Integration_FailedTransaction tests that
// validateTransactionResult correctly rejects a failed transaction.
func TestValidateTransactionResult_Integration_FailedTransaction(t *testing.T) {
Comment thread
johnsaigle marked this conversation as resolved.
// Create a parser
parser := NewParser("", nil, nil)

// Create a GenericTx with a non-success result
tx := GenericTx{
MetaTransactionResult: "tecPATH_DRY",
}

// Test validateTransactionResult - should fail for non-success transaction
err := parser.validateTransactionResult(tx)
require.Error(t, err, "validateTransactionResult should fail for non-tesSUCCESS transaction")
require.Contains(t, err.Error(), "tecPATH_DRY")
require.Contains(t, err.Error(), "not tesSUCCESS")
}

// TestValidateTransactionResult_Integration_EmptyResult tests that
// validateTransactionResult correctly handles a transaction with empty result.
func TestValidateTransactionResult_Integration_EmptyResult(t *testing.T) {
parser := NewParser("", nil, nil)

tx := GenericTx{
MetaTransactionResult: "",
}

err := parser.validateTransactionResult(tx)
require.Error(t, err, "validateTransactionResult should fail when result is empty")
require.Contains(t, err.Error(), "not tesSUCCESS")
}

const xrplMainnetWSS = "wss://xrplcluster.com"

// TestFetchAndParseTransaction_Mainnet verifies that fetchAndParseTransaction
Expand Down
Loading