-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: Implement staking details section #13475
base: main
Are you sure you want to change the base?
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
430dbc5
to
e711cf0
Compare
|
|
@@ -2,12 +2,14 @@ import React from 'react'; | |||
|
|||
import { strings } from '../../../../../../../../locales/i18n'; | |||
import FlatNavHeader from '../../FlatNavHeader'; | |||
import StakingDetails from '../../StakingDetails'; | |||
import TokenHero from '../../TokenHero'; | |||
|
|||
const StakingDeposit = () => ( | |||
<> | |||
<FlatNavHeader title={strings('stake.stake')} /> |
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.
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.
We will do this in another PR as discussed in the slack
const { getByText } = renderWithProvider(<StakingDetails />, { | ||
state: { | ||
...stakingDepositConfirmationState, | ||
engine: { | ||
...stakingDepositConfirmationState.engine, | ||
backgroundState: { | ||
...stakingDepositConfirmationState.engine.backgroundState, | ||
TransactionController: { | ||
...stakingDepositConfirmationState.engine.backgroundState.TransactionController, | ||
transactions: [ | ||
{ | ||
...stakingDepositConfirmationState.engine.backgroundState.TransactionController.transactions[0], | ||
txParams: { | ||
...stakingDepositConfirmationState.engine.backgroundState.TransactionController.transactions[0].txParams, | ||
value: `0x${decGWEIToHexWEI(10 ** 8)}`, | ||
}, | ||
} | ||
] | ||
}, | ||
}, | ||
}, | ||
staking: { | ||
...initialRootState.staking, | ||
vaultData: { | ||
...initialRootState.staking.vaultData, | ||
apy: '2.2', | ||
}, | ||
}, | ||
}, | ||
}); |
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.
const { getByText } = renderWithProvider(<StakingDetails />, { | |
state: { | |
...stakingDepositConfirmationState, | |
engine: { | |
...stakingDepositConfirmationState.engine, | |
backgroundState: { | |
...stakingDepositConfirmationState.engine.backgroundState, | |
TransactionController: { | |
...stakingDepositConfirmationState.engine.backgroundState.TransactionController, | |
transactions: [ | |
{ | |
...stakingDepositConfirmationState.engine.backgroundState.TransactionController.transactions[0], | |
txParams: { | |
...stakingDepositConfirmationState.engine.backgroundState.TransactionController.transactions[0].txParams, | |
value: `0x${decGWEIToHexWEI(10 ** 8)}`, | |
}, | |
} | |
] | |
}, | |
}, | |
}, | |
staking: { | |
...initialRootState.staking, | |
vaultData: { | |
...initialRootState.staking.vaultData, | |
apy: '2.2', | |
}, | |
}, | |
}, | |
}); | |
const updatedState = merge({}, stakingDepositConfirmationState, { | |
engine: { | |
backgroundState: { | |
TransactionController: { | |
transactions: [ | |
{ | |
txParams: { | |
value: `0x${decGWEIToHexWEI(10 ** 8)}`, | |
}, | |
}, | |
], | |
}, | |
}, | |
}, | |
staking: { | |
vaultData: { | |
apy: '2.2', | |
}, | |
}, | |
}); | |
const { getByText } = renderWithProvider(<StakingDetails />, { | |
state: updatedState, | |
}); |
Could this be simpler with lodash merge here and app/components/Views/confirmations/hooks/useStakingDetails.test.ts
?
Description
Adds hook that encapsulates the component logic, and unit tests.
Related issues
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/4081
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist