fix: remove return value from load, unnecessary
This commit is contained in:
@ -39,7 +39,7 @@ export class BpfLoader {
|
|||||||
payer: Account,
|
payer: Account,
|
||||||
program: Account,
|
program: Account,
|
||||||
elf: Buffer | Uint8Array | Array<number>,
|
elf: Buffer | Uint8Array | Array<number>,
|
||||||
): Promise<PublicKey> {
|
): Promise<void> {
|
||||||
return Loader.load(connection, payer, program, BpfLoader.programId, elf);
|
return Loader.load(connection, payer, program, BpfLoader.programId, elf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ export class Loader {
|
|||||||
program: Account,
|
program: Account,
|
||||||
programId: PublicKey,
|
programId: PublicKey,
|
||||||
data: Buffer | Uint8Array | Array<number>,
|
data: Buffer | Uint8Array | Array<number>,
|
||||||
): Promise<PublicKey> {
|
): Promise<void> {
|
||||||
{
|
{
|
||||||
const balanceNeeded = await connection.getMinimumBalanceForRentExemption(
|
const balanceNeeded = await connection.getMinimumBalanceForRentExemption(
|
||||||
data.length,
|
data.length,
|
||||||
@ -145,6 +145,5 @@ export class Loader {
|
|||||||
});
|
});
|
||||||
await sendAndConfirmTransaction(connection, transaction, payer, program);
|
await sendAndConfirmTransaction(connection, transaction, payer, program);
|
||||||
}
|
}
|
||||||
return program.publicKey;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,10 +39,10 @@ test('load BPF C program', async () => {
|
|||||||
const from = await newAccountWithLamports(connection, fees + balanceNeeded);
|
const from = await newAccountWithLamports(connection, fees + balanceNeeded);
|
||||||
|
|
||||||
const program = new Account();
|
const program = new Account();
|
||||||
const programId = await BpfLoader.load(connection, from, program, data);
|
await BpfLoader.load(connection, from, program, data);
|
||||||
const transaction = new Transaction().add({
|
const transaction = new Transaction().add({
|
||||||
keys: [{pubkey: from.publicKey, isSigner: true, isWritable: true}],
|
keys: [{pubkey: from.publicKey, isSigner: true, isWritable: true}],
|
||||||
programId,
|
programId: program.publicKey,
|
||||||
});
|
});
|
||||||
await sendAndConfirmTransaction(connection, transaction, from);
|
await sendAndConfirmTransaction(connection, transaction, from);
|
||||||
});
|
});
|
||||||
@ -68,10 +68,10 @@ test('load BPF Rust program', async () => {
|
|||||||
const from = await newAccountWithLamports(connection, fees + balanceNeeded);
|
const from = await newAccountWithLamports(connection, fees + balanceNeeded);
|
||||||
|
|
||||||
const program = new Account();
|
const program = new Account();
|
||||||
const programId = await BpfLoader.load(connection, from, program, data);
|
await BpfLoader.load(connection, from, program, data);
|
||||||
const transaction = new Transaction().add({
|
const transaction = new Transaction().add({
|
||||||
keys: [{pubkey: from.publicKey, isSigner: true, isWritable: true}],
|
keys: [{pubkey: from.publicKey, isSigner: true, isWritable: true}],
|
||||||
programId,
|
programId: program.publicKey,
|
||||||
});
|
});
|
||||||
await sendAndConfirmTransaction(connection, transaction, from);
|
await sendAndConfirmTransaction(connection, transaction, from);
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user