feat: add root and single commitment levels

This commit is contained in:
Justin Starry
2020-05-20 17:12:09 +08:00
committed by Michael Vines
parent 1e1c9de367
commit 3b71ec1ff6
4 changed files with 18 additions and 11 deletions

View File

@ -1031,12 +1031,15 @@ test('get confirmed block', async () => {
test('get recent blockhash', async () => {
const connection = new Connection(url);
for (const commitment of ['max', 'recent', 'root', 'single']) {
mockGetRecentBlockhash(commitment);
mockGetRecentBlockhash();
const {blockhash, feeCalculator} = await connection.getRecentBlockhash();
expect(blockhash.length).toBeGreaterThanOrEqual(43);
expect(feeCalculator.lamportsPerSignature).toBeGreaterThanOrEqual(0);
const {blockhash, feeCalculator} = await connection.getRecentBlockhash(
commitment,
);
expect(blockhash.length).toBeGreaterThanOrEqual(43);
expect(feeCalculator.lamportsPerSignature).toBeGreaterThanOrEqual(0);
}
});
test('get block time', async () => {