Fixing release method to V2.
This commit is contained in:
parent
980c0cab76
commit
c5b16559ff
@ -31,7 +31,7 @@ const addLock = async (
|
|||||||
const lock_rec = await lock.wait();
|
const lock_rec = await lock.wait();
|
||||||
const [t] = lock_rec.events;
|
const [t] = lock_rec.events;
|
||||||
|
|
||||||
return t.args.lockID;
|
return String(t.args.lockID);
|
||||||
};
|
};
|
||||||
|
|
||||||
const releaseLock = async (
|
const releaseLock = async (
|
||||||
@ -45,7 +45,7 @@ const releaseLock = async (
|
|||||||
);
|
);
|
||||||
|
|
||||||
const messageToSign = ethers.utils.solidityKeccak256(
|
const messageToSign = ethers.utils.solidityKeccak256(
|
||||||
["string", "uint256", "bytes32"],
|
["uint160", "uint256", "bytes32"],
|
||||||
[
|
[
|
||||||
pixKey,
|
pixKey,
|
||||||
parseEther(String(amount)),
|
parseEther(String(amount)),
|
||||||
@ -63,7 +63,7 @@ const releaseLock = async (
|
|||||||
const p2pContract = new ethers.Contract(getP2PixAddress(), p2pix.abi, signer);
|
const p2pContract = new ethers.Contract(getP2PixAddress(), p2pix.abi, signer);
|
||||||
|
|
||||||
const release = await p2pContract.release(
|
const release = await p2pContract.release(
|
||||||
lockId,
|
BigNumber.from(lockId),
|
||||||
ethers.constants.AddressZero,
|
ethers.constants.AddressZero,
|
||||||
ethers.utils.formatBytes32String(e2eId),
|
ethers.utils.formatBytes32String(e2eId),
|
||||||
sig.r,
|
sig.r,
|
||||||
|
@ -22,7 +22,6 @@ const approveTokens = async (tokenQty: string): Promise<any> => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
await apprv.wait();
|
await apprv.wait();
|
||||||
console.log(apprv);
|
|
||||||
return apprv;
|
return apprv;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -48,8 +48,8 @@ const getEventName = (event: string | undefined): string => {
|
|||||||
|
|
||||||
const possibleEventName: { [key: string]: string } = {
|
const possibleEventName: { [key: string]: string } = {
|
||||||
DepositAdded: "Oferta",
|
DepositAdded: "Oferta",
|
||||||
LockAdded: "Compra",
|
LockAdded: "Reserva",
|
||||||
LockReleased: "Reserva",
|
LockReleased: "Compra",
|
||||||
};
|
};
|
||||||
|
|
||||||
return possibleEventName[event];
|
return possibleEventName[event];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user