Skip to content

Commit

Permalink
revert to test old functions
Browse files Browse the repository at this point in the history
  • Loading branch information
achowdhry-ripple committed Nov 13, 2024
1 parent 4078fb8 commit a1dcfe2
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions packages/xrpl/test/models/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
import { AccountRootFlags } from '../../src/models/ledger'
import { isFlagEnabled } from '../../src/models/utils'
import {
convertTxFlagsToNumber,
setTransactionFlagsToNumber,
parseAccountRootFlags,
parseTransactionFlags,
} from '../../src/models/utils/flags'
Expand Down Expand Up @@ -46,7 +46,7 @@ describe('Models Utils', function () {
})
})

describe('convertTxFlagsToNumber', function () {
describe('setTransactionFlagsToNumber', function () {
it('sets OfferCreateFlags to its numeric value', function () {
const tx: OfferCreate = {
Account: 'r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W',
Expand All @@ -71,8 +71,8 @@ describe('Models Utils', function () {
const { tfPassive, tfFillOrKill } = OfferCreateFlags
const expected: number = tfPassive | tfFillOrKill

const flagNum = convertTxFlagsToNumber(tx)
assert.strictEqual(flagNum, expected)
setTransactionFlagsToNumber(tx)
assert.strictEqual(tx.Flags, expected)
})

it('sets PaymentChannelClaimFlags to its numeric value', function () {
Expand All @@ -90,8 +90,8 @@ describe('Models Utils', function () {
const { tfRenew } = PaymentChannelClaimFlags
const expected: number = tfRenew

const flagNum = convertTxFlagsToNumber(tx)
assert.strictEqual(flagNum, expected)
setTransactionFlagsToNumber(tx)
assert.strictEqual(tx.Flags, expected)
})

it('sets PaymentTransactionFlags to its numeric value', function () {
Expand All @@ -110,8 +110,8 @@ describe('Models Utils', function () {
const { tfPartialPayment, tfLimitQuality } = PaymentFlags
const expected: number = tfPartialPayment | tfLimitQuality

const flagNum = convertTxFlagsToNumber(tx)
assert.strictEqual(flagNum, expected)
setTransactionFlagsToNumber(tx)
assert.strictEqual(tx.Flags, expected)
})

it('sets TrustSetFlags to its numeric value', function () {
Expand All @@ -137,8 +137,8 @@ describe('Models Utils', function () {
const { tfSetfAuth, tfClearNoRipple, tfClearFreeze } = TrustSetFlags
const expected: number = tfSetfAuth | tfClearNoRipple | tfClearFreeze

const flagNum = convertTxFlagsToNumber(tx)
assert.strictEqual(flagNum, expected)
setTransactionFlagsToNumber(tx)
assert.strictEqual(tx.Flags, expected)
})

it('sets other transaction types flags to its numeric value', function () {
Expand All @@ -148,8 +148,8 @@ describe('Models Utils', function () {
Flags: {},
}

const flagNum = convertTxFlagsToNumber(tx)
assert.strictEqual(flagNum, 0)
setTransactionFlagsToNumber(tx)
assert.strictEqual(tx.Flags, 0)
})

// eslint-disable-next-line complexity -- Simpler to list them all out at once.
Expand Down

0 comments on commit a1dcfe2

Please sign in to comment.