mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Fixing hex address display bug when editing transaction (#15873)
This commit is contained in:
parent
b5049a1736
commit
c8935c6951
@ -1714,8 +1714,10 @@ export function editExistingTransaction(assetType, transactionId) {
|
|||||||
...draftTransactionInitialState.recipient,
|
...draftTransactionInitialState.recipient,
|
||||||
address: transaction.txParams.to,
|
address: transaction.txParams.to,
|
||||||
nickname:
|
nickname:
|
||||||
getAddressBookEntryOrAccountName(state, transaction.txParams.to)
|
getAddressBookEntryOrAccountName(
|
||||||
?.name ?? '',
|
state,
|
||||||
|
transaction.txParams.to,
|
||||||
|
) ?? '',
|
||||||
},
|
},
|
||||||
amount: {
|
amount: {
|
||||||
...draftTransactionInitialState.amount,
|
...draftTransactionInitialState.amount,
|
||||||
@ -1739,8 +1741,7 @@ export function editExistingTransaction(assetType, transactionId) {
|
|||||||
const tokenAmountInDec =
|
const tokenAmountInDec =
|
||||||
assetType === ASSET_TYPES.TOKEN ? getTokenValueParam(tokenData) : '1';
|
assetType === ASSET_TYPES.TOKEN ? getTokenValueParam(tokenData) : '1';
|
||||||
const address = getTokenAddressParam(tokenData);
|
const address = getTokenAddressParam(tokenData);
|
||||||
const nickname =
|
const nickname = getAddressBookEntryOrAccountName(state, address) ?? '';
|
||||||
getAddressBookEntryOrAccountName(state, address)?.name ?? '';
|
|
||||||
|
|
||||||
const tokenAmountInHex = addHexPrefix(
|
const tokenAmountInHex = addHexPrefix(
|
||||||
conversionUtil(tokenAmountInDec, {
|
conversionUtil(tokenAmountInDec, {
|
||||||
|
@ -2460,7 +2460,7 @@ describe('Send Slice', () => {
|
|||||||
recipient: {
|
recipient: {
|
||||||
address: '0xRecipientAddress',
|
address: '0xRecipientAddress',
|
||||||
error: null,
|
error: null,
|
||||||
nickname: '',
|
nickname: '0xRecipientAddress',
|
||||||
warning: null,
|
warning: null,
|
||||||
recipientWarningAcknowledged: false,
|
recipientWarningAcknowledged: false,
|
||||||
type: '',
|
type: '',
|
||||||
@ -2605,7 +2605,7 @@ describe('Send Slice', () => {
|
|||||||
recipient: {
|
recipient: {
|
||||||
address: BURN_ADDRESS,
|
address: BURN_ADDRESS,
|
||||||
error: null,
|
error: null,
|
||||||
nickname: '',
|
nickname: BURN_ADDRESS,
|
||||||
warning: null,
|
warning: null,
|
||||||
type: '',
|
type: '',
|
||||||
recipientWarningAcknowledged: false,
|
recipientWarningAcknowledged: false,
|
||||||
@ -2797,7 +2797,7 @@ describe('Send Slice', () => {
|
|||||||
address: BURN_ADDRESS,
|
address: BURN_ADDRESS,
|
||||||
error: null,
|
error: null,
|
||||||
warning: null,
|
warning: null,
|
||||||
nickname: '',
|
nickname: BURN_ADDRESS,
|
||||||
type: '',
|
type: '',
|
||||||
recipientWarningAcknowledged: false,
|
recipientWarningAcknowledged: false,
|
||||||
},
|
},
|
||||||
|
@ -28,7 +28,7 @@ export default class AddRecipient extends Component {
|
|||||||
isUsingMyAccountsForRecipientSearch: PropTypes.bool,
|
isUsingMyAccountsForRecipientSearch: PropTypes.bool,
|
||||||
recipient: PropTypes.shape({
|
recipient: PropTypes.shape({
|
||||||
address: PropTypes.string,
|
address: PropTypes.string,
|
||||||
nickname: PropTypes.nickname,
|
nickname: PropTypes.string,
|
||||||
error: PropTypes.string,
|
error: PropTypes.string,
|
||||||
warning: PropTypes.string,
|
warning: PropTypes.string,
|
||||||
}),
|
}),
|
||||||
|
Loading…
Reference in New Issue
Block a user