Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit 8bb0acc

Browse files
authored
chore: remove failing request units test (#27735)
1 parent ba3d9cd commit 8bb0acc

File tree

2 files changed

+3
-45
lines changed

2 files changed

+3
-45
lines changed

web3.js/src/programs/compute-budget.ts

+3
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,9 @@ export class ComputeBudgetProgram {
228228
'ComputeBudget111111111111111111111111111111',
229229
);
230230

231+
/**
232+
* @deprecated Instead, call {@link setComputeUnitLimit} and/or {@link setComputeUnitPrice}
233+
*/
231234
static requestUnits(params: RequestUnitsParams): TransactionInstruction {
232235
const type = COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.RequestUnits;
233236
const data = encodeData(type, params);

web3.js/test/program-tests/compute-budget.test.ts

-45
Original file line numberDiff line numberDiff line change
@@ -72,51 +72,6 @@ describe('ComputeBudgetProgram', () => {
7272
});
7373

7474
if (process.env.TEST_LIVE) {
75-
it('send live request units ix', async () => {
76-
const connection = new Connection(url, 'confirmed');
77-
const FEE_AMOUNT = LAMPORTS_PER_SOL;
78-
const STARTING_AMOUNT = 2 * LAMPORTS_PER_SOL;
79-
const baseAccount = Keypair.generate();
80-
const basePubkey = baseAccount.publicKey;
81-
await helpers.airdrop({
82-
connection,
83-
address: basePubkey,
84-
amount: STARTING_AMOUNT,
85-
});
86-
87-
const additionalFeeTooHighTransaction = new Transaction().add(
88-
ComputeBudgetProgram.requestUnits({
89-
units: 150_000,
90-
additionalFee: STARTING_AMOUNT,
91-
}),
92-
);
93-
94-
await expect(
95-
sendAndConfirmTransaction(
96-
connection,
97-
additionalFeeTooHighTransaction,
98-
[baseAccount],
99-
{preflightCommitment: 'confirmed'},
100-
),
101-
).to.be.rejected;
102-
103-
const validAdditionalFeeTransaction = new Transaction().add(
104-
ComputeBudgetProgram.requestUnits({
105-
units: 150_000,
106-
additionalFee: FEE_AMOUNT,
107-
}),
108-
);
109-
await sendAndConfirmTransaction(
110-
connection,
111-
validAdditionalFeeTransaction,
112-
[baseAccount],
113-
{preflightCommitment: 'confirmed'},
114-
);
115-
expect(await connection.getBalance(baseAccount.publicKey)).to.be.at.most(
116-
STARTING_AMOUNT - FEE_AMOUNT,
117-
);
118-
});
119-
12075
it('send live request heap ix', async () => {
12176
const connection = new Connection(url, 'confirmed');
12277
const STARTING_AMOUNT = 2 * LAMPORTS_PER_SOL;

0 commit comments

Comments
 (0)