Fixing release method to V2.

This commit is contained in:
brunoedcf 2023-02-02 21:28:21 -03:00
parent 980c0cab76
commit c5b16559ff
3 changed files with 5 additions and 6 deletions

View File

@ -31,7 +31,7 @@ const addLock = async (
const lock_rec = await lock.wait();
const [t] = lock_rec.events;
return t.args.lockID;
return String(t.args.lockID);
};
const releaseLock = async (
@ -45,7 +45,7 @@ const releaseLock = async (
);
const messageToSign = ethers.utils.solidityKeccak256(
["string", "uint256", "bytes32"],
["uint160", "uint256", "bytes32"],
[
pixKey,
parseEther(String(amount)),
@ -63,7 +63,7 @@ const releaseLock = async (
const p2pContract = new ethers.Contract(getP2PixAddress(), p2pix.abi, signer);
const release = await p2pContract.release(
lockId,
BigNumber.from(lockId),
ethers.constants.AddressZero,
ethers.utils.formatBytes32String(e2eId),
sig.r,

View File

@ -22,7 +22,6 @@ const approveTokens = async (tokenQty: string): Promise<any> => {
);
await apprv.wait();
console.log(apprv);
return apprv;
};

View File

@ -48,8 +48,8 @@ const getEventName = (event: string | undefined): string => {
const possibleEventName: { [key: string]: string } = {
DepositAdded: "Oferta",
LockAdded: "Compra",
LockReleased: "Reserva",
LockAdded: "Reserva",
LockReleased: "Compra",
};
return possibleEventName[event];