fixed type check errors
This commit is contained in:
parent
54cff28ba0
commit
3227e3209c
@ -87,12 +87,12 @@ describe("addresses.ts functions", () => {
|
|||||||
it("isPossibleNetwork Returns", () => {
|
it("isPossibleNetwork Returns", () => {
|
||||||
const etherStore = useEtherStore();
|
const etherStore = useEtherStore();
|
||||||
etherStore.setNetworkId(NetworkEnum.sepolia);
|
etherStore.setNetworkId(NetworkEnum.sepolia);
|
||||||
expect(isPossibleNetwork(0x5)).toBe(true);
|
expect(isPossibleNetwork(0x5 as NetworkEnum)).toBe(true);
|
||||||
expect(isPossibleNetwork(5)).toBe(true);
|
expect(isPossibleNetwork(5 as NetworkEnum)).toBe(true);
|
||||||
expect(isPossibleNetwork(0x13881)).toBe(true);
|
expect(isPossibleNetwork(0x13881 as NetworkEnum)).toBe(true);
|
||||||
expect(isPossibleNetwork(80001)).toBe(true);
|
expect(isPossibleNetwork(80001 as NetworkEnum)).toBe(true);
|
||||||
|
|
||||||
expect(isPossibleNetwork(NaN)).toBe(false);
|
expect(isPossibleNetwork(NaN as NetworkEnum)).toBe(false);
|
||||||
expect(isPossibleNetwork(0x55)).toBe(false);
|
expect(isPossibleNetwork(0x55 as NetworkEnum)).toBe(false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -26,8 +26,8 @@ export const updateWalletStatus = async (): Promise<void> => {
|
|||||||
|
|
||||||
const provider = await getProvider();
|
const provider = await getProvider();
|
||||||
const signer = await provider?.getSigner();
|
const signer = await provider?.getSigner();
|
||||||
|
const network = await provider?.getNetwork();
|
||||||
const { chainId } = await provider?.getNetwork();
|
const chainId = network?.chainId;
|
||||||
if (!isPossibleNetwork(Number(chainId))) {
|
if (!isPossibleNetwork(Number(chainId))) {
|
||||||
window.alert("Invalid chain!:" + chainId);
|
window.alert("Invalid chain!:" + chainId);
|
||||||
return;
|
return;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
export interface Bank {
|
export interface Bank {
|
||||||
COMPE: string;
|
COMPE: string;
|
||||||
ISPB: string;
|
ISPB: string;
|
||||||
longName: string;
|
longName: string;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import type { Event } from "ethers";
|
|
||||||
import { vi } from "vitest";
|
import { vi } from "vitest";
|
||||||
|
|
||||||
export const MockEvents: Event[] = [
|
export const MockEvents = [
|
||||||
{
|
{
|
||||||
blockNumber: 1,
|
blockNumber: 1,
|
||||||
blockHash: "0x8",
|
blockHash: "0x8",
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import type { ValidDeposit } from "../ValidDeposit";
|
import type { ValidDeposit } from "../ValidDeposit";
|
||||||
|
import { NetworkEnum } from "@/model/NetworkEnum";
|
||||||
|
|
||||||
export const MockValidDeposits: ValidDeposit[] = [
|
export const MockValidDeposits: ValidDeposit[] = [
|
||||||
{
|
{
|
||||||
@ -7,6 +8,7 @@ export const MockValidDeposits: ValidDeposit[] = [
|
|||||||
remaining: 70,
|
remaining: 70,
|
||||||
seller: "mockedSellerAddress",
|
seller: "mockedSellerAddress",
|
||||||
pixKey: "123456789",
|
pixKey: "123456789",
|
||||||
|
network: NetworkEnum.sepolia,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
blockNumber: 2,
|
blockNumber: 2,
|
||||||
@ -14,6 +16,7 @@ export const MockValidDeposits: ValidDeposit[] = [
|
|||||||
remaining: 200,
|
remaining: 200,
|
||||||
seller: "mockedSellerAddress",
|
seller: "mockedSellerAddress",
|
||||||
pixKey: "123456789",
|
pixKey: "123456789",
|
||||||
|
network: NetworkEnum.sepolia,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
blockNumber: 3,
|
blockNumber: 3,
|
||||||
@ -21,6 +24,7 @@ export const MockValidDeposits: ValidDeposit[] = [
|
|||||||
remaining: 1250,
|
remaining: 1250,
|
||||||
seller: "mockedSellerAddress",
|
seller: "mockedSellerAddress",
|
||||||
pixKey: "123456789",
|
pixKey: "123456789",
|
||||||
|
network: NetworkEnum.sepolia,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
blockNumber: 4,
|
blockNumber: 4,
|
||||||
@ -28,6 +32,7 @@ export const MockValidDeposits: ValidDeposit[] = [
|
|||||||
remaining: 4000,
|
remaining: 4000,
|
||||||
seller: "mockedSellerAddress",
|
seller: "mockedSellerAddress",
|
||||||
pixKey: "123456789",
|
pixKey: "123456789",
|
||||||
|
network: NetworkEnum.sepolia,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
blockNumber: 5,
|
blockNumber: 5,
|
||||||
@ -35,5 +40,6 @@ export const MockValidDeposits: ValidDeposit[] = [
|
|||||||
remaining: 2000,
|
remaining: 2000,
|
||||||
seller: "mockedSellerAddress",
|
seller: "mockedSellerAddress",
|
||||||
pixKey: "123456789",
|
pixKey: "123456789",
|
||||||
|
network: NetworkEnum.sepolia,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@ -12,6 +12,7 @@ import { getNetworksLiquidity } from "@/blockchain/events";
|
|||||||
import type { ValidDeposit } from "@/model/ValidDeposit";
|
import type { ValidDeposit } from "@/model/ValidDeposit";
|
||||||
import { getUnreleasedLockById } from "@/blockchain/events";
|
import { getUnreleasedLockById } from "@/blockchain/events";
|
||||||
import CustomAlert from "@/components/CustomAlert/CustomAlert.vue";
|
import CustomAlert from "@/components/CustomAlert/CustomAlert.vue";
|
||||||
|
import { getSolicitation } from "@/utils/bbPay";
|
||||||
|
|
||||||
enum Step {
|
enum Step {
|
||||||
Search,
|
Search,
|
||||||
@ -66,7 +67,7 @@ const releaseTransaction = async (lockId: string) => {
|
|||||||
|
|
||||||
const solicitation = await getSolicitation(lockId);
|
const solicitation = await getSolicitation(lockId);
|
||||||
|
|
||||||
if (solicitation.confirmed) {
|
if (solicitation.status) {
|
||||||
const release = await releaseLock(solicitation);
|
const release = await releaseLock(solicitation);
|
||||||
await release.wait();
|
await release.wait();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user