on master help sign in
Annotate proxy address if it's a known service contract
d80953fFang
src/views/Admin/AdminEditPermissions.js+10−7
@@ -20,6 +20,7 @@ import { PROXY_TYPE, proxyTypeToHuman } from 'lib/proxy';
20import { useLocalRouter } from 'lib/LocalRouter';
20import { useLocalRouter } from 'lib/LocalRouter';
21import { formatDots } from 'lib/dateFormat';
21import { formatDots } from 'lib/dateFormat';
22import capitalize from 'lib/capitalize';
22import capitalize from 'lib/capitalize';
23+import { eqAddr } from 'lib/wallet';
23
24
24//TODO consolidate with azimuth-js' getActivationBlock
25//TODO consolidate with azimuth-js' getActivationBlock
25const getRekeyDate = async (web3, contracts, point) => {
26const getRekeyDate = async (web3, contracts, point) => {
@@ -44,6 +45,8 @@ export default function AdminEditPermissions() {
44 const { pointCursor } = usePointCursor();
45 const { pointCursor } = usePointCursor();
45 const { getDetails } = usePointCache();
46 const { getDetails } = usePointCache();
46
47
48+ const _contracts = need.contracts(contracts);
49+
47 const [rekeyDate, setRekeyDate] = useState(Nothing());
50 const [rekeyDate, setRekeyDate] = useState(Nothing());
48
51
49 const point = need.point(pointCursor);
52 const point = need.point(pointCursor);
@@ -56,12 +59,10 @@ export default function AdminEditPermissions() {
56 const { canManage, isOwner } = usePermissionsForPoint(userAddress, point);
59 const { canManage, isOwner } = usePermissionsForPoint(userAddress, point);
57
60
58 useLifecycle(() => {
61 useLifecycle(() => {
59− getRekeyDate(need.web3(web3), need.contracts(contracts), point).then(
62+ getRekeyDate(need.web3(web3), _contracts, point).then(res => {
60− res => {
61− if (res === null) setRekeyDate(Just(new Date()));
63+ if (res === null) setRekeyDate(Just(new Date()));
62− else setRekeyDate(Just(res));
64+ else setRekeyDate(Just(res));
63− }
64− );
65+ });
65 });
66 });
66
67
67 const goToProxy = useCallback(
68 const goToProxy = useCallback(
@@ -72,8 +73,10 @@ export default function AdminEditPermissions() {
72 const goSetKeys = useCallback(() => push(names.SET_KEYS), [push, names]);
73 const goSetKeys = useCallback(() => push(names.SET_KEYS), [push, names]);
73
74
74 const proxyAction = (proxyType, address, enabled) => {
75 const proxyAction = (proxyType, address, enabled) => {
75− if (address === ETH_ZERO_ADDR) {
76+ if (eqAddr(address, ETH_ZERO_ADDR)) {
76 address = 'Not yet set';
77 address = 'Not yet set';
78+ } else if (eqAddr(address, _contracts.delegatedSending.address)) {
79+ address = address + ' (invites contract)';
77 }
80 }
78
81
79 const detail = enabled
82 const detail = enabled