diff --git a/src/router/index.ts b/src/router/index.ts index c86ab63..bdce7dd 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,6 +1,5 @@ import { createRouter, createWebHistory } from "vue-router"; import HomeView from "../views/HomeView.vue"; -import MockView from "../views/MockView.vue"; import TransactionHistoryView from "../views/TransactionHistoryView.vue"; import ManageBidsView from "../views/ManageBidsView.vue"; import SellerView from "@/views/SellerView.vue"; @@ -18,11 +17,6 @@ const router = createRouter({ name: "seller", component: SellerView, }, - { - path: "/mock", - name: "mock", - component: MockView, - }, { path: "/transaction_history", name: "transaction history", diff --git a/src/utils/blockchain.ts b/src/utils/blockchain.ts index 54fd363..d1dc0ff 100644 --- a/src/utils/blockchain.ts +++ b/src/utils/blockchain.ts @@ -2,35 +2,11 @@ import { useEtherStore } from "@/store/ether"; import { BigNumber, ethers } from "ethers"; // Smart contract imports -import mockToken from "./smart_contract_files/MockToken.json"; import p2pix from "./smart_contract_files/P2PIX.json"; import addresses from "./smart_contract_files/localhost.json"; // Mock wallets import -import { wallets } from "./smart_contract_files/wallets.json"; import { getProvider } from "../blockchain/provider"; -// Split tokens between wallets in wallets.json -const splitTokens = async () => { - const provider = getProvider(); - if (!provider) return; - - const signer = provider.getSigner(); - const tokenContract = new ethers.Contract( - addresses.token, - mockToken.abi, - signer - ); - - for (let i = 0; i < wallets.length; i++) { - const tx = await tokenContract.transfer( - wallets[i], - ethers.utils.parseEther("4000000.0") - ); - await tx.wait(); - // updateWalletStatus(); - } -}; - // get all wallet transactions const listAllTransactionByWalletAddress = async ( walletAddress: string @@ -231,39 +207,6 @@ const updateLockReleasedEvents = async () => { console.log("RELEASES", eventsReleases); }; -const mockDeposit = async (tokenQty: Number, pixKey: String) => { - const provider = getProvider(); - if (!provider) return; - - const signer = provider.getSigner(); - - const tokenContract = new ethers.Contract( - addresses.token, - mockToken.abi, - signer - ); - - const apprv = await tokenContract.approve( - addresses.p2pix, - formatEther(String(tokenQty)) - ); - await apprv.wait(); - - const p2pContract = new ethers.Contract(addresses.p2pix, p2pix.abi, signer); - - const deposit = await p2pContract.deposit( - addresses.token, - formatEther(String(tokenQty)), - pixKey, - ethers.utils.formatBytes32String("") - ); - await deposit.wait(); - - // await updateWalletStatus(); - await updateValidDeposits(); - await updateDepositAddedEvents(); -}; - // Get specific deposit data by its ID const mapDeposits = async (depositId: BigNumber): Promise => { const provider = getProvider(); @@ -303,13 +246,11 @@ const formatBigNumber = (num: BigNumber) => { export default { formatEther, - splitTokens, listValidDepositTransactionsByWalletAddress, listAllTransactionByWalletAddress, listReleaseTransactionByWalletAddress, listDepositTransactionByWalletAddress, listLockTransactionByWalletAddress, - mockDeposit, mapDeposits, formatBigNumber, mapLocks, @@ -317,4 +258,5 @@ export default { updateValidDeposits, getValidDeposits, updateLockReleasedEvents, + updateDepositAddedEvents, }; diff --git a/src/views/MockView.vue b/src/views/MockView.vue deleted file mode 100644 index 3ba59f4..0000000 --- a/src/views/MockView.vue +++ /dev/null @@ -1,143 +0,0 @@ - - - - -