Skip to content

Commit 9909a1b

Browse files
committed
Fix failed integration tests due to the removal of amendments
1 parent bd883bd commit 9909a1b

File tree

3 files changed

+49
-6
lines changed

3 files changed

+49
-6
lines changed

.ci-config/rippled.cfg

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ online_delete=256
101101
# Devnet amendments as of June 28th, 2023
102102
NegativeUNL
103103
fixRemoveNFTokenAutoTrustLine
104-
NonFungibleTokensV1
105104
CheckCashMakesTrustLine
106105
fixRmSmallIncreasedQOffers
107106
fixSTAmountCanonicalize
@@ -144,10 +143,8 @@ fix1512
144143
fix1373
145144
MultiSign
146145
Checks
147-
NonFungibleTokensV1_1
148146
# 1.10.0 Amendments
149147
DisallowIncoming
150-
fixNonFungibleTokensV1_2
151148
fixTrustLinesToSelf
152149
fixUniversalNumber
153150
ImmediateOfferKilled
@@ -158,7 +155,6 @@ ExpandedSignerList
158155
AMM
159156
Clawback
160157
fixReducedOffersV1
161-
fixNFTokenRemint
162158
# 2.0.0 Amendments
163159
XChainBridge
164160
DID
@@ -188,7 +184,6 @@ PermissionedDomains
188184
fixFrozenLPTokenTransfer
189185
fixInvalidTxFlags
190186
# 2.5.0 Amendments
191-
PermissionDelegation
192187
Batch
193188
PermissionedDEX
194189
TokenEscrow

packages/xrpl/test/integration/transactions/delegateSet.test.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ import {
1515
teardownClient,
1616
type XrplIntegrationTestContext,
1717
} from '../setup'
18-
import { generateFundedWallet, testTransaction } from '../utils'
18+
import {
19+
generateFundedWallet,
20+
isAmendmentEnabled,
21+
testTransaction,
22+
} from '../utils'
1923

2024
// how long before each test case times out
2125
const TIMEOUT = 20000
@@ -37,6 +41,18 @@ describe('DelegateSet', function () {
3741
it(
3842
'base',
3943
async () => {
44+
const isEnabled = await isAmendmentEnabled(
45+
testContext.client,
46+
'PermissionDelegation',
47+
)
48+
if (!isEnabled) {
49+
// eslint-disable-next-line no-console -- Informing user about skipped test
50+
console.warn(
51+
'Skipping DelegateSet test: PermissionDelegation amendment is not enabled on the server',
52+
)
53+
return
54+
}
55+
4056
// Authorize Bob account to execute Payment transactions and
4157
// modify the domain of an account behalf of Alice's account.
4258
const delegateTx: DelegateSet = {

packages/xrpl/test/integration/utils.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,38 @@ export function subscribeDone(client: Client): void {
9393
client.removeAllListeners()
9494
}
9595

96+
/**
97+
* Checks if a specific amendment is enabled on the server.
98+
*
99+
* @param client - The XRPL client.
100+
* @param amendmentName - The name of the amendment to check (e.g., 'PermissionDelegation').
101+
* @returns True if the amendment is enabled, false otherwise.
102+
*/
103+
export async function isAmendmentEnabled(
104+
client: Client,
105+
amendmentName: string,
106+
): Promise<boolean> {
107+
try {
108+
const featureResponse = await client.request({
109+
command: 'feature',
110+
})
111+
112+
// Search through all features to find the one with the matching name
113+
const features = featureResponse.result.features
114+
for (const feature of Object.values(features)) {
115+
if (feature.name === amendmentName) {
116+
return feature.enabled
117+
}
118+
}
119+
120+
// Amendment not found
121+
return false
122+
} catch (error) {
123+
// If the feature command fails, assume the amendment is not enabled
124+
return false
125+
}
126+
}
127+
96128
export async function submitTransaction({
97129
client,
98130
transaction,

0 commit comments

Comments
 (0)