Skip to content

Commit

Permalink
Server-side Verification of documents (#412)
Browse files Browse the repository at this point in the history
* fix web3.fromAscii to web3.utils.asciiToHex method in document floe

* replace web3 to this.wallet.proxeusFS.web3 as metamask no longer injects web3

* remove outdated methods of old smart contract

* add public urls in case user doesnt have metamask

* fix js frontend typos

* use public url only if user doesnt have metamask installed

* use public url only if user doesnt have metamask installed

* add wrong metamask network selected issue handler

* fix user validation network screen

* remove unnecessary html code from VerificationFileEntry component

---------

Co-authored-by: slavas490 <[email protected]>
  • Loading branch information
tafonina and slavas490 committed Feb 27, 2024
1 parent 7a61871 commit 4a591fa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
10 changes: 1 addition & 9 deletions ui/core/src/components/document/VerificationFileEntry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -295,13 +295,7 @@ export default {

this.isFileInvalidated = false

let result

try {
result = await this.wallet().verifyHash(this.hash)
} catch (e) {
throw new Error('UNABLE_TO_VERIFY_HASH')
}
const result = await this.wallet().verifyHash(this.hash)

const transaction = await this.wallet().web3.eth.getTransaction(result)
this.creator = transaction.from
Expand Down Expand Up @@ -336,8 +330,6 @@ export default {

if (this.wallet().isPublicRPCUsing) {
this.errorPublicRPC = true
} else if (e?.message === 'UNABLE_TO_VERIFY_HASH') {
this.validationException = false
} else {
this.errorValidating = true
}
Expand Down
2 changes: 1 addition & 1 deletion ui/wallet/src/ProxeusEthereum/WalletInterface.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class WalletInterface {
this.web3 = new Web3(Web3.givenProvider || 'ws://localhost:8545')
this.systemNetworkId = this.getNetworkIdByName(network)

this.useProxeusWallet = (typeof window.ethereum !== 'undefined' && network !== this.getNetworkNameById(window.ethereum.networkVersion)) || forceProxeusWallet || typeof window.ethereum === 'undefined'
this.useProxeusWallet = forceProxeusWallet || typeof window.ethereum === 'undefined'

this.web3.eth.getTransactionReceiptMined = getTransactionReceiptMined
this.serviceConfig = serviceConfig[network]
Expand Down

0 comments on commit 4a591fa

Please sign in to comment.