Skip to content
Merged
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
5 changes: 0 additions & 5 deletions .ci-config/rippled.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ online_delete=256
# Devnet amendments as of June 28th, 2023
NegativeUNL
fixRemoveNFTokenAutoTrustLine
NonFungibleTokensV1
CheckCashMakesTrustLine
fixRmSmallIncreasedQOffers
fixSTAmountCanonicalize
Expand Down Expand Up @@ -144,10 +143,8 @@ fix1512
fix1373
MultiSign
Checks
NonFungibleTokensV1_1
# 1.10.0 Amendments
DisallowIncoming
fixNonFungibleTokensV1_2
fixTrustLinesToSelf
fixUniversalNumber
ImmediateOfferKilled
Expand All @@ -158,7 +155,6 @@ ExpandedSignerList
AMM
Clawback
fixReducedOffersV1
fixNFTokenRemint
# 2.0.0 Amendments
XChainBridge
DID
Expand Down Expand Up @@ -188,7 +184,6 @@ PermissionedDomains
fixFrozenLPTokenTransfer
fixInvalidTxFlags
# 2.5.0 Amendments
PermissionDelegation
Batch
PermissionedDEX
TokenEscrow
Expand Down
18 changes: 17 additions & 1 deletion packages/xrpl/test/integration/transactions/delegateSet.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ import {
teardownClient,
type XrplIntegrationTestContext,
} from '../setup'
import { generateFundedWallet, testTransaction } from '../utils'
import {
generateFundedWallet,
isAmendmentEnabled,
testTransaction,
} from '../utils'

// how long before each test case times out
const TIMEOUT = 20000
Expand All @@ -37,6 +41,18 @@ describe('DelegateSet', function () {
it(
'base',
async () => {
const isEnabled = await isAmendmentEnabled(
testContext.client,
'PermissionDelegation',
)
if (!isEnabled) {
// eslint-disable-next-line no-console -- Informing user about skipped test
console.warn(
'Skipping DelegateSet test: PermissionDelegation amendment is not enabled on the server',
)
return
}

// Authorize Bob account to execute Payment transactions and
// modify the domain of an account behalf of Alice's account.
const delegateTx: DelegateSet = {
Expand Down
32 changes: 32 additions & 0 deletions packages/xrpl/test/integration/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,38 @@ export function subscribeDone(client: Client): void {
client.removeAllListeners()
}

/**
* Checks if a specific amendment is enabled on the server.
*
* @param client - The XRPL client.
* @param amendmentName - The name of the amendment to check (e.g., 'PermissionDelegation').
* @returns True if the amendment is enabled, false otherwise.
*/
export async function isAmendmentEnabled(
client: Client,
amendmentName: string,
): Promise<boolean> {
try {
const featureResponse = await client.request({
command: 'feature',
})

// Search through all features to find the one with the matching name
const features = featureResponse.result.features
for (const feature of Object.values(features)) {
if (feature.name === amendmentName) {
return feature.enabled
}
}

// Amendment not found
return false
} catch (error) {
// If the feature command fails, assume the amendment is not enabled
return false
}
}

export async function submitTransaction({
client,
transaction,
Expand Down
Loading