Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ZumZoom committed Dec 20, 2023
1 parent 1d0db73 commit 582d4d3
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 91 deletions.
14 changes: 7 additions & 7 deletions test/ChainLinkExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ describe('ChainLinkExample', function () {
},
);
const signature = await signOrder(order, chainId, await swap.getAddress(), addr1);
const { r, yParityAndS: vs } = ethers.Signature(signature);
const { r, yParityAndS: vs } = ethers.Signature.from(signature);
// taking threshold = 4000 + 1% + eps
const takerTraits = buildTakerTraits({
extension: order.extension,
Expand Down Expand Up @@ -108,7 +108,7 @@ describe('ChainLinkExample', function () {
},
);
const signature = await signOrder(order, chainId, await swap.getAddress(), addr1);
const { r, yParityAndS: vs } = ethers.Signature(signature);
const { r, yParityAndS: vs } = ethers.Signature.from(signature);
// taking threshold = 1 eth + 1% + eps
const takerTraits = buildTakerTraits({
makingAmount: true,
Expand Down Expand Up @@ -148,7 +148,7 @@ describe('ChainLinkExample', function () {
},
);
const signature = await signOrder(order, chainId, await swap.getAddress(), addr1);
const { r, yParityAndS: vs } = ethers.Signature(signature);
const { r, yParityAndS: vs } = ethers.Signature.from(signature);
// taking threshold = 1 eth + 1% + eps
const takerTraits = buildTakerTraits({
makingAmount: true,
Expand Down Expand Up @@ -191,7 +191,7 @@ describe('ChainLinkExample', function () {
},
);
const signature = await signOrder(order, chainId, await swap.getAddress(), addr1);
const { r, yParityAndS: vs } = ethers.Signature(signature);
const { r, yParityAndS: vs } = ethers.Signature.from(signature);
// taking threshold = 1 eth + 1% + eps
const takerTraits = buildTakerTraits({
extension: order.extension,
Expand Down Expand Up @@ -227,7 +227,7 @@ describe('ChainLinkExample', function () {
},
);
const signature = await signOrder(order, chainId, await swap.getAddress(), addr1);
const { r, yParityAndS: vs } = ethers.Signature(signature);
const { r, yParityAndS: vs } = ethers.Signature.from(signature);
// taking threshold = exact taker amount + eps
const takerTraits = buildTakerTraits({
makingAmount: true,
Expand Down Expand Up @@ -258,7 +258,7 @@ describe('ChainLinkExample', function () {
},
);
const signature = await signOrder(order, chainId, await swap.getAddress(), addr1);
const { r, yParityAndS: vs } = ethers.Signature(signature);
const { r, yParityAndS: vs } = ethers.Signature.from(signature);
const takerTraits = buildTakerTraits({
makingAmount: true,
extension: order.extension,
Expand Down Expand Up @@ -292,7 +292,7 @@ describe('ChainLinkExample', function () {
},
);
const signature = await signOrder(order, chainId, await swap.getAddress(), addr1);
const { r, yParityAndS: vs } = ethers.Signature(signature);
const { r, yParityAndS: vs } = ethers.Signature.from(signature);
const takerTraits = buildTakerTraits({
makingAmount: true,
extension: order.extension,
Expand Down
12 changes: 6 additions & 6 deletions test/DutchAuctionCalculator.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('Dutch auction', function () {

await time.increaseTo(ts + 43200n); // 50% auction time

const { r, yParityAndS: vs } = ethers.Signature(signature);
const { r, yParityAndS: vs } = ethers.Signature.from(signature);
const takerTraits = buildTakerTraits({
makingAmount: true,
extension: order.extension,
Expand All @@ -83,7 +83,7 @@ describe('Dutch auction', function () {

await time.increaseTo(ts + 43200n); // 50% auction time

const { r, yParityAndS: vs } = ethers.Signature(signature);
const { r, yParityAndS: vs } = ethers.Signature.from(signature);
const takerTraits = buildTakerTraits({
extension: order.extension,
threshold: ether('100'),
Expand All @@ -99,7 +99,7 @@ describe('Dutch auction', function () {
it('swap with makingAmount 0% time passed', async function () {
const { dai, weth, swap, order, signature, makerDaiBefore, takerDaiBefore, makerWethBefore, takerWethBefore } = await loadFixture(deployAndBuildOrder);

const { r, yParityAndS: vs } = ethers.Signature(signature);
const { r, yParityAndS: vs } = ethers.Signature.from(signature);
const takerTraits = buildTakerTraits({
makingAmount: true,
extension: order.extension,
Expand All @@ -116,7 +116,7 @@ describe('Dutch auction', function () {
it('swap with takingAmount 0% time passed', async function () {
const { dai, weth, swap, order, signature, makerDaiBefore, takerDaiBefore, makerWethBefore, takerWethBefore } = await loadFixture(deployAndBuildOrder);

const { r, yParityAndS: vs } = ethers.Signature(signature);
const { r, yParityAndS: vs } = ethers.Signature.from(signature);
const takerTraits = buildTakerTraits({
extension: order.extension,
threshold: ether('100'),
Expand All @@ -134,7 +134,7 @@ describe('Dutch auction', function () {

await time.increaseTo(ts + 86500n); // >100% auction time

const { r, yParityAndS: vs } = ethers.Signature(signature);
const { r, yParityAndS: vs } = ethers.Signature.from(signature);
const takerTraits = buildTakerTraits({
makingAmount: true,
extension: order.extension,
Expand All @@ -153,7 +153,7 @@ describe('Dutch auction', function () {

await time.increaseTo(ts + 86500n); // >100% auction time

const { r, yParityAndS: vs } = ethers.Signature(signature);
const { r, yParityAndS: vs } = ethers.Signature.from(signature);
const takerTraits = buildTakerTraits({
extension: order.extension,
threshold: ether('100'),
Expand Down
24 changes: 12 additions & 12 deletions test/Interactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe('Interactions', function () {
],
).substring(2);

const { r: backOrderR, yParityAndS: backOrderVs } = ethers.Signature(signatureBackOrder);
const { r: backOrderR, yParityAndS: backOrderVs } = ethers.Signature.from(signatureBackOrder);
const takerTraits = buildTakerTraits({
interaction: matchingParams,
makingAmount: true,
Expand All @@ -96,7 +96,7 @@ describe('Interactions', function () {
const addrdai = await dai.balanceOf(addr);
const addr1dai = await dai.balanceOf(addr1);

const { r, yParityAndS: vs } = ethers.Signature(signature);
const { r, yParityAndS: vs } = ethers.Signature.from(signature);
const matcherTraits = buildTakerTraits({
interaction,
makingAmount: true,
Expand Down Expand Up @@ -150,7 +150,7 @@ describe('Interactions', function () {
],
).substring(2);

const { r: backOrderR, yParityAndS: backOrderVs } = ethers.Signature(signatureBackOrder);
const { r: backOrderR, yParityAndS: backOrderVs } = ethers.Signature.from(signatureBackOrder);
const takerTraits = buildTakerTraits({
interaction: matchingParams,
makingAmount: true,
Expand All @@ -171,7 +171,7 @@ describe('Interactions', function () {
const addr1dai = await dai.balanceOf(addr1);

await weth.approve(matcher, ether('0.025'));
const { r, yParityAndS: vs } = ethers.Signature(signature);
const { r, yParityAndS: vs } = ethers.Signature.from(signature);
const matcherTraits = buildTakerTraits({
interaction,
makingAmount: true,
Expand Down Expand Up @@ -233,7 +233,7 @@ describe('Interactions', function () {
],
).substring(2);

const { r: backOrderR, yParityAndS: backOrderVs } = ethers.Signature(signatureBackOrder);
const { r: backOrderR, yParityAndS: backOrderVs } = ethers.Signature.from(signatureBackOrder);
const internalTakerTraits = buildTakerTraits({
interaction: matchingParams,
makingAmount: true,
Expand All @@ -248,7 +248,7 @@ describe('Interactions', function () {
internalTakerTraits.args,
]).substring(10);

const { r: order2R, yParityAndS: order2Vs } = ethers.Signature(signature2);
const { r: order2R, yParityAndS: order2Vs } = ethers.Signature.from(signature2);
const externalTakerTraits = buildTakerTraits({
interaction: internalInteraction,
makingAmount: true,
Expand All @@ -268,7 +268,7 @@ describe('Interactions', function () {
const addrdai = await dai.balanceOf(addr);
const addr1dai = await dai.balanceOf(addr1);

const { r, yParityAndS: vs } = ethers.Signature(signature1);
const { r, yParityAndS: vs } = ethers.Signature.from(signature1);
const matcherTraits = buildTakerTraits({
interaction: externalInteraction,
makingAmount: true,
Expand Down Expand Up @@ -319,7 +319,7 @@ describe('Interactions', function () {

await hashChecker.setHashOrderStatus(order, true);

const { r, yParityAndS: vs } = ethers.Signature(signature);
const { r, yParityAndS: vs } = ethers.Signature.from(signature);
const takerTraits = buildTakerTraits({
threshold: ether('0.1'),
makingAmount: true,
Expand Down Expand Up @@ -352,7 +352,7 @@ describe('Interactions', function () {

const signature = await signOrder(order, chainId, await swap.getAddress(), addr1);

const { r, yParityAndS: vs } = ethers.Signature(signature);
const { r, yParityAndS: vs } = ethers.Signature.from(signature);
const takerTraits = buildTakerTraits({
threshold: ether('0.1'),
makingAmount: true,
Expand Down Expand Up @@ -398,7 +398,7 @@ describe('Interactions', function () {
const addrdai = await dai.balanceOf(addr);
const addr1dai = await dai.balanceOf(addr1);

const { r, yParityAndS: vs } = ethers.Signature(signature);
const { r, yParityAndS: vs } = ethers.Signature.from(signature);
const takerTraits = buildTakerTraits({
threshold: ether('0.1'),
makingAmount: true,
Expand Down Expand Up @@ -465,7 +465,7 @@ describe('Interactions', function () {
const addrdai = await dai.balanceOf(addr);
const addr1dai = await dai.balanceOf(addr1);

const { r, yParityAndS: vs } = ethers.Signature(signature);
const { r, yParityAndS: vs } = ethers.Signature.from(signature);
const takerTraits = buildTakerTraits({
threshold: ether('0.1'),
makingAmount: true,
Expand All @@ -478,7 +478,7 @@ describe('Interactions', function () {
expect(await dai.balanceOf(addr)).to.equal(addrdai - ether('50'));
expect(await dai.balanceOf(addr1)).to.equal(addr1dai + ether('50'));

const { r: r2, yParityAndS: vs2 } = ethers.Signature(signaturePartial);
const { r: r2, yParityAndS: vs2 } = ethers.Signature.from(signaturePartial);
const takerTraits2 = buildTakerTraits({
threshold: ether('0.1'),
makingAmount: true,
Expand Down
Loading

0 comments on commit 582d4d3

Please sign in to comment.