Merge pull request #11073 from MetaMask/Version-v9.5.2

Version v9.5.2 RC
feature/default_network_editable
Thomas Huang 4 years ago committed by GitHub
commit 55e400df51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      CHANGELOG.md
  2. 2
      app/manifest/_base.json
  3. 6
      app/scripts/lib/createMetaRPCHandler.js
  4. 36
      app/scripts/lib/createMetaRPCHandler.test.js
  5. 3
      app/scripts/metamask-controller.js
  6. 10
      ui/app/components/ui/identicon/identicon.component.js
  7. 13
      ui/lib/icon-factory.js

@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [9.5.2]
### Fixed
- [#11071](https://github.com/MetaMask/metamask-extension/pull/11071): Fixing address entry error when sending a transaction on a custom network
## [9.5.1]
### Fixed
- [#11048](https://github.com/MetaMask/metamask-extension/pull/11048): Fixed icon on approval screen
@ -2226,7 +2230,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/v9.5.1...HEAD
[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v9.5.2...HEAD
[9.5.2]: https://github.com/MetaMask/metamask-extension/compare/v9.5.1...v9.5.2
[9.5.1]: https://github.com/MetaMask/metamask-extension/compare/v9.5.0...v9.5.1
[9.5.0]: https://github.com/MetaMask/metamask-extension/compare/v9.4.0...v9.5.0
[9.4.0]: https://github.com/MetaMask/metamask-extension/compare/v9.3.0...v9.4.0

@ -71,6 +71,6 @@
"notifications"
],
"short_name": "__MSG_appName__",
"version": "9.5.1",
"version": "9.5.2",
"web_accessible_resources": ["inpage.js", "phishing.html"]
}

@ -2,6 +2,9 @@ import { ethErrors, serializeError } from 'eth-rpc-errors';
const createMetaRPCHandler = (api, outStream) => {
return (data) => {
if (outStream._writableState.ended) {
return;
}
if (!api[data.method]) {
outStream.write({
jsonrpc: '2.0',
@ -13,6 +16,9 @@ const createMetaRPCHandler = (api, outStream) => {
return;
}
api[data.method](...data.params, (err, result) => {
if (outStream._writableState.ended) {
return;
}
if (err) {
outStream.write({
jsonrpc: '2.0',

@ -58,4 +58,40 @@ describe('createMetaRPCHandler', function () {
done();
});
});
it('can not throw an error for writing an error after end', function (done) {
const api = {
foo: (param1, cb) => {
assert.strictEqual(param1, 'bar');
cb(new Error('foo-error'));
},
};
const streamTest = createThoughStream();
const handler = createMetaRPCHandler(api, streamTest);
streamTest.end();
handler({
id: 1,
method: 'foo',
params: ['bar'],
});
done();
});
it('can not throw an error for write after end', function (done) {
const api = {
foo: (param1, cb) => {
assert.strictEqual(param1, 'bar');
cb(undefined, {
foo: 'bar',
});
},
};
const streamTest = createThoughStream();
const handler = createMetaRPCHandler(api, streamTest);
streamTest.end();
handler({
id: 1,
method: 'foo',
params: ['bar'],
});
done();
});
});

@ -2024,6 +2024,9 @@ export default class MetamaskController extends EventEmitter {
// set up postStream transport
outStream.on('data', createMetaRPCHandler(api, outStream));
const handleUpdate = (update) => {
if (outStream._writableState.ended) {
return;
}
// send notification to client-side
outStream.write({
jsonrpc: '2.0',

@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import classnames from 'classnames';
import contractMap from '@metamask/contract-metadata';
import { checksumAddress } from '../../../helpers/utils/util';
import { checksumAddress, isHex } from '../../../helpers/utils/util';
import Jazzicon from '../jazzicon';
import BlockieIdenticon from './blockieIdenticon';
@ -85,10 +85,12 @@ export default class Identicon extends PureComponent {
}
if (address) {
const checksummedAddress = checksumAddress(address);
if (isHex(address)) {
const checksummedAddress = checksumAddress(address);
if (contractMap[checksummedAddress]?.logo) {
return this.renderJazzicon();
if (contractMap[checksummedAddress]?.logo) {
return this.renderJazzicon();
}
}
return (

@ -1,5 +1,9 @@
import contractMap from '@metamask/contract-metadata';
import { isValidAddress, checksumAddress } from '../app/helpers/utils/util';
import {
isValidAddress,
checksumAddress,
isHex,
} from '../app/helpers/utils/util';
let iconFactory;
@ -16,7 +20,12 @@ function IconFactory(jazzicon) {
}
IconFactory.prototype.iconForAddress = function (address, diameter) {
const addr = checksumAddress(address);
let addr = address;
if (isHex(address)) {
addr = checksumAddress(address);
}
if (iconExistsFor(addr)) {
return imageElFor(addr);
}

Loading…
Cancel
Save