• R/O
  • HTTP
  • SSH
  • HTTPS

bytom-dashboard: Commit

dashboard of Bytom


Commit MetaInfo

Revisionc8d58a329701ea3e2ff6c527d7621b4d04c48b56 (tree)
Zeit2019-07-18 19:43:39
AutorZhiting Lin <zlin035@uott...>
CommiterZhiting Lin

Log Message

removed the set mining address

Ändern Zusammenfassung

Diff

--- a/src/features/accounts/actions.js
+++ b/src/features/accounts/actions.js
@@ -22,26 +22,13 @@ const switchAccount = (accountAlias) => {
2222 }
2323 }
2424
25-const setMiningAddress = (accountAlias) =>{
26- return action.transaction.getAddresses({accountAlias}).then(address => {
27- return chainClient().accounts.setMiningAddress({'miningAddress':address}).then(resp =>{
28- if (resp.status === 'fail') {
29- throw resp
30- }
31-
32- return resp
33- })
34- })
35-}
3625
3726 const setDefaultAccount = () =>{
3827 return (dispatch) => {
3928 return chainClient().accounts.query().then(result => {
4029 const account = result.data[0].alias
41- return setMiningAddress(account).then(()=>{
42- dispatch(switchAccount((account)))
43- return account
44- })
30+ dispatch(switchAccount((account)))
31+ return account
4532 })
4633 }
4734 }
@@ -123,8 +110,7 @@ let actions = {
123110 switchAccount,
124111 setDefaultAccount,
125112 createAccount,
126- createSuccess,
127- setMiningAddress
113+ createSuccess
128114 }
129115
130116 export default actions
--- a/src/features/accounts/components/List.jsx
+++ b/src/features/accounts/components/List.jsx
@@ -38,11 +38,7 @@ const mapStateToProps = (state, ownProps) => {
3838 const mapDispatchToProps = (dispatch) => ({
3939 ...BaseList.mapDispatchToProps(type)(dispatch),
4040 itemActions: {
41- switch: (account) => {
42- return actions.setMiningAddress(account).then(()=>{
43- dispatch(actions.switchAccount((account)))
44- })
45- }
41+ switch: (account) => dispatch(actions.switchAccount((account)))
4642 },
4743 })
4844 export default withNamespaces('translations') (BaseList.connect(
--- a/src/sdk/api/accounts.js
+++ b/src/sdk/api/accounts.js
@@ -38,11 +38,6 @@ const accountsAPI = (client) => {
3838 validateAddresses: (address, cb) => shared.query(client, 'accounts', '/validate-address', {'address': address}, {cb}),
3939
4040 listAccountVotes: (params, cb) => shared.query(client, 'accounts', '/list-account-votes', params, {cb}),
41-
42- setMiningAddress: (params, cb) => shared.tryCallback(
43- client.request('/set-mining-address', params),
44- cb
45- ),
4641 }
4742 }
4843
Show on old repository browser