chore: remove failing request units test (#27735)
This commit is contained in:
parent
ba3d9cd325
commit
8bb0acc4c6
|
@ -228,6 +228,9 @@ export class ComputeBudgetProgram {
|
||||||
'ComputeBudget111111111111111111111111111111',
|
'ComputeBudget111111111111111111111111111111',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated Instead, call {@link setComputeUnitLimit} and/or {@link setComputeUnitPrice}
|
||||||
|
*/
|
||||||
static requestUnits(params: RequestUnitsParams): TransactionInstruction {
|
static requestUnits(params: RequestUnitsParams): TransactionInstruction {
|
||||||
const type = COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.RequestUnits;
|
const type = COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.RequestUnits;
|
||||||
const data = encodeData(type, params);
|
const data = encodeData(type, params);
|
||||||
|
|
|
@ -72,51 +72,6 @@ describe('ComputeBudgetProgram', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
if (process.env.TEST_LIVE) {
|
if (process.env.TEST_LIVE) {
|
||||||
it('send live request units ix', async () => {
|
|
||||||
const connection = new Connection(url, 'confirmed');
|
|
||||||
const FEE_AMOUNT = LAMPORTS_PER_SOL;
|
|
||||||
const STARTING_AMOUNT = 2 * LAMPORTS_PER_SOL;
|
|
||||||
const baseAccount = Keypair.generate();
|
|
||||||
const basePubkey = baseAccount.publicKey;
|
|
||||||
await helpers.airdrop({
|
|
||||||
connection,
|
|
||||||
address: basePubkey,
|
|
||||||
amount: STARTING_AMOUNT,
|
|
||||||
});
|
|
||||||
|
|
||||||
const additionalFeeTooHighTransaction = new Transaction().add(
|
|
||||||
ComputeBudgetProgram.requestUnits({
|
|
||||||
units: 150_000,
|
|
||||||
additionalFee: STARTING_AMOUNT,
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
await expect(
|
|
||||||
sendAndConfirmTransaction(
|
|
||||||
connection,
|
|
||||||
additionalFeeTooHighTransaction,
|
|
||||||
[baseAccount],
|
|
||||||
{preflightCommitment: 'confirmed'},
|
|
||||||
),
|
|
||||||
).to.be.rejected;
|
|
||||||
|
|
||||||
const validAdditionalFeeTransaction = new Transaction().add(
|
|
||||||
ComputeBudgetProgram.requestUnits({
|
|
||||||
units: 150_000,
|
|
||||||
additionalFee: FEE_AMOUNT,
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
await sendAndConfirmTransaction(
|
|
||||||
connection,
|
|
||||||
validAdditionalFeeTransaction,
|
|
||||||
[baseAccount],
|
|
||||||
{preflightCommitment: 'confirmed'},
|
|
||||||
);
|
|
||||||
expect(await connection.getBalance(baseAccount.publicKey)).to.be.at.most(
|
|
||||||
STARTING_AMOUNT - FEE_AMOUNT,
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('send live request heap ix', async () => {
|
it('send live request heap ix', async () => {
|
||||||
const connection = new Connection(url, 'confirmed');
|
const connection = new Connection(url, 'confirmed');
|
||||||
const STARTING_AMOUNT = 2 * LAMPORTS_PER_SOL;
|
const STARTING_AMOUNT = 2 * LAMPORTS_PER_SOL;
|
||||||
|
|
Loading…
Reference in New Issue