fix: properly fund BPF payer accounts
This commit is contained in:
committed by
Michael Vines
parent
d5cd16bef4
commit
cc550dfb08
@ -32,7 +32,10 @@ test('load BPF C program', async () => {
|
|||||||
const fees =
|
const fees =
|
||||||
feeCalculator.lamportsPerSignature *
|
feeCalculator.lamportsPerSignature *
|
||||||
(BpfLoader.getMinNumSignatures(data.length) + NUM_RETRIES);
|
(BpfLoader.getMinNumSignatures(data.length) + NUM_RETRIES);
|
||||||
const from = await newAccountWithLamports(connection, fees);
|
const balanceNeeded = await connection.getMinimumBalanceForRentExemption(
|
||||||
|
data.length,
|
||||||
|
);
|
||||||
|
const from = await newAccountWithLamports(connection, fees + balanceNeeded);
|
||||||
|
|
||||||
const programId = await BpfLoader.load(connection, from, data);
|
const programId = await BpfLoader.load(connection, from, data);
|
||||||
const transaction = new Transaction().add({
|
const transaction = new Transaction().add({
|
||||||
@ -57,7 +60,10 @@ test('load BPF Rust program', async () => {
|
|||||||
const fees =
|
const fees =
|
||||||
feeCalculator.lamportsPerSignature *
|
feeCalculator.lamportsPerSignature *
|
||||||
(BpfLoader.getMinNumSignatures(data.length) + NUM_RETRIES);
|
(BpfLoader.getMinNumSignatures(data.length) + NUM_RETRIES);
|
||||||
const from = await newAccountWithLamports(connection, fees);
|
const balanceNeeded = await connection.getMinimumBalanceForRentExemption(
|
||||||
|
data.length,
|
||||||
|
);
|
||||||
|
const from = await newAccountWithLamports(connection, fees + balanceNeeded);
|
||||||
|
|
||||||
const programId = await BpfLoader.load(connection, from, data);
|
const programId = await BpfLoader.load(connection, from, data);
|
||||||
const transaction = new Transaction().add({
|
const transaction = new Transaction().add({
|
||||||
|
Reference in New Issue
Block a user