fix: default transaction fee is now 1 (was 0)
This commit is contained in:
@ -37,7 +37,7 @@ export class BpfLoader {
|
||||
const transaction = SystemProgram.createAccount(
|
||||
owner.publicKey,
|
||||
programAccount.publicKey,
|
||||
1,
|
||||
1 + Math.ceil(elf.length / Loader.chunkSize) + 1,
|
||||
elf.length,
|
||||
BpfLoader.programId,
|
||||
);
|
||||
|
@ -23,6 +23,14 @@ export class Loader {
|
||||
*/
|
||||
programId: PublicKey;
|
||||
|
||||
|
||||
/**
|
||||
* Amount of program data placed in each load Transaction
|
||||
*/
|
||||
static get chunkSize(): number {
|
||||
return 256;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param connection The connection to use
|
||||
* @param programId Public key that identifies the loader
|
||||
@ -50,7 +58,7 @@ export class Loader {
|
||||
),
|
||||
]);
|
||||
|
||||
const chunkSize = 256;
|
||||
const chunkSize = Loader.chunkSize;
|
||||
let offset = 0;
|
||||
let array = data;
|
||||
let transactions = [];
|
||||
|
@ -40,7 +40,7 @@ export class NativeLoader {
|
||||
const transaction = SystemProgram.createAccount(
|
||||
owner.publicKey,
|
||||
programAccount.publicKey,
|
||||
1,
|
||||
1 + 1 + 1,
|
||||
bytes.length + 1,
|
||||
NativeLoader.programId,
|
||||
);
|
||||
|
@ -240,6 +240,7 @@ export class Token {
|
||||
programId,
|
||||
userdata,
|
||||
});
|
||||
transaction.fee = 0; // TODO: Batch with the `SystemProgram.createAccount` and remove this line
|
||||
await sendAndConfirmTransaction(connection, transaction, tokenAccount);
|
||||
|
||||
return [token, initialAccountPublicKey];
|
||||
@ -294,7 +295,7 @@ export class Token {
|
||||
programId: this.programId,
|
||||
userdata,
|
||||
});
|
||||
|
||||
transaction.fee = 0; // TODO: Batch with the `SystemProgram.createAccount` and remove this line
|
||||
await sendAndConfirmTransaction(this.connection, transaction, tokenAccount);
|
||||
|
||||
return tokenAccount.publicKey;
|
||||
|
@ -108,7 +108,7 @@ export class Transaction {
|
||||
/**
|
||||
* Fee for this transaction
|
||||
*/
|
||||
fee: number = 0;
|
||||
fee: number = 1;
|
||||
|
||||
/**
|
||||
* Construct an empty Transaction
|
||||
|
Reference in New Issue
Block a user