-
Notifications
You must be signed in to change notification settings - Fork 4.5k
feat: add minContextSlot
configuration to (almost) all web3.js methods
#26296
feat: add minContextSlot
configuration to (almost) all web3.js methods
#26296
Conversation
function extractCommitmentFromConfig<TConfig>( | ||
commitmentOrConfig?: Commitment | ({commitment?: Commitment} & TConfig), | ||
) { | ||
let commitment: Commitment | undefined; | ||
let config: Omit<TConfig, 'commitment'> | undefined; | ||
if (typeof commitmentOrConfig === 'string') { | ||
commitment = commitmentOrConfig; | ||
} else if (commitmentOrConfig) { | ||
const {commitment: specifiedCommitment, ...specifiedConfig} = | ||
commitmentOrConfig; | ||
commitment = specifiedCommitment; | ||
config = specifiedConfig; | ||
} | ||
return {commitment, config}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should have been in a separate commit for the purpose of review, sorry.
Codecov Report
@@ Coverage Diff @@
## master #26296 +/- ##
=========================================
+ Coverage 75.7% 75.9% +0.2%
=========================================
Files 40 40
Lines 2350 2358 +8
Branches 340 338 -2
=========================================
+ Hits 1781 1792 +11
+ Misses 450 449 -1
+ Partials 119 117 -2 |
|
Totally. Let me do that properly in a separate PR. |
PR'd up in #26318. |
Problem
A new config param was added that lets you perform API calls while enforcing that the receiving RPC must have proceeded past a given slot. This API needs to be added to web3.js
Summary of Changes
Fixes #26276.