Fix lint issues
This commit is contained in:
parent
49834745a9
commit
e10e8f89fc
@ -1,15 +1,18 @@
|
||||
module.exports = {
|
||||
presets: [
|
||||
['@babel/preset-env', {
|
||||
modules: false
|
||||
}],
|
||||
[
|
||||
"@babel/preset-env",
|
||||
{
|
||||
modules: false,
|
||||
},
|
||||
],
|
||||
],
|
||||
env: {
|
||||
test: {
|
||||
presets: [
|
||||
['@babel/preset-env', {targets: {node: 'current'}}],
|
||||
'@babel/preset-typescript',
|
||||
["@babel/preset-env", { targets: { node: "current" } }],
|
||||
"@babel/preset-typescript",
|
||||
],
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
};
|
||||
|
@ -18,7 +18,7 @@ const getNetworksLiquidity = async (): Promise<void> => {
|
||||
import.meta.env.VITE_MUMBAI_API_URL,
|
||||
80001
|
||||
); // mumbai provider
|
||||
|
||||
|
||||
const p2pContractGoerli = new ethers.Contract(
|
||||
"0x5f3EFA9A90532914545CEf527C530658af87e196",
|
||||
p2pix.abi,
|
||||
@ -29,7 +29,7 @@ const getNetworksLiquidity = async (): Promise<void> => {
|
||||
p2pix.abi,
|
||||
mumbaiProvider
|
||||
);
|
||||
|
||||
|
||||
const depositListGoerli = await getValidDeposits(p2pContractGoerli);
|
||||
|
||||
const depositListMumbai = await getValidDeposits(p2pContractMumbai);
|
||||
@ -56,7 +56,7 @@ const getValidDeposits = async (
|
||||
const eventsDeposits = await p2pContract.queryFilter(filterDeposits);
|
||||
console.log(eventsDeposits);
|
||||
|
||||
if(!contract) p2pContract = getContract(); // get metamask provider contract
|
||||
if (!contract) p2pContract = getContract(); // get metamask provider contract
|
||||
|
||||
const depositList = await Promise.all(
|
||||
eventsDeposits.map(async (deposit) => {
|
||||
|
@ -56,9 +56,9 @@ const getEventName = (event: string | undefined): string => {
|
||||
};
|
||||
|
||||
const getAmountFormatted = (amount?: BigNumber): string => {
|
||||
if(!amount) return ""
|
||||
if (!amount) return "";
|
||||
return formatEther(amount);
|
||||
}
|
||||
};
|
||||
|
||||
// watch props changes
|
||||
watch(props, async (): Promise<void> => {
|
||||
@ -104,7 +104,9 @@ showInitialItems();
|
||||
>
|
||||
<span class="last-release-info">
|
||||
{{
|
||||
isValidDeposit(item) ? item.remaining : getAmountFormatted(item.args?.amount)
|
||||
isValidDeposit(item)
|
||||
? item.remaining
|
||||
: getAmountFormatted(item.args?.amount)
|
||||
}}
|
||||
BRZ
|
||||
</span>
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { mount } from "@vue/test-utils";
|
||||
import ListingComponent from "@/components/ListingComponent/ListingComponent.vue";
|
||||
import { createPinia, setActivePinia } from "pinia";
|
||||
import { expect } from 'vitest'
|
||||
import { expect } from "vitest";
|
||||
import { MockValidDeposits } from "@/model/mock/ValidDepositMock";
|
||||
import { MockEvents } from "@/model/mock/EventMock";
|
||||
|
||||
|
@ -2,100 +2,91 @@ import type { Event } from "ethers";
|
||||
import { vi } from "vitest";
|
||||
|
||||
export const MockEvents: Event[] = [
|
||||
{
|
||||
"blockNumber": 1,
|
||||
"blockHash": "0x8",
|
||||
"transactionIndex": 1,
|
||||
"removed": false,
|
||||
"address": "0x0",
|
||||
"data": "0x0",
|
||||
"topics": [
|
||||
"0x0",
|
||||
"0x0"
|
||||
],
|
||||
"transactionHash": "0x0",
|
||||
"logIndex": 1,
|
||||
"event": "DepositAdded",
|
||||
"eventSignature": "DepositAdded(address,uint256,address,uint256)",
|
||||
"args": [
|
||||
"0x0",
|
||||
{
|
||||
"type": "BigNumber",
|
||||
"hex": "0x00"
|
||||
},
|
||||
"0x0",
|
||||
{
|
||||
"type": "BigNumber",
|
||||
"hex": "0x6c6b935b8bbd400000"
|
||||
},
|
||||
],
|
||||
getBlock: vi.fn(),
|
||||
removeListener: vi.fn(),
|
||||
getTransaction: vi.fn(),
|
||||
getTransactionReceipt: vi.fn(),
|
||||
},
|
||||
{
|
||||
"blockNumber": 2,
|
||||
"blockHash": "0x8",
|
||||
"transactionIndex": 2,
|
||||
"removed": false,
|
||||
"address": "0x0",
|
||||
"data": "0x0",
|
||||
"topics": [
|
||||
"0x0",
|
||||
"0x0"
|
||||
],
|
||||
"transactionHash": "0x0",
|
||||
"logIndex": 2,
|
||||
"event": "LockAdded",
|
||||
"eventSignature": "LockAdded(address,uint256,address,uint256)",
|
||||
"args": [
|
||||
"0x0",
|
||||
{
|
||||
"type": "BigNumber",
|
||||
"hex": "0x00"
|
||||
},
|
||||
"0x0",
|
||||
{
|
||||
"type": "BigNumber",
|
||||
"hex": "0x6c6b935b8bbd400000"
|
||||
},
|
||||
],
|
||||
getBlock: vi.fn(),
|
||||
removeListener: vi.fn(),
|
||||
getTransaction: vi.fn(),
|
||||
getTransactionReceipt: vi.fn(),
|
||||
},
|
||||
{
|
||||
"blockNumber": 3,
|
||||
"blockHash": "0x8",
|
||||
"transactionIndex": 3,
|
||||
"removed": false,
|
||||
"address": "0x0",
|
||||
"data": "0x0",
|
||||
"topics": [
|
||||
"0x0",
|
||||
"0x0"
|
||||
],
|
||||
"transactionHash": "0x0",
|
||||
"logIndex": 3,
|
||||
"event": "LockReleased",
|
||||
"eventSignature": "LockReleased(address,uint256,address,uint256)",
|
||||
"args": [
|
||||
"0x0",
|
||||
{
|
||||
"type": "BigNumber",
|
||||
"hex": "0x00"
|
||||
},
|
||||
"0x0",
|
||||
{
|
||||
"type": "BigNumber",
|
||||
"hex": "0x6c6b935b8bbd400000"
|
||||
},
|
||||
],
|
||||
getBlock: vi.fn(),
|
||||
removeListener: vi.fn(),
|
||||
getTransaction: vi.fn(),
|
||||
getTransactionReceipt: vi.fn(),
|
||||
}
|
||||
];
|
||||
{
|
||||
blockNumber: 1,
|
||||
blockHash: "0x8",
|
||||
transactionIndex: 1,
|
||||
removed: false,
|
||||
address: "0x0",
|
||||
data: "0x0",
|
||||
topics: ["0x0", "0x0"],
|
||||
transactionHash: "0x0",
|
||||
logIndex: 1,
|
||||
event: "DepositAdded",
|
||||
eventSignature: "DepositAdded(address,uint256,address,uint256)",
|
||||
args: [
|
||||
"0x0",
|
||||
{
|
||||
type: "BigNumber",
|
||||
hex: "0x00",
|
||||
},
|
||||
"0x0",
|
||||
{
|
||||
type: "BigNumber",
|
||||
hex: "0x6c6b935b8bbd400000",
|
||||
},
|
||||
],
|
||||
getBlock: vi.fn(),
|
||||
removeListener: vi.fn(),
|
||||
getTransaction: vi.fn(),
|
||||
getTransactionReceipt: vi.fn(),
|
||||
},
|
||||
{
|
||||
blockNumber: 2,
|
||||
blockHash: "0x8",
|
||||
transactionIndex: 2,
|
||||
removed: false,
|
||||
address: "0x0",
|
||||
data: "0x0",
|
||||
topics: ["0x0", "0x0"],
|
||||
transactionHash: "0x0",
|
||||
logIndex: 2,
|
||||
event: "LockAdded",
|
||||
eventSignature: "LockAdded(address,uint256,address,uint256)",
|
||||
args: [
|
||||
"0x0",
|
||||
{
|
||||
type: "BigNumber",
|
||||
hex: "0x00",
|
||||
},
|
||||
"0x0",
|
||||
{
|
||||
type: "BigNumber",
|
||||
hex: "0x6c6b935b8bbd400000",
|
||||
},
|
||||
],
|
||||
getBlock: vi.fn(),
|
||||
removeListener: vi.fn(),
|
||||
getTransaction: vi.fn(),
|
||||
getTransactionReceipt: vi.fn(),
|
||||
},
|
||||
{
|
||||
blockNumber: 3,
|
||||
blockHash: "0x8",
|
||||
transactionIndex: 3,
|
||||
removed: false,
|
||||
address: "0x0",
|
||||
data: "0x0",
|
||||
topics: ["0x0", "0x0"],
|
||||
transactionHash: "0x0",
|
||||
logIndex: 3,
|
||||
event: "LockReleased",
|
||||
eventSignature: "LockReleased(address,uint256,address,uint256)",
|
||||
args: [
|
||||
"0x0",
|
||||
{
|
||||
type: "BigNumber",
|
||||
hex: "0x00",
|
||||
},
|
||||
"0x0",
|
||||
{
|
||||
type: "BigNumber",
|
||||
hex: "0x6c6b935b8bbd400000",
|
||||
},
|
||||
],
|
||||
getBlock: vi.fn(),
|
||||
removeListener: vi.fn(),
|
||||
getTransaction: vi.fn(),
|
||||
getTransactionReceipt: vi.fn(),
|
||||
},
|
||||
];
|
||||
|
@ -2,39 +2,39 @@ import { parseEther } from "ethers/lib/utils";
|
||||
import type { ValidDeposit } from "../ValidDeposit";
|
||||
|
||||
export const MockValidDeposits: ValidDeposit[] = [
|
||||
{
|
||||
"blockNumber": 1,
|
||||
"depositID": parseEther("1"),
|
||||
"remaining": 70,
|
||||
"seller": "mockedSellerAddress",
|
||||
"pixKey": "123456789"
|
||||
},
|
||||
{
|
||||
"blockNumber": 2,
|
||||
"depositID": parseEther("2"),
|
||||
"remaining": 200,
|
||||
"seller": "mockedSellerAddress",
|
||||
"pixKey": "123456789"
|
||||
},
|
||||
{
|
||||
"blockNumber": 3,
|
||||
"depositID": parseEther("3"),
|
||||
"remaining": 1250,
|
||||
"seller": "mockedSellerAddress",
|
||||
"pixKey": "123456789"
|
||||
},
|
||||
{
|
||||
"blockNumber": 4,
|
||||
"depositID": parseEther("4"),
|
||||
"remaining": 4000,
|
||||
"seller": "mockedSellerAddress",
|
||||
"pixKey": "123456789"
|
||||
},
|
||||
{
|
||||
"blockNumber": 5,
|
||||
"depositID": parseEther("5"),
|
||||
"remaining": 2000,
|
||||
"seller": "mockedSellerAddress",
|
||||
"pixKey": "123456789"
|
||||
}
|
||||
]
|
||||
{
|
||||
blockNumber: 1,
|
||||
depositID: parseEther("1"),
|
||||
remaining: 70,
|
||||
seller: "mockedSellerAddress",
|
||||
pixKey: "123456789",
|
||||
},
|
||||
{
|
||||
blockNumber: 2,
|
||||
depositID: parseEther("2"),
|
||||
remaining: 200,
|
||||
seller: "mockedSellerAddress",
|
||||
pixKey: "123456789",
|
||||
},
|
||||
{
|
||||
blockNumber: 3,
|
||||
depositID: parseEther("3"),
|
||||
remaining: 1250,
|
||||
seller: "mockedSellerAddress",
|
||||
pixKey: "123456789",
|
||||
},
|
||||
{
|
||||
blockNumber: 4,
|
||||
depositID: parseEther("4"),
|
||||
remaining: 4000,
|
||||
seller: "mockedSellerAddress",
|
||||
pixKey: "123456789",
|
||||
},
|
||||
{
|
||||
blockNumber: 5,
|
||||
depositID: parseEther("5"),
|
||||
remaining: 2000,
|
||||
seller: "mockedSellerAddress",
|
||||
pixKey: "123456789",
|
||||
},
|
||||
];
|
||||
|
6
src/shims-vue.d.ts
vendored
6
src/shims-vue.d.ts
vendored
@ -1,5 +1,5 @@
|
||||
declare module '*.vue' {
|
||||
import { DefineComponent } from 'vue';
|
||||
declare module "*.vue" {
|
||||
import { DefineComponent } from "vue";
|
||||
const component: DefineComponent;
|
||||
export default component;
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import vueJsx from "@vitejs/plugin-vue-jsx";
|
||||
export default defineConfig({
|
||||
test: {
|
||||
globals: true,
|
||||
environment: 'jsdom'
|
||||
environment: "jsdom",
|
||||
},
|
||||
plugins: [vue(), vueJsx()],
|
||||
resolve: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user