diff --git a/CHANGELOG.md b/CHANGELOG.md index 088caecb7..fc20d601f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Current Develop Branch +## 9.1.1 Wed Mar 03 2021 +- [#10560](https://github.com/MetaMask/metamask-extension/pull/10560): Fix ENS resolution related crashes when switching networks on send screen +- [#10561](https://github.com/MetaMask/metamask-extension/pull/10561): Fix crash when speeding up an attempt to cancel a transaction on custom networks + ## 9.1.0 Mon Mar 01 2021 - [#10265](https://github.com/MetaMask/metamask-extension/pull/10265): Update Japanese translations. - [#9388](https://github.com/MetaMask/metamask-extension/pull/9388): Update Chinese(Simplified) translations. diff --git a/app/manifest/_base.json b/app/manifest/_base.json index 2e0a5d625..8c04191bb 100644 --- a/app/manifest/_base.json +++ b/app/manifest/_base.json @@ -78,6 +78,6 @@ "notifications" ], "short_name": "__MSG_appName__", - "version": "9.1.0", + "version": "9.1.1", "web_accessible_resources": ["inpage.js", "phishing.html"] } diff --git a/ui/app/pages/send/send-content/add-recipient/ens-input.component.js b/ui/app/pages/send/send-content/add-recipient/ens-input.component.js index a0977406e..f984f13d8 100644 --- a/ui/app/pages/send/send-content/add-recipient/ens-input.component.js +++ b/ui/app/pages/send/send-content/add-recipient/ens-input.component.js @@ -72,10 +72,19 @@ export default class EnsInput extends Component { } if (prevProps.network !== network) { - const provider = global.ethereumProvider; - this.ens = new ENS({ provider, network }); - if (!newProvidedValue) { - newValue = input; + if (getNetworkEnsSupport(network)) { + const provider = global.ethereumProvider; + this.ens = new ENS({ provider, network }); + this.checkName = debounce(this.lookupEnsName, 200); + if (!newProvidedValue) { + newValue = input; + } + } else { + // ens is null on mount on a network that does not have ens support + // this is intended to prevent accidental lookup of domains across + // networks + this.ens = null; + this.checkName = null; } } diff --git a/ui/app/selectors/custom-gas.js b/ui/app/selectors/custom-gas.js index b6662c03b..2cb40f5a6 100644 --- a/ui/app/selectors/custom-gas.js +++ b/ui/app/selectors/custom-gas.js @@ -64,7 +64,7 @@ export function isCustomPriceSafe(state) { return true; } - if (safeLow === null) { + if (!safeLow) { return false; } diff --git a/ui/app/selectors/tests/custom-gas.test.js b/ui/app/selectors/tests/custom-gas.test.js index 020648fbd..3afb1afdd 100644 --- a/ui/app/selectors/tests/custom-gas.test.js +++ b/ui/app/selectors/tests/custom-gas.test.js @@ -6,6 +6,7 @@ const { getCustomGasPrice, getRenderableBasicEstimateData, getRenderableEstimateDataForSmallButtonsFromGWEI, + isCustomPriceSafe, } = proxyquire('../custom-gas', {}); describe('custom-gas selectors', function () { @@ -15,6 +16,44 @@ describe('custom-gas selectors', function () { assert.strictEqual(getCustomGasPrice(mockState), 'mockPrice'); }); }); + describe('isCustomGasPriceSafe()', function () { + it('should return true for gas.customData.price 0x77359400', function () { + const mockState = { + gas: { + customData: { price: '0x77359400' }, + basicEstimates: { safeLow: 1 }, + }, + }; + assert.strictEqual(isCustomPriceSafe(mockState), true); + }); + it('should return true for gas.customData.price null', function () { + const mockState = { + gas: { + customData: { price: null }, + basicEstimates: { safeLow: 1 }, + }, + }; + assert.strictEqual(isCustomPriceSafe(mockState), true); + }); + it('should return true gas.customData.price undefined', function () { + const mockState = { + gas: { + customData: { price: undefined }, + basicEstimates: { safeLow: 1 }, + }, + }; + assert.strictEqual(isCustomPriceSafe(mockState), true); + }); + it('should return false gas.basicEstimates.safeLow undefined', function () { + const mockState = { + gas: { + customData: { price: '0x77359400' }, + basicEstimates: { safeLow: undefined }, + }, + }; + assert.strictEqual(isCustomPriceSafe(mockState), false); + }); + }); describe('getCustomGasLimit()', function () { it('should return gas.customData.limit', function () {