Skip to content

Commit

Permalink
remove unnecessary payment test
Browse files Browse the repository at this point in the history
  • Loading branch information
pdp2121 committed Nov 12, 2024
1 parent a36a8f0 commit ec590b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 27 deletions.
20 changes: 6 additions & 14 deletions packages/xrpl/test/integration/transactions/payment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,15 @@ import {
teardownClient,
type XrplIntegrationTestContext,
} from '../setup'
import {
fetchAccountReserveFee,
generateFundedWallet,
testTransaction,
} from '../utils'
import { generateFundedWallet, testTransaction } from '../utils'

// how long before each test case times out
const TIMEOUT = 20000

describe('Payment', function () {
let testContext: XrplIntegrationTestContext
let paymentTx: Payment
let amount: string
const DEFAULT_AMOUNT = '10000000'
const AMOUNT = '10000000'
// This wallet is used for DeliverMax related tests
let senderWallet: Wallet

Expand All @@ -30,17 +25,14 @@ describe('Payment', function () {
paymentTx = {
TransactionType: 'Payment',
Account: senderWallet.classicAddress,
Amount: amount,
Amount: AMOUNT,
Destination: 'rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy',
}
})

beforeAll(async () => {
testContext = await setupClient(serverUrl)
senderWallet = await generateFundedWallet(testContext.client)
// Make sure the amount sent satisfies minimum reserve requirement to fund an account.
amount =
(await fetchAccountReserveFee(testContext.client)) ?? DEFAULT_AMOUNT
})
afterAll(async () => teardownClient(testContext))

Expand Down Expand Up @@ -68,7 +60,7 @@ describe('Payment', function () {
)

assert.equal(result.result.engine_result_code, 0)
assert.equal((result.result.tx_json as Payment).Amount, amount)
assert.equal((result.result.tx_json as Payment).Amount, AMOUNT)
},
TIMEOUT,
)
Expand All @@ -88,7 +80,7 @@ describe('Payment', function () {
)

assert.equal(result.result.engine_result_code, 0)
assert.equal((result.result.tx_json as Payment).Amount, amount)
assert.equal((result.result.tx_json as Payment).Amount, AMOUNT)
},
TIMEOUT,
)
Expand All @@ -106,7 +98,7 @@ describe('Payment', function () {
)

assert.equal(result.result.engine_result_code, 0)
assert.equal((result.result.tx_json as Payment).Amount, amount)
assert.equal((result.result.tx_json as Payment).Amount, AMOUNT)
},
TIMEOUT,
)
Expand Down
13 changes: 0 additions & 13 deletions packages/xrpl/test/integration/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -445,16 +445,3 @@ export async function createAMMPool(client: Client): Promise<{
asset2,
}
}

export async function fetchAccountReserveFee(
client: Client,
): Promise<string | null> {
const response = await client.request({ command: 'server_state' })
const fee = response.result.state.validated_ledger?.reserve_base

if (fee == null) {
return null
}

return new BigNumber(fee).dp(0, BigNumber.ROUND_CEIL).toString(10)
}

0 comments on commit ec590b3

Please sign in to comment.