-
-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow for speedUp and stop based on provided gasValues from consumer #535
Conversation
9685c6b
to
4c048ff
Compare
4c048ff
to
77398c3
Compare
src/util.ts
Outdated
const keys = Object.keys(gasValues); | ||
keys.forEach((key) => { | ||
const val = (gasValues as any)[key]; | ||
if (typeof val !== 'string' || !isHexString(val)) { |
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.
technically this typeof
check is redundant since you can't set these values to anything other than string
. That said, I don't think it hurts to have an additional check.
…to dynamic-speed-up * 'dynamic-speed-up' of github.com:MetaMask/controllers: Bump @metamask/auto-changelog from 2.4.0 to 2.5.0 (#549) Update Changelog (#548) 14.0.2 (#547) Fix `resetPolling` functionality (#546) TokenService improvements (#541) Release/14.0.1 (#545) Make gweiDecToWEIBN util resilient against params with too many decimals (#544) Bump @metamask/contract-metadata from 1.27.0 to 1.28.0 (#540) 14.0.0 (#539) Bug: Mainnet NFT Autodetect API (#536)
ensure tx is increased by at least the minimum required amount
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.
Looks good so far! Just the missing validation in stopTransaction
Thanks @Gudahtt! I've added the validation in |
@Gudahtt fixed spelling and removed unnecessary optional chaining |
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.
LGTM!
…535) * Allow for speedUp and stop based on provided gasValues from consumer * make this optional * validate gas values are hex string * use util * rename * update wording * Update tests * remove return true * Use type predicate functions * Move type predicate functions to util * Update unit tests * Add validation ensure tx is increased by at least the minimum required amount * Add validateMinimumIncrease method * Address nit * Add validation in stopTransaction * fix spelling * remove unnecessary optional chaining * test
…535) * Allow for speedUp and stop based on provided gasValues from consumer * make this optional * validate gas values are hex string * use util * rename * update wording * Update tests * remove return true * Use type predicate functions * Move type predicate functions to util * Update unit tests * Add validation ensure tx is increased by at least the minimum required amount * Add validateMinimumIncrease method * Address nit * Add validation in stopTransaction * fix spelling * remove unnecessary optional chaining * test
opening this as a draft as it relies on #521this adds a new interface
GasValues
which can be used to dynamically set values forspeedUp
andstopTransaction
which can be used instead of our previously existing fixed rates.this will allow consumers to set custom gas values (in hex) for both those actions.