diff --git a/src/components/SearchBar/SearchBar.js b/src/components/SearchBar/SearchBar.js index 12f30db..9574230 100644 --- a/src/components/SearchBar/SearchBar.js +++ b/src/components/SearchBar/SearchBar.js @@ -101,7 +101,7 @@ class SearchBar extends Component { const resolver = await getResolver(this.state.searchValue, this.props.web3); const owner = await getOwner(this.state.searchValue, this.props.web3); - const entries = await getEntries(seachdamain); + const entries = await getEntries(seachdamain, this.props.web3); let ipfsHash = ""; this.setState({resolver, owner, entries}); diff --git a/src/lib/registrarService.js b/src/lib/registrarService.js index c11b585..857179a 100644 --- a/src/lib/registrarService.js +++ b/src/lib/registrarService.js @@ -23,9 +23,9 @@ export const mode = ["Open", "Auction", "Owned", "Forbidden", "Reveal", "NotYetA * @param {*} name * @returns {array} tuple */ -export const getEntries = async (name) => { +export const getEntries = async (name, web3Provider) => { try { - setWeb3Provider(); + let registrar = new Registrar(web3Provider, getEthereumRegistrarAddress(process.env.WNS_NETWORK)); const result = await registrar.entries(web3.sha3(name)); return { state: mode[result[0].toString()],