Make Wallet first-class citizens (#3990)

* Fixed hint in Address Select + Wallet as first-class-citizen

* Separate Owned and not Owned Wallets

* Fix balance not updating

* Fix MethodDecoding for Contract Deployment

* Fix TypedInput params

* Fix Token Transfer for Wallet

* Small change to contracts

* Fix wallets shown twice

* Fix separation of accounts and wallets in Accounts

* Fix linting

* Execute contract methods from Wallet ✓

* Fixing linting

* Wallet as first-class citizen: Part 1 (Manual) #3784

* Lower level wallet transaction convertion

* Fix linting

* Proper autoFocus on right Signer input

* PR Grumble: don't show Wallets in dApps Permissions

* Add postTransaction and gasEstimate wrapper methods

* Extract Wallet postTx and gasEstimate to utils + PATCH api

* Remove invalid test

It's totally valid for input's length not to be a multiple of 32 bytes. EG. for Wallet Contracts

* Merge master

* Fix linting

* Fix merge issue

* Rename Portal

* Rename Protal => Portal (typo)
This commit is contained in:
Nicolas Gotchac
2016-12-30 12:28:12 +01:00
committed by Gav Wood
parent 88c0329a31
commit fd41a10319
46 changed files with 570 additions and 230 deletions

View File

@@ -26,8 +26,8 @@ import TextFieldUnderline from 'material-ui/TextField/TextFieldUnderline';
import AccountCard from '~/ui/AccountCard';
import InputAddress from '~/ui/Form/InputAddress';
import Portal from '~/ui/Portal';
import { validateAddress } from '~/util/validation';
import { nodeOrStringProptype } from '~/util/proptypes';
import { validateAddress } from '~/util/validation';
import AddressSelectStore from './addressSelectStore';
import styles from './addressSelect.css';
@@ -40,6 +40,7 @@ let currentId = 1;
@observer
class AddressSelect extends Component {
static contextTypes = {
intl: React.PropTypes.object.isRequired,
api: PropTypes.object.isRequired,
muiTheme: PropTypes.object.isRequired
};
@@ -55,7 +56,6 @@ class AddressSelect extends Component {
contacts: PropTypes.object,
contracts: PropTypes.object,
tokens: PropTypes.object,
wallets: PropTypes.object,
// Optional props
allowInput: PropTypes.bool,
@@ -160,6 +160,12 @@ class AddressSelect extends Component {
}
const id = `addressSelect_${++currentId}`;
const ilHint = typeof hint === 'string' || !(hint && hint.props)
? (hint || '')
: this.context.intl.formatMessage(
hint.props,
hint.props.values || {}
);
return (
<Portal
@@ -174,7 +180,7 @@ class AddressSelect extends Component {
<input
id={ id }
className={ styles.input }
placeholder={ hint }
placeholder={ ilHint }
onBlur={ this.handleInputBlur }
onFocus={ this.handleInputFocus }

View File

@@ -78,14 +78,13 @@ export default class AddressSelectStore {
}
@action setValues (props) {
const { accounts = {}, contracts = {}, contacts = {}, wallets = {} } = props;
const { accounts = {}, contracts = {}, contacts = {} } = props;
const accountsN = Object.keys(accounts).length;
const contractsN = Object.keys(contracts).length;
const contactsN = Object.keys(contacts).length;
const walletsN = Object.keys(wallets).length;
if (accountsN + contractsN + contactsN + walletsN === 0) {
if (accountsN + contractsN + contactsN === 0) {
return;
}
@@ -98,10 +97,7 @@ export default class AddressSelectStore {
defaultMessage='accounts'
/>
),
values: [].concat(
Object.values(wallets),
Object.values(accounts)
)
values: Object.values(accounts)
},
{
key: 'contacts',