fix: adapt tests to higher default transaction signature fee (#531)

This commit is contained in:
Michael Vines
2019-10-19 11:36:06 -07:00
parent dd7e305c35
commit c705ac01f5
7 changed files with 31 additions and 20 deletions

View File

@@ -701,7 +701,7 @@ export class Connection {
);
const res = GetMinimumBalanceForRentExemptionRpcResult(unsafeRes);
if (res.error) {
console.warn("Unable to fetch minimum balance for rent exemption");
console.warn('Unable to fetch minimum balance for rent exemption');
return 0;
}
assert(typeof res.result !== 'undefined');

View File

@@ -15,3 +15,6 @@ export {
sendAndConfirmRawTransaction,
} from './util/send-and-confirm-raw-transaction';
export {testnetChannelEndpoint} from './util/testnet';
// There are 2^34 lamports in one SOL
export const SOL_LAMPORTS = 17179869184;

View File

@@ -45,7 +45,9 @@ export class Loader {
data: Array<number>,
): Promise<PublicKey> {
{
const balanceNeeded = await connection.getMinimumBalanceForRentExemption(data.length);
const balanceNeeded = await connection.getMinimumBalanceForRentExemption(
data.length,
);
const transaction = SystemProgram.createAccount(
payer.publicKey,
program.publicKey,
@@ -126,7 +128,7 @@ export class Loader {
const transaction = new Transaction().add({
keys: [
{pubkey: program.publicKey, isSigner: true, isDebitable: true},
{pubkey: SYSVAR_RENT_PUBKEY, isSigner: false, isDebitable: false}
{pubkey: SYSVAR_RENT_PUBKEY, isSigner: false, isDebitable: false},
],
programId,
data,