Skip to content

Commit

Permalink
address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ckeshava committed Feb 6, 2025
1 parent 2b3580a commit 9154151
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ describe('PermissionedDomainSet', function () {
}

// Step-1: Test the PermissionedDomainSet transaction
const tx_pd_set: PermissionedDomainSet = {
const txPDSet: PermissionedDomainSet = {
TransactionType: 'PermissionedDomainSet',
Account: testContext.wallet.classicAddress,
AcceptedCredentials: [sampleCredential],
}

await testTransaction(testContext.client, tx_pd_set, testContext.wallet)
await testTransaction(testContext.client, txPDSet, testContext.wallet)

// Step-2: Validate the ledger_entry, account_objects RPC methods
// validate the account_objects RPC
Expand All @@ -61,18 +61,18 @@ describe('PermissionedDomainSet', function () {
expect(pd.AcceptedCredentials).toEqual([sampleCredential])

// validate the ledger_entry RPC
const ledger_entry_request: LedgerEntryRequest = {
const ledgerEntryRequest: LedgerEntryRequest = {
command: 'ledger_entry',
// fetch the PD `index` from the previous account_objects RPC response
index: pd.index,
}
const ledger_entry_result = await testContext.client.request(
ledger_entry_request,
const ledgerEntryResult = await testContext.client.request(
ledgerEntryRequest,
)
assert.deepEqual(pd, ledger_entry_result.result.node)
assert.deepEqual(pd, ledgerEntryResult.result.node)

// Step-3: Test the PDDelete transaction
const tx_pd_delete: PermissionedDomainDelete = {
const txPDDelete: PermissionedDomainDelete = {
TransactionType: 'PermissionedDomainDelete',
Account: testContext.wallet.classicAddress,
// fetch the PD `index` from the previous account_objects RPC response
Expand All @@ -81,7 +81,7 @@ describe('PermissionedDomainSet', function () {

await testTransaction(
testContext.client,
tx_pd_delete,
txPDDelete,
testContext.wallet,
)
},
Expand Down
2 changes: 0 additions & 2 deletions packages/xrpl/test/models/permissionedDomainSet.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,13 @@ describe('PermissionedDomainSet', function () {
tx.DomainID = 1234
const errorMessage = 'PermissionedDomainSet: invalid field DomainID'
assert.throws(() => validate(tx), ValidationError, errorMessage)
assert.throws(() => validate(tx), ValidationError, errorMessage)
})

it(`throws w/ missing field AcceptedCredentials`, function () {
delete tx.AcceptedCredentials
const errorMessage =
'PermissionedDomainSet: missing field AcceptedCredentials'
assert.throws(() => validate(tx), ValidationError, errorMessage)
assert.throws(() => validate(tx), ValidationError, errorMessage)
})

it('throws when AcceptedCredentials exceeds maximum length', function () {
Expand Down

0 comments on commit 9154151

Please sign in to comment.