feat: expose feeCalculator
This commit is contained in:
@ -204,8 +204,12 @@ test('get recent blockhash', async () => {
|
||||
|
||||
mockGetRecentBlockhash();
|
||||
|
||||
const recentBlockhash = await connection.getRecentBlockhash();
|
||||
const [
|
||||
recentBlockhash,
|
||||
feeCalculator,
|
||||
] = await connection.getRecentBlockhash();
|
||||
expect(recentBlockhash.length).toBeGreaterThanOrEqual(43);
|
||||
expect(feeCalculator.lamportsPerSignature).toBeGreaterThanOrEqual(0);
|
||||
});
|
||||
|
||||
test('request airdrop', async () => {
|
||||
@ -482,7 +486,9 @@ test('multi-instruction transaction', async () => {
|
||||
accountFrom.publicKey,
|
||||
accountTo.publicKey,
|
||||
100,
|
||||
).add(SystemProgram.transfer(accountTo.publicKey, accountFrom.publicKey, 100));
|
||||
).add(
|
||||
SystemProgram.transfer(accountTo.publicKey, accountFrom.publicKey, 100),
|
||||
);
|
||||
const signature = await connection.sendTransaction(
|
||||
transaction,
|
||||
accountFrom,
|
||||
|
@ -18,7 +18,7 @@ export function mockGetRecentBlockhash() {
|
||||
result: [
|
||||
recentBlockhash.publicKey.toBase58(),
|
||||
{
|
||||
/* empty fee calculator */
|
||||
lamportsPerSignature: 42,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -137,11 +137,11 @@ test('transaction-payer', async () => {
|
||||
},
|
||||
]);
|
||||
|
||||
// accountPayer should be less less than 100 as it paid for the transaction
|
||||
// accountPayer could be less than 100 as it paid for the transaction
|
||||
// (exact amount less depends on the current cluster fees)
|
||||
const balance = await connection.getBalance(accountPayer.publicKey);
|
||||
expect(balance).toBeGreaterThan(0);
|
||||
expect(balance).toBeLessThanOrEqual(99);
|
||||
expect(balance).toBeLessThanOrEqual(100);
|
||||
|
||||
// accountFrom should have exactly 2, since it didn't pay for the transaction
|
||||
mockRpc.push([
|
||||
|
Reference in New Issue
Block a user