From c2734f1c6885384a825ac2b32801ad4f812a9f13 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Tue, 18 Dec 2018 20:12:34 +0300 Subject: [PATCH 1/4] bytes input is not a mandatory to fill --- old-ui/app/components/send/send-contract.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/old-ui/app/components/send/send-contract.js b/old-ui/app/components/send/send-contract.js index c2e292c0926c..53a6f9cd1484 100644 --- a/old-ui/app/components/send/send-contract.js +++ b/old-ui/app/components/send/send-contract.js @@ -148,6 +148,16 @@ class SendTransactionScreen extends PersistentForm { {params.name || `Input ${ind + 1}`} ) + //bytes field is not mandatory to fill: 0x is by defualt + if (params.type.startsWith('bytes') && !Array.isArray(params.type)) { + const inputValues = this.props.inputValues || {} + if (!inputValues[ind]) { + inputValues[ind] = '0x' + this.setState({ + inputValues, + }) + } + } const input = ( Date: Tue, 18 Dec 2018 20:14:38 +0300 Subject: [PATCH 2/4] eslint fix --- old-ui/app/components/send/send-contract.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/old-ui/app/components/send/send-contract.js b/old-ui/app/components/send/send-contract.js index 53a6f9cd1484..34eedf7ed474 100644 --- a/old-ui/app/components/send/send-contract.js +++ b/old-ui/app/components/send/send-contract.js @@ -148,7 +148,7 @@ class SendTransactionScreen extends PersistentForm { {params.name || `Input ${ind + 1}`} ) - //bytes field is not mandatory to fill: 0x is by defualt + // bytes field is not mandatory to fill: 0x is by defualt if (params.type.startsWith('bytes') && !Array.isArray(params.type)) { const inputValues = this.props.inputValues || {} if (!inputValues[ind]) { From cd8b1e61fcbdb25390459764ee189045e6b99e0f Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Tue, 18 Dec 2018 20:15:43 +0300 Subject: [PATCH 3/4] typo --- old-ui/app/components/send/send-contract.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/old-ui/app/components/send/send-contract.js b/old-ui/app/components/send/send-contract.js index 34eedf7ed474..c00eb701c3c7 100644 --- a/old-ui/app/components/send/send-contract.js +++ b/old-ui/app/components/send/send-contract.js @@ -148,7 +148,7 @@ class SendTransactionScreen extends PersistentForm { {params.name || `Input ${ind + 1}`} ) - // bytes field is not mandatory to fill: 0x is by defualt + // bytes field is not mandatory to fill: 0x is by default if (params.type.startsWith('bytes') && !Array.isArray(params.type)) { const inputValues = this.props.inputValues || {} if (!inputValues[ind]) { From fd35ebed882829a414adfe18a82409cb158efdb7 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Wed, 19 Dec 2018 18:23:56 +0300 Subject: [PATCH 4/4] Hardware label --- old-ui/app/components/account-dropdowns.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/old-ui/app/components/account-dropdowns.js b/old-ui/app/components/account-dropdowns.js index 1ca406632e82..44f8e46cfdd7 100644 --- a/old-ui/app/components/account-dropdowns.js +++ b/old-ui/app/components/account-dropdowns.js @@ -117,8 +117,7 @@ class AccountDropdowns extends Component { ) } - ifHardwareAcc (address) { - const keyring = getCurrentKeyring(address, this.props.network, this.props.keyrings, this.props.identities) + ifHardwareAcc (keyring) { if (keyring && keyring.type.search('Hardware') !== -1) { return true } @@ -130,6 +129,8 @@ class AccountDropdowns extends Component { let label if (ifContractAcc(keyring)) { label = 'CONTRACT' + } else if (this.ifHardwareAcc(keyring)) { + label = 'HARDWARE' } else { label = 'IMPORTED' } @@ -287,7 +288,7 @@ class AccountDropdowns extends Component { }, 'Copy address to clipboard', ), - (!this.ifHardwareAcc(selected) && !(ifContractAcc(keyring))) ? h( + (!this.ifHardwareAcc(keyring) && !(ifContractAcc(keyring))) ? h( DropdownMenuItem, { closeMenu: () => {},