-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: UI changes to show decoding data for permits (#28342)
## **Description** Changes in permit simulation component to show decoding api results if present. Changes will currently not be visible as signature controller update is not yet done. ## **Related issues** Fixes: MetaMask/MetaMask-planning#3554 ## **Manual testing steps** 1. Locally enable signature decoding using env variables 2. Submit a permit on test dapp 3. Check simulation section ## **Screenshots/Recordings** <img width="360" alt="Screenshot 2024-11-07 at 3 07 29 PM" src="https://github.com/user-attachments/assets/57097f47-f0db-461a-a1f6-ca62f397ea93"> ## **Pre-merge author checklist** - [X] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [X] I've completed the PR template to the best of my ability - [X] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [X] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --------- Co-authored-by: MetaMask Bot <[email protected]>
- Loading branch information
1 parent
1c8bfff
commit 2367e4e
Showing
13 changed files
with
566 additions
and
132 deletions.
There are no files selected for viewing
18 changes: 16 additions & 2 deletions
18
...ages/confirmations/components/confirm/info/shared/static-simulation/static-simulation.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...-sign/permit-simulation/decoded-simulation/__snapshots__/decoded-simulation.test.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`DecodedSimulation renders component correctly 1`] = ` | ||
<div> | ||
<div> | ||
"DECODED SIMULATION IMPLEMENTATION" | ||
</div> | ||
</div> | ||
`; |
21 changes: 21 additions & 0 deletions
21
.../confirm/info/typed-sign/permit-simulation/decoded-simulation/decoded-simulation.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from 'react'; | ||
import configureMockStore from 'redux-mock-store'; | ||
|
||
import { getMockTypedSignConfirmStateForRequest } from '../../../../../../../../../test/data/confirmations/helper'; | ||
import { renderWithConfirmContextProvider } from '../../../../../../../../../test/lib/confirmations/render-helpers'; | ||
import { permitSignatureMsg } from '../../../../../../../../../test/data/confirmations/typed_sign'; | ||
import PermitSimulation from './decoded-simulation'; | ||
|
||
describe('DecodedSimulation', () => { | ||
it('renders component correctly', async () => { | ||
const state = getMockTypedSignConfirmStateForRequest(permitSignatureMsg); | ||
const mockStore = configureMockStore([])(state); | ||
|
||
const { container } = renderWithConfirmContextProvider( | ||
<PermitSimulation />, | ||
mockStore, | ||
); | ||
|
||
expect(container).toMatchSnapshot(); | ||
}); | ||
}); |
7 changes: 7 additions & 0 deletions
7
...nents/confirm/info/typed-sign/permit-simulation/decoded-simulation/decoded-simulation.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from 'react'; | ||
|
||
const DecodedSimulation: React.FC<object> = () => ( | ||
<div>"DECODED SIMULATION IMPLEMENTATION"</div> | ||
); | ||
|
||
export default DecodedSimulation; |
1 change: 1 addition & 0 deletions
1
...rmations/components/confirm/info/typed-sign/permit-simulation/decoded-simulation/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as DecodedSimulation } from './decoded-simulation'; |
Oops, something went wrong.