Update requests (#5324)

This commit is contained in:
Nicolas Gotchac
2017-03-29 14:34:21 +02:00
committed by Gav Wood
parent 7134b44f5b
commit 8930f510fc
4 changed files with 10 additions and 11 deletions

View File

@@ -36,7 +36,7 @@ class MethodDecoding extends Component {
};
static propTypes = {
address: PropTypes.string.isRequired,
address: PropTypes.string,
compact: PropTypes.bool,
token: PropTypes.object,
transaction: PropTypes.object,
@@ -44,6 +44,7 @@ class MethodDecoding extends Component {
};
static defaultProps = {
address: '',
compact: false,
historic: false
};
@@ -653,9 +654,9 @@ class MethodDecoding extends Component {
function mapStateToProps (initState, initProps) {
const { tokens } = initState.balances;
const { address } = initProps;
const { transaction } = initProps;
const token = (tokens || {})[address];
const token = (tokens || {})[transaction.to];
return () => {
return { token };

View File

@@ -119,14 +119,14 @@ export default class MethodDecodingStore {
* signature: String
* }
*/
lookup (address, transaction) {
lookup (currentAddress, transaction) {
const result = {};
if (!transaction) {
return Promise.resolve(result);
}
const isReceived = transaction.to === address;
const isReceived = transaction.to === currentAddress;
const contractAddress = isReceived ? transaction.from : transaction.to;
const input = transaction.input || transaction.data;