Improve code quality by fixing lint issues
Co-authored-by: brunoedcf <brest.dallacosta@outlook.com>
This commit is contained in:
@@ -8,7 +8,6 @@ import p2pix from "../utils/smart_contract_files/P2PIX.json";
|
||||
import { BigNumber, ethers, type Event } from "ethers";
|
||||
import { formatEther, parseEther } from "ethers/lib/utils";
|
||||
|
||||
|
||||
// Buyer Flow methods //
|
||||
|
||||
// Make lock
|
||||
@@ -43,7 +42,6 @@ const releaseLock = async (
|
||||
e2eId: string,
|
||||
lockId: string
|
||||
) => {
|
||||
|
||||
const mockBacenSigner = new ethers.Wallet(
|
||||
"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
|
||||
);
|
||||
@@ -60,7 +58,7 @@ const releaseLock = async (
|
||||
const messageHashBytes = ethers.utils.arrayify(messageToSign);
|
||||
const flatSig = await mockBacenSigner.signMessage(messageHashBytes);
|
||||
const provider = getProvider();
|
||||
|
||||
|
||||
const sig = ethers.utils.splitSignature(flatSig);
|
||||
|
||||
const signer = provider.getSigner();
|
||||
@@ -105,9 +103,6 @@ const withdrawDeposit = async (depositId: BigNumber): Promise<Boolean> => {
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
|
||||
// Releases lock by specific ID and other additional data
|
||||
|
||||
|
||||
export { cancelDeposit, withdrawDeposit, addLock, releaseLock };
|
||||
|
||||
@@ -41,13 +41,12 @@ const getNetworksLiquidity = async () => {
|
||||
console.log(depositListMumbai);
|
||||
};
|
||||
|
||||
const getValidDeposits = async ( contract?: Contract ): Promise<any[]> => {
|
||||
const getValidDeposits = async (contract?: Contract): Promise<any[]> => {
|
||||
let p2pContract: Contract;
|
||||
|
||||
if (contract){
|
||||
if (contract) {
|
||||
p2pContract = contract;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
const provider = getProvider();
|
||||
const signer = provider.getSigner();
|
||||
|
||||
@@ -60,7 +59,9 @@ const getValidDeposits = async ( contract?: Contract ): Promise<any[]> => {
|
||||
const depositList: any[] = await Promise.all(
|
||||
eventsDeposits
|
||||
.map(async (deposit) => {
|
||||
const mappedDeposit = await p2pContract.mapDeposits(deposit.args?.depositID);
|
||||
const mappedDeposit = await p2pContract.mapDeposits(
|
||||
deposit.args?.depositID
|
||||
);
|
||||
let validDeposit = {};
|
||||
|
||||
if (mappedDeposit.valid) {
|
||||
@@ -69,7 +70,7 @@ const getValidDeposits = async ( contract?: Contract ): Promise<any[]> => {
|
||||
depositID: deposit.args?.depositID,
|
||||
remaining: formatEther(mappedDeposit.remaining),
|
||||
seller: mappedDeposit.seller,
|
||||
pixKey: mappedDeposit.pixTarget
|
||||
pixKey: mappedDeposit.pixTarget,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,6 @@ const listValidDepositTransactionsByWalletAddress = async (
|
||||
return [];
|
||||
};
|
||||
|
||||
|
||||
const listAllTransactionByWalletAddress = async (
|
||||
walletAddress: string
|
||||
): Promise<any[] | undefined> => {
|
||||
@@ -94,10 +93,9 @@ const listReleaseTransactionByWalletAddress = async (
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
export {
|
||||
export {
|
||||
updateWalletStatus,
|
||||
listValidDepositTransactionsByWalletAddress,
|
||||
listAllTransactionByWalletAddress,
|
||||
listReleaseTransactionByWalletAddress
|
||||
listReleaseTransactionByWalletAddress,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user