From 406a861c17da1f12a3ebd729496a4bbf41a67ca1 Mon Sep 17 00:00:00 2001 From: Jeff Lau Date: Tue, 19 Nov 2019 18:06:57 +0800 Subject: [PATCH 1/2] Split signer (#533) * Remove reload on accountsChange. Update ui to add split signer * Update lock file * WIP changed reloadOnAccountsChange to true * Change reload back to false * Add waiting message to network info query * update UI package * Add timeouts for cypress tests * Update UI package * Revert spec changes * Update UI package --- package.json | 2 +- src/api/subDomainRegistrar.js | 10 +++------ .../NetworkInformation/NetworkInfoQuery.js | 22 ++++++++++++++++++- yarn.lock | 8 +++---- 4 files changed, 29 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 266d91099..d3c4d03f2 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "@ensdomains/ethregistrar": "^1.2.2", "@ensdomains/react-ens-address": "^0.0.16", "@ensdomains/resolver": "^0.1.11", - "@ensdomains/ui": "1.1.31", + "@ensdomains/ui": "1.1.39", "apollo-cache-inmemory": "^1.2.9", "apollo-client": "^2.4.5", "apollo-link": "^1.2.2", diff --git a/src/api/subDomainRegistrar.js b/src/api/subDomainRegistrar.js index 3b4b0e63b..d14493cba 100644 --- a/src/api/subDomainRegistrar.js +++ b/src/api/subDomainRegistrar.js @@ -1,5 +1,5 @@ import subDomainRegistrarContract from './contracts/subDomainRegistrarContract.json' -import { getSignerOrProvider } from '@ensdomains/ui' +import { getProvider } from '@ensdomains/ui' import { Contract, utils } from 'ethers' import domains from '../constants/domains.json' let subDomainRegistrars = {} @@ -7,13 +7,9 @@ let subDomainRegistrars = {} const defaultAddress = '0x0b07463b30b302a98407d3e3df85ebc073b0dbd1' const getSubDomainRegistrar = async address => { - const signerOrProvider = await getSignerOrProvider() + const provider = await getProvider() function instantiateContract(address) { - const contract = new Contract( - address, - subDomainRegistrarContract, - signerOrProvider - ) + const contract = new Contract(address, subDomainRegistrarContract, provider) subDomainRegistrars[address] = contract return contract } diff --git a/src/components/NetworkInformation/NetworkInfoQuery.js b/src/components/NetworkInformation/NetworkInfoQuery.js index 862902dbd..fb75bab41 100644 --- a/src/components/NetworkInformation/NetworkInfoQuery.js +++ b/src/components/NetworkInformation/NetworkInfoQuery.js @@ -1,4 +1,5 @@ import React from 'react' +import styled from '@emotion/styled' import { Query } from 'react-apollo' import gql from 'graphql-tag' import Loader from '../Loader' @@ -12,10 +13,29 @@ export const GET_WEB3 = gql` } ` +const Waiting = styled('div')` + color: #ccc; + display: flex; + font-size: 11px; + text-transform: uppercase; + font-weight: 700; +` + +const WaitingText = styled('span')` + margin-right: 5px; +` + const NetworkInfoQuery = ({ noLoader, children }) => ( {({ data, loading, error }) => { - if (loading) return noLoader ? '' : + if (loading) + return noLoader ? ( + '' + ) : ( + + Waiting for accounts + + ) const { web3: { accounts, network } } = data diff --git a/yarn.lock b/yarn.lock index c3adbd4b7..8639e58ea 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1331,10 +1331,10 @@ resolved "https://registry.yarnpkg.com/@ensdomains/resolver/-/resolver-0.1.9.tgz#013bc88397c2c204737aaaf602380145d845e09e" integrity sha512-eSZIEWi2UcxNZXJhAeoTYUZr20fyly9eMUy17WQ5UjszXf0QgE1Zzh/Oj9Mhl0i8s7xqoPOsntr2ZI0JhsX78w== -"@ensdomains/ui@1.1.31": - version "1.1.31" - resolved "https://registry.yarnpkg.com/@ensdomains/ui/-/ui-1.1.31.tgz#225f5a9af1b9586cd103d0d361d4bacee3eb1a86" - integrity sha512-LfGDLmGFFxLbqBA+/GVeF7VK5ULl2vdQf+OvFVGbnnNA2tU+nC5krzLwCaxC1RK7Jviur5Cix8rXppVyABvEgw== +"@ensdomains/ui@1.1.39": + version "1.1.39" + resolved "https://registry.yarnpkg.com/@ensdomains/ui/-/ui-1.1.39.tgz#e3bdc7b4450c3e0fe91731f9622aba66274afead" + integrity sha512-9GU8HXUI7fYwtgKDrCsndiYv9v88LAruv50TMebYJeaPzzuYKS+eCgi5W1tOo8kbaymles1yCvdiUTAQK3DZwQ== dependencies: "@0xproject/utils" "^2.0.2" "@babel/runtime" "^7.4.4" From e7d42bcc983133a9f1c761d427e88cefcffd0bf9 Mon Sep 17 00:00:00 2001 From: Makoto Inoue <2630+makoto@users.noreply.github.com> Date: Tue, 19 Nov 2019 10:09:35 +0000 Subject: [PATCH 2/2] Fix bug on not showing Manager for short names which has no controller set. (#532) * Change short name length from 6 to 3 * Rename to getProvider * Bump up ui to version 1.1.35 * Upgrade ui to 36 --- src/utils/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/utils.js b/src/utils/utils.js index 03fa9dbf5..2afabf7de 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -157,5 +157,5 @@ export function isElementInViewport(el) { export const emptyAddress = _emptyAddress export function isShortName(term) { - return [...term].length < 7 + return [...term].length < 3 }