-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Feature/custom nonce #2371
Feature/custom nonce #2371
Conversation
d255370
to
26f1079
Compare
For the warning copy, instead of repeating what is already mentioned in the default copy below the warning, I'm now thinking we should mention what could happen if they continue with the higher than suggested nonce. How about something like this instead? cc @rickycodes @omnat @jakehaugen |
4f5f168
to
8ac0c4d
Compare
18b4c99
to
76d4466
Compare
5528e7b
to
716fed9
Compare
I've gone ahead and removed the design qa label since I've gone over this with Christian and he's okay'd it all. re: #2371 (review) I've addressed all QA feedback except for issue 3 as discussed. this is ready for qa again. |
app/components/UI/TransactionReview/TransactionReviewInformation/index.js
Outdated
Show resolved
Hide resolved
export const getNetworkNonce = async ({ from }) => { | ||
const { TransactionController } = Engine.context; | ||
const networkNonce = await util.query(TransactionController.ethQuery, 'getTransactionCount', [from, 'pending']); | ||
return parseInt(networkNonce, 16); |
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.
nice and clean 👌
…on/index.js Co-authored-by: Esteban Miño <efmino@uc.cl>
…obile into feature/custom-nonce * 'feature/custom-nonce' of github.com:MetaMask/metamask-mobile: Update app/components/UI/TransactionReview/TransactionReviewInformation/index.js
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!
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.
All issues resolved, QA Passed 👍🏽
* Add custom nonce switch * update snapshot * Use props * Get edit nonce button in place * Add edit nonce modal * Add translation strings * Add CustomNonceModal component * Add proposedNonce * undo * Update styles and translation strings * Use a hook * Save nonce to state * Add IncrementDecrementSvg component * Add comment for newly added prop * Fix width @ 80 * Add component tests * Add tests * Display warning * Update tests * Add getProposedNonce * Merge some utils and add tests * Add constants * Use object property shorthand * Fix displayWarning to account for String * Add ModalDragger * Add save and cancel * Use the TransactionController from "@metamask/controllers" * Only use custom nonce if showCustomNonce * Update snapshot * Start using Base/Text * Add colors to Base/Text component * Account for NaN values * Use Base/Text * Move increment decrement buttons down * Update tests * Add showSoftInputOnFocus={false} * Update tests * Add icon * Use link * Update tests * prep for QA * Update warning text * Use 6.2.0 controllers * Update translation strings * update snapshot * Remove TODO * Use EvilIcons * Update snapshot * Beef up tests for toLowerCaseCompare * Remove comment * update snapshot * Get nonce from network * Update snapshot * fix lint nits * fix copy * Update snapshot * Move edit nonce functionality into TransactionReviewFeeCard * Add custom nonce to dapp send * Use redux actions * Continue using actions * Set custom nonce on confirm * Update snapshot * Move nonce and proposedNonce off transaction object * Bump controllers * Only getNetworkNonce if proposedNonce is not set * fix props * delete tgz * Add getNetworkNonce to networks utility * document props * Update snapshots * Update app/components/UI/TransactionReview/TransactionReviewInformation/index.js Co-authored-by: Esteban Miño <efmino@uc.cl> * use nonce directly instead of passing it in render Co-authored-by: Esteban Miño <efmino@uc.cl>
Description
Opening this as a Draft as it relies on MetaMask/core#381
This adds a new setting under Advanced that lets you edit the nonce rather than getting it from the network:
Displays suggested nonce when you do a new send:
which can then be edited:
Checklist
Issue
Resolves #2126