From 164e6a07bb1e4fb8c041696b219dd84311b0d2d7 Mon Sep 17 00:00:00 2001 From: Daniel Ternyak Date: Mon, 3 Jul 2017 19:20:47 -0500 Subject: [PATCH] fix additional hardcoded address issues --- .../containers/Tabs/SendTransaction/components/Donate.jsx | 7 ++----- common/containers/Tabs/SendTransaction/index.jsx | 5 +++-- common/containers/Tabs/SendTransaction/messages.js | 3 ++- common/sagas/ens.js | 5 ++--- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/common/containers/Tabs/SendTransaction/components/Donate.jsx b/common/containers/Tabs/SendTransaction/components/Donate.jsx index 5a59d30e..15e0b77a 100644 --- a/common/containers/Tabs/SendTransaction/components/Donate.jsx +++ b/common/containers/Tabs/SendTransaction/components/Donate.jsx @@ -2,6 +2,7 @@ import React from 'react'; import translate from 'translations'; +import { donationAddressMap } from 'config/data'; export default class Donate extends React.Component { props: { @@ -31,11 +32,7 @@ export default class Donate extends React.Component { onClick = () => { // FIXME move to config - this.props.onDonate( - '0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8', - '1', - 'ETH' - ); + this.props.onDonate(donationAddressMap.ETH, '1', 'ETH'); this.setState({ clicked: true }); }; diff --git a/common/containers/Tabs/SendTransaction/index.jsx b/common/containers/Tabs/SendTransaction/index.jsx index d54a283b..86026039 100644 --- a/common/containers/Tabs/SendTransaction/index.jsx +++ b/common/containers/Tabs/SendTransaction/index.jsx @@ -15,6 +15,7 @@ import { import pickBy from 'lodash/pickBy'; // import type { Transaction } from './types'; import customMessages from './messages'; +import { donationAddressMap } from 'config/data'; type State = { hasQueryString: boolean, @@ -94,7 +95,7 @@ export class SendTransaction extends React.Component { return (
-
+
{hasQueryString &&
@@ -137,7 +138,7 @@ export class SendTransaction extends React.Component {
diff --git a/common/containers/Tabs/SendTransaction/messages.js b/common/containers/Tabs/SendTransaction/messages.js index 6067fecc..927242a6 100644 --- a/common/containers/Tabs/SendTransaction/messages.js +++ b/common/containers/Tabs/SendTransaction/messages.js @@ -1,9 +1,10 @@ // @flow +import { donationAddressMap } from 'config/data'; export default [ { // donation address example - to: '0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8', + to: donationAddressMap.ETH, gasLimit: 21000, data: '', msg: 'Thank you for donating to MyEtherWallet. TO THE MOON!' diff --git a/common/sagas/ens.js b/common/sagas/ens.js index 240dd855..ee4eefae 100644 --- a/common/sagas/ens.js +++ b/common/sagas/ens.js @@ -4,6 +4,7 @@ import { delay } from 'redux-saga'; import { cacheEnsAddress } from 'actions/ens'; import type { ResolveEnsNameAction } from 'actions/ens'; import { getEnsAddress } from 'selectors/ens'; +import { donationAddressMap } from 'config/data'; function* resolveEns(action: ResolveEnsNameAction) { const ensName = action.payload; @@ -25,9 +26,7 @@ function* resolveEns(action: ResolveEnsNameAction) { return; } yield call(delay, 1000); - yield put( - cacheEnsAddress(ensName, '0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8') - ); + yield put(cacheEnsAddress(ensName, donationAddressMap.ETH)); } export default function* notificationsSaga() {