Skip to content

Commit c9a94c0

Browse files
author
Andriian Chestnykh
committed
Fix
1 parent a557815 commit c9a94c0

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

dapps/ui/src/index.js

+18-18
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,8 @@ const popupText = document.getElementById('popup-text')
7272

7373
const provider = new ethers.providers.Web3Provider(window.ethereum)
7474

75-
const hubProvider = new ethers.providers.JsonRpcProvider('http://localhost:8545');
7675
const hubAddress = DeployInfo.hubAddress
77-
78-
const hubContract = new ethers.Contract(hubAbi, hubAddress, hubProvider)
79-
76+
const hubContract = new ethers.Contract(hubAddress, hubAbi, provider)
8077

8178
let walletInfo = {
8279
ownershipStatus: undefined,
@@ -144,18 +141,18 @@ async function onClickSignTypedData() {
144141
const heirAddress = document.getElementById('heirAddress')
145142
const heir = provider.getSigner(heirAddress.value)
146143

147-
//todo - get public key from heir
148-
async function getPublicKeyFromHeir(address) {
149-
try {
150-
const publicKey = await hubContract.getPublicKeyHeir(address)
151-
return publicKey
152-
} catch {
153-
console.error("Error getting public key:", error)
154-
return null
155-
}
156-
}
157-
158-
const publicKeyHeir = getPublicKeyFromHeir(heirAddress.value)
144+
// //todo - get public key from heir
145+
// async function getPublicKeyFromHeir(address) {
146+
// try {
147+
// const publicKey = await hubContract.getPublicKeyHeir(address)
148+
// return publicKey
149+
// } catch {
150+
// console.error("Error getting public key:", error)
151+
// return null
152+
// }
153+
// }
154+
//
155+
// const publicKeyHeir = getPublicKeyFromHeir(heirAddress.value)
159156

160157
const im = {
161158
types: {
@@ -194,6 +191,8 @@ async function sendIMToOracle() {
194191
const url = "http://localhost:8080/"
195192
const data = signTypedDataResult.innerHTML
196193

194+
// TODO encrypt the data before sending it to Oracle
195+
197196
const options = {
198197
method: 'POST',
199198
body: JSON.stringify(JSON.parse(data)),
@@ -216,6 +215,9 @@ async function sendIMToOracle() {
216215
async function getIMFromOracle() {
217216
const response = await fetch('http://localhost:8080')
218217
const data = await response.json()
218+
219+
//TODO decrypt the data from Oracle
220+
219221
signedTypedDataFromOwnerDiv.value = JSON.stringify(data)
220222
onChangeSignedTypedDataFromOwner()
221223
}
@@ -580,8 +582,6 @@ const initialize = async () => {
580582
updateButtons()
581583
}
582584

583-
getGreetingFromContractHub()
584-
585585
// assign events
586586
connectWalletButton.onclick = onClickConnectWallet
587587
disconnectWalletButton.onclick = onClickDisconnectWallet

0 commit comments

Comments
 (0)