Skip to content

Commit

Permalink
Merge pull request #15067 from MetaMask/Version-v10.16.1
Browse files Browse the repository at this point in the history
Version v10.16.1 RC
  • Loading branch information
danjm authored Jun 28, 2022
2 parents 4d42715 + 05f29ed commit 1b9130d
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 7 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [10.16.1]
### Changed
- This release is a patch for v10.15.2, so all changes in v10.16.0 have been temporarily reverted. They will be restored in a future v16 release. ([#15063](https://github.com/MetaMask/metamask-extension/pull/15063))

### Fixed
- Fix bug that could cause an incorrect recipient address after pasting an address, without a 0x prefix, in the send flow while sending a token ([#15064](https://github.com/MetaMask/metamask-extension/pull/15064)


## [10.15.1]
### Fixed
- Fix Ledger connection failures that can occur after remove all hardware wallet accounts and reconnecting ([#14993](https://github.com/MetaMask/metamask-extension/pull/14993))
Expand Down Expand Up @@ -2969,7 +2977,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Uncategorized
- Added the ability to restore accounts from seed words.

[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.15.1...HEAD
[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.16.1...HEAD
[10.16.1]: https://github.com/MetaMask/metamask-extension/compare/v10.15.1...v10.16.1
[10.15.1]: https://github.com/MetaMask/metamask-extension/compare/v10.15.0...v10.15.1
[10.15.0]: https://github.com/MetaMask/metamask-extension/compare/v10.14.7...v10.15.0
[10.14.7]: https://github.com/MetaMask/metamask-extension/compare/v10.14.6...v10.14.7
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "metamask-crx",
"version": "10.15.1",
"version": "10.16.1",
"private": true,
"repository": {
"type": "git",
Expand Down
42 changes: 42 additions & 0 deletions ui/ducks/send/send.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,48 @@ describe('Send Slice', () => {
);
});
});

it('should set the correct token transfers', () => {
const tokenTransferTxState = {
...initialState,
status: SEND_STATUSES.VALID,
transactionType: TRANSACTION_ENVELOPE_TYPES.FEE_MARKET,
account: {
address: '0x6784e8507A1A46443f7bDc8f8cA39bdA92A675A6',
},
asset: {
details: {
address: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
},
type: 'TOKEN',
},
recipient: {
address: '4F90e18605Fd46F9F9Fab0e225D88e1ACf5F5324',
},
amount: {
value: '0x1',
},
gas: {
maxFeePerGas: '0x2540be400', // 10 GWEI
maxPriorityFeePerGas: '0x3b9aca00', // 1 GWEI
gasLimit: '0x5208', // 21000
},
eip1559support: true,
};

const action = {
type: 'send/updateDraftTransaction',
};

const result = sendReducer(tokenTransferTxState, action);

expect(result.draftTransaction.txParams.data).toStrictEqual(
'0xa9059cbb0000000000000000000000004f90e18605fd46f9f9fab0e225d88e1acf5f53240000000000000000000000000000000000000000000000000000000000000001',
);
expect(result.draftTransaction.txParams.to).toStrictEqual(
'0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
);
});
});

describe('useDefaultGas', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { Component } from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';

import { addHexPrefix } from '../../../../../app/scripts/lib/util';
import { isValidDomainName } from '../../../../helpers/utils/util';
import {
isBurnAddress,
Expand Down Expand Up @@ -43,7 +44,7 @@ export default class EnsInput extends Component {
!isBurnAddress(input) &&
isValidHexAddress(input, { mixedCaseUseChecksum: true })
) {
this.props.onPaste(input);
this.props.onPaste(addHexPrefix(input));
}
});
}
Expand Down Expand Up @@ -74,7 +75,7 @@ export default class EnsInput extends Component {
!isBurnAddress(input) &&
isValidHexAddress(input, { mixedCaseUseChecksum: true })
) {
onValidAddressTyped(input);
onValidAddressTyped(addHexPrefix(input));
}
}

Expand Down
4 changes: 2 additions & 2 deletions ui/pages/send/send.utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ function generateERC20TransferData({
.call(
abi.rawEncode(
['address', 'uint256'],
[toAddress, addHexPrefix(amount)],
[addHexPrefix(toAddress), addHexPrefix(amount)],
),
(x) => `00${x.toString(16)}`.slice(-2),
)
Expand All @@ -164,7 +164,7 @@ function generateERC721TransferData({
.call(
abi.rawEncode(
['address', 'address', 'uint256'],
[fromAddress, toAddress, tokenId],
[addHexPrefix(fromAddress), addHexPrefix(toAddress), tokenId],
),
(x) => `00${x.toString(16)}`.slice(-2),
)
Expand Down
2 changes: 1 addition & 1 deletion ui/pages/send/send.utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ describe('send utils', () => {
expect(rawEncode.mock.calls[0].toString()).toStrictEqual(
[
['address', 'uint256'],
['mockAddress', '0xab'],
['0xmockAddress', '0xab'],
].toString(),
);
});
Expand Down

0 comments on commit 1b9130d

Please sign in to comment.