Improve code quality by fixing lint issues

Co-authored-by: brunoedcf <brest.dallacosta@outlook.com>
This commit is contained in:
RcleydsonR
2023-01-17 19:32:29 -03:00
parent 8338064dcd
commit c8a3fd12b2
8 changed files with 78 additions and 69 deletions

View File

@@ -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 };

View File

@@ -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,
};
}

View File

@@ -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,
};