Skip to content

Commit 1bcfc75

Browse files
committed
repair xrpl integration test: fix stale integration test validator call
Update the live integration test to call the package-level validateTransactionResult function introduced in #4705. This preserves the same validation behavior; only the obsolete Parser receiver is removed. Drop the tagged synthetic failure and empty-result cases because equivalent tests already run in parse_test.go without build tags. The XRPL package passes both its normal tests and integration-tagged compile check.
1 parent 8f7b4d3 commit 1bcfc75

1 file changed

Lines changed: 1 addition & 37 deletions

File tree

node/pkg/watchers/xrpl/parse_integration_test.go

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,13 @@ func TestValidateTransactionResult_Integration(t *testing.T) {
4747
// Verify the transaction is validated
4848
require.True(t, txResp.Validated, "transaction should be validated")
4949

50-
// Create a parser and test validateTransactionResult
51-
parser := NewParser("", nil, nil)
52-
5350
// Create a GenericTx with the transaction result from the response
5451
tx := GenericTx{
55-
Transaction: txResp.TxJSON,
5652
MetaTransactionResult: txResp.Meta.TransactionResult,
5753
}
5854

5955
// Test validateTransactionResult - should succeed for a successful transaction
60-
err = parser.validateTransactionResult(tx)
56+
err = validateTransactionResult(tx)
6157
require.NoError(t, err, "validateTransactionResult should succeed for tesSUCCESS transaction")
6258

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

71-
// TestValidateTransactionResult_Integration_FailedTransaction tests that
72-
// validateTransactionResult correctly rejects a failed transaction.
73-
func TestValidateTransactionResult_Integration_FailedTransaction(t *testing.T) {
74-
// Create a parser
75-
parser := NewParser("", nil, nil)
76-
77-
// Create a GenericTx with a non-success result
78-
tx := GenericTx{
79-
MetaTransactionResult: "tecPATH_DRY",
80-
}
81-
82-
// Test validateTransactionResult - should fail for non-success transaction
83-
err := parser.validateTransactionResult(tx)
84-
require.Error(t, err, "validateTransactionResult should fail for non-tesSUCCESS transaction")
85-
require.Contains(t, err.Error(), "tecPATH_DRY")
86-
require.Contains(t, err.Error(), "not tesSUCCESS")
87-
}
88-
89-
// TestValidateTransactionResult_Integration_EmptyResult tests that
90-
// validateTransactionResult correctly handles a transaction with empty result.
91-
func TestValidateTransactionResult_Integration_EmptyResult(t *testing.T) {
92-
parser := NewParser("", nil, nil)
93-
94-
tx := GenericTx{
95-
MetaTransactionResult: "",
96-
}
97-
98-
err := parser.validateTransactionResult(tx)
99-
require.Error(t, err, "validateTransactionResult should fail when result is empty")
100-
require.Contains(t, err.Error(), "not tesSUCCESS")
101-
}
102-
10367
const xrplMainnetWSS = "wss://xrplcluster.com"
10468

10569
// TestFetchAndParseTransaction_Mainnet verifies that fetchAndParseTransaction

0 commit comments

Comments
 (0)