Small UI fixes (#3966)
* Load dapp visibility from localStorage * Align MethodDecoding address svg properly * Consolidate svg & img classes overrides * improve isNullAddress check * readOnly for null display * disabled || readOnly
This commit is contained in:
@@ -19,8 +19,11 @@ const DEFAULT_GASPRICE = '20000000000';
|
||||
|
||||
const MAX_GAS_ESTIMATION = '50000000';
|
||||
|
||||
const NULL_ADDRESS = '0000000000000000000000000000000000000000';
|
||||
|
||||
export {
|
||||
DEFAULT_GAS,
|
||||
DEFAULT_GASPRICE,
|
||||
MAX_GAS_ESTIMATION
|
||||
MAX_GAS_ESTIMATION,
|
||||
NULL_ADDRESS
|
||||
};
|
||||
|
||||
@@ -18,6 +18,8 @@ import BigNumber from 'bignumber.js';
|
||||
|
||||
import util from '~/api/util';
|
||||
|
||||
import { NULL_ADDRESS } from './constants';
|
||||
|
||||
export const ERRORS = {
|
||||
invalidAddress: 'address is an invalid network address',
|
||||
invalidAmount: 'the supplied amount should be a valid positive number',
|
||||
@@ -174,3 +176,11 @@ export function validateUint (value) {
|
||||
valueError
|
||||
};
|
||||
}
|
||||
|
||||
export function isNullAddress (address) {
|
||||
if (address && address.substr(0, 2) === '0x') {
|
||||
return isNullAddress(address.substr(2));
|
||||
}
|
||||
|
||||
return address === NULL_ADDRESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user